Merge branch 'feature/trashcan' into develop
This commit is contained in:
+6
-1
@@ -520,7 +520,7 @@ class TeamRequest(models.Model):
|
||||
|
||||
from rowers.utils import (
|
||||
workflowleftpanel,workflowmiddlepanel,
|
||||
defaultleft,defaultmiddle,landingpages,
|
||||
defaultleft,defaultmiddle,landingpages,landingpages2,
|
||||
steps_read_fit, steps_write_fit, ps_dict_order
|
||||
)
|
||||
|
||||
@@ -993,6 +993,10 @@ class Rower(models.Model):
|
||||
max_length=200,
|
||||
choices=landingpages,
|
||||
verbose_name="Default Landing Page")
|
||||
defaultlandingpage2 = models.CharField(default='workout_flexchart_stacked_view',
|
||||
max_length=200,
|
||||
choices=landingpages2,
|
||||
verbose_name="Alternative Landing Page")
|
||||
|
||||
# Access tokens
|
||||
c2token = models.CharField(default='',max_length=200,blank=True,null=True)
|
||||
@@ -4280,6 +4284,7 @@ class AccountRowerForm(ModelForm):
|
||||
'fav_analysis',
|
||||
'usersmooth',
|
||||
'defaultlandingpage',
|
||||
'defaultlandingpage2',
|
||||
'offercoaching','autojoin','emailalternatives']
|
||||
|
||||
widgets = {
|
||||
|
||||
@@ -35,46 +35,7 @@
|
||||
|
||||
|
||||
<ul class="main-content">
|
||||
<li class="grid_2" style="min-height:200px;">
|
||||
<p>
|
||||
Total meters: {{ totalmeters }}. Total time {{ totalhours }}:{{ totalminutes }}h.
|
||||
<a href="/rowers/history/">Dig deeper</a>.
|
||||
</p>
|
||||
<p>
|
||||
Activity chart by
|
||||
<a href="{{ request.get_path }}?yaxis=trimp">TRIMP</a>,
|
||||
<a href="{{ request.get_path }}?yaxis=rscore">rScore</a>,
|
||||
<a href="{{ request.get_path }}?yaxis=duration">Time</a>.
|
||||
</p>
|
||||
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-2.2.3.min.css" type="text/css" />
|
||||
<script src="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.js"></script>
|
||||
<script async="true" type="text/text/javascript">
|
||||
Bokeh.set_log_level("info")
|
||||
</script>
|
||||
|
||||
{{ interactiveplot |safe }}
|
||||
|
||||
{{ the_div |safe }}
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<p>Filter on date
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<table>
|
||||
{{ dateform.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
</p>
|
||||
<p>and keyword</p>
|
||||
<p>
|
||||
{{ searchform }}
|
||||
</p>
|
||||
<p>
|
||||
<input name='daterange' type="submit" value="Select workouts">
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<p>
|
||||
<li class="grid_4">
|
||||
<span>
|
||||
{% if workouts.has_previous %}
|
||||
{% if request.GET.q %}
|
||||
@@ -118,7 +79,6 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
{% if workouts %}
|
||||
@@ -137,7 +97,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="workoutcontainer">
|
||||
<div>
|
||||
<div class="icondiv">
|
||||
{% with workout.workouttype|icon|safe as templateName %}
|
||||
{% include templateName %}
|
||||
{% endwith %}
|
||||
@@ -154,8 +114,25 @@
|
||||
{% if workout|may_edit:request %}
|
||||
<a class="small"
|
||||
href={% url rower.defaultlandingpage id=workout.id|encode %}
|
||||
title="Edit">
|
||||
<i class="fas fa-search fa-fw"></i></a>
|
||||
title="{{ rower.defaultlandingpage|verbose }}">
|
||||
<i class="{{ rower.defaultlandingpage|landingicon }}"></i></a>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="workoutelement">
|
||||
{% if workout|may_edit:request %}
|
||||
{% if rower.defaultlandingpage2 != 'workout_delete' %}
|
||||
<a class="small"
|
||||
href={% url rower.defaultlandingpage2 id=workout.id|encode %}
|
||||
title="{{ rower.defaultlandingpage2|verbose }}">
|
||||
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
||||
{% else %}
|
||||
<a class="small"
|
||||
href={% url rower.defaultlandingpage2 pk=workout.id|encode %}
|
||||
title="{{ rower.defaultlandingpage2|verbose }}">
|
||||
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
@@ -168,6 +145,45 @@
|
||||
{% else %}
|
||||
<li> No workouts found </li>
|
||||
{% endif %}
|
||||
<li class="grid_4">
|
||||
<p>Filter on date
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<table>
|
||||
{{ dateform.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
</p>
|
||||
<p>and keyword</p>
|
||||
<p>
|
||||
{{ searchform }}
|
||||
</p>
|
||||
<p>
|
||||
<input name='daterange' type="submit" value="Select workouts">
|
||||
</form>
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_4" style="min-height:400px;">
|
||||
<p>
|
||||
Total meters: {{ totalmeters }}. Total time {{ totalhours }}:{{ totalminutes }}h.
|
||||
<a href="/rowers/history/">Dig deeper</a>.
|
||||
</p>
|
||||
<p>
|
||||
Activity chart by
|
||||
<a href="{{ request.get_path }}?yaxis=trimp">TRIMP</a>,
|
||||
<a href="{{ request.get_path }}?yaxis=rscore">rScore</a>,
|
||||
<a href="{{ request.get_path }}?yaxis=duration">Time</a>.
|
||||
</p>
|
||||
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-2.2.3.min.css" type="text/css" />
|
||||
<script src="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.js"></script>
|
||||
<script async="true" type="text/text/javascript">
|
||||
Bokeh.set_log_level("info")
|
||||
</script>
|
||||
|
||||
{{ interactiveplot |safe }}
|
||||
|
||||
{{ the_div |safe }}
|
||||
</li>
|
||||
{% if announcements %}
|
||||
<li class="grid_4">
|
||||
<h3>What's New?</h3>
|
||||
|
||||
@@ -27,7 +27,7 @@ from rowers.mytypes import (
|
||||
otwtypes,adaptivetypes,sexcategories,weightcategories,workouttypes,
|
||||
workouttypes_icons,
|
||||
)
|
||||
from rowers.utils import NoTokenError, step_to_string
|
||||
from rowers.utils import NoTokenError, step_to_string, landingpages2
|
||||
|
||||
import rowers.payments as payments
|
||||
|
||||
@@ -72,16 +72,29 @@ favanalysisdict = {}
|
||||
for key,value in favanalysischoices:
|
||||
favanalysisdict[key] = value
|
||||
|
||||
favanalysisicons = {
|
||||
'compare':'fa-balance-scale',
|
||||
'stats':'fa-table',
|
||||
'boxplot':'fa-box-open',
|
||||
'trendflex':'fa-chart-line',
|
||||
'histogram':'fa-chart-bar',
|
||||
'flexall':'fa-chart-line',
|
||||
'cp':'fa-user-chart',
|
||||
landingpagedict = {}
|
||||
for key, value in landingpages2:
|
||||
landingpagedict[key] = value
|
||||
|
||||
landingpageicons = {
|
||||
'workout_view':'fas fa-search fa-fw',
|
||||
'workout_edit_view':'fas fa-pencil-alt fa-fw',
|
||||
'workout_workflow_view':'fas fa-tachometer-alt fa-fw',
|
||||
'workout_stats_view':'fal fa-table fa-fw',
|
||||
'workout_data_view':'fal fa-table fa-fw',
|
||||
'workout_summary_edit_view':'fas fa-pause fa-fw',
|
||||
'workout_flexchart_stacked_view':'fas fa-align-justify fa-fw',
|
||||
'workout_flexchart3_view':'fas fa-chart-line fa-fw',
|
||||
'workout_delete':'fas fa-trash-alt fa-fw'
|
||||
}
|
||||
|
||||
@register.filter
|
||||
def landingicon(landingpage):
|
||||
try:
|
||||
return landingpageicons[landingpage]
|
||||
except KeyError:
|
||||
return 'fas fa-search fa-fw'
|
||||
|
||||
@register.filter
|
||||
def steptostring(steps):
|
||||
res = ps_dict_get_description_html(steps,short=True)
|
||||
@@ -91,16 +104,9 @@ def steptostring(steps):
|
||||
@register.filter
|
||||
def verbose(s):
|
||||
try:
|
||||
return favanalysisdict[s]
|
||||
return landingpagedict[s]
|
||||
except KeyError: # pragma: no cover
|
||||
return ''
|
||||
|
||||
@register.filter
|
||||
def icon(s):
|
||||
try:
|
||||
return favanalysisicons[s]
|
||||
except KeyError: # pragma: no cover
|
||||
return 'fa-chart-line'
|
||||
return 'Details'
|
||||
|
||||
@register.filter
|
||||
def datarows(data): # pragma: no cover
|
||||
|
||||
@@ -46,6 +46,19 @@ landingpages = (
|
||||
('workout_flexchart3_view','Workout Flex Chart')
|
||||
)
|
||||
|
||||
landingpages2 = (
|
||||
('workout_view', 'Workout View'),
|
||||
('workout_edit_view','Edit View'),
|
||||
('workout_workflow_view','Workflow View'),
|
||||
('workout_stats_view','Stats View'),
|
||||
('workout_data_view','Data Explore View'),
|
||||
('workout_summary_edit_view','Intervals Editor'),
|
||||
('workout_flexchart_stacked_view','Workout Stacked Chart'),
|
||||
('workout_flexchart3_view','Workout Flex Chart'),
|
||||
('workout_delete','Remove Workout')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
workflowmiddlepanel = (
|
||||
|
||||
@@ -1981,7 +1981,7 @@ def workouts_view(request,message='',successmessage='',
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,10) # show 25 workouts per page
|
||||
paginator = Paginator(workouts,12) # show 25 workouts per page
|
||||
page = request.GET.get('page',1)
|
||||
|
||||
try:
|
||||
|
||||
@@ -328,20 +328,28 @@ th.rotate > div > span {
|
||||
border-width: 1px 0 0 0;
|
||||
border-color: #333 #333 #333 #333;
|
||||
border-style: solid;
|
||||
padding: 2px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.workoutcontainer {
|
||||
display: grid;
|
||||
grid-template-columns: 50px repeat(auto-fit, minmax(calc((100% - 100px)/4), 1fr));
|
||||
grid-template-columns: 50px repeat(auto-fit, minmax(calc((100% - 100px)/5), 1fr));
|
||||
/* grid-template-columns: 50px repeat(auto-fit, minmax(100px, 1fr)) 50px; ????*/
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.workoutelement {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.icondiv {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.divlines h3 {
|
||||
|
||||
Reference in New Issue
Block a user