Private
Public Access
1
0

Merge branch 'release/v10.70'

This commit is contained in:
Sander Roosendaal
2019-12-15 11:24:35 +01:00
10 changed files with 23 additions and 9 deletions
+4 -2
View File
@@ -1398,6 +1398,7 @@ class TrainingPlan(models.Model):
status = models.BooleanField(default=True,verbose_name='Active') status = models.BooleanField(default=True,verbose_name='Active')
target = models.ForeignKey(TrainingTarget,blank=True,null=True,on_delete=models.SET_NULL) target = models.ForeignKey(TrainingTarget,blank=True,null=True,on_delete=models.SET_NULL)
startdate = models.DateField(default=current_day) startdate = models.DateField(default=current_day)
notes = models.CharField(blank=True,null=True,max_length=200,verbose_name='Plan Notes')
enddate = models.DateField( enddate = models.DateField(
default=half_year_from_now) default=half_year_from_now)
@@ -1476,11 +1477,12 @@ class TrainingPlan(models.Model):
class TrainingPlanForm(ModelForm): class TrainingPlanForm(ModelForm):
class Meta: class Meta:
model = TrainingPlan model = TrainingPlan
fields = ['name','target','startdate','enddate','status','rowers'] fields = ['name','target','startdate','enddate','status','notes','rowers']
widgets = { widgets = {
'startdate': AdminDateWidget(), 'startdate': AdminDateWidget(),
'enddate': AdminDateWidget() 'enddate': AdminDateWidget(),
'notes': forms.Textarea()
} }
def __init__(self,*args, **kwargs): def __init__(self,*args, **kwargs):
+8 -3
View File
@@ -24,6 +24,11 @@
The training plan target is: {{ plan.target.name }} on {{ plan.target.date }}. The training plan target is: {{ plan.target.name }} on {{ plan.target.date }}.
{% endif %} {% endif %}
</p> </p>
<h2>Notes</h2>
<p>
{{ plan.notes }}
</p>
{% if plan|mayeditplan:request %} {% if plan|mayeditplan:request %}
<p><a href="/rowers/editplan/{{ plan.id }}">Edit the plan</a></p> <p><a href="/rowers/editplan/{{ plan.id }}">Edit the plan</a></p>
{% endif %} {% endif %}
@@ -303,7 +308,7 @@
</th> </th>
</tr> </tr>
{% if todays_date <= microcycle.enddate %} {% if todays_date <= microcycle.enddate %}
{% if microcycle.plan.type == 'userdefined' %} {% if microcycle.plan.type == 'userdefined' %}
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
@@ -381,7 +386,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
{% if microcycle|mayeditplan:request %} {% if microcycle|mayeditplan:request %}
<a href="/rowers/microcycle/{{ microcycle.id }}">edit</a> <a href="/rowers/microcycle/{{ microcycle.id }}">edit</a>
/ /
<a href="/rowers/deletemicrocycle/{{ microcycle.id }}">delete</a> <a href="/rowers/deletemicrocycle/{{ microcycle.id }}">delete</a>
@@ -427,7 +432,7 @@
The gray "filler" The gray "filler"
cycles are generated, adjusted and deleted automatically to cycles are generated, adjusted and deleted automatically to
ensure the entire plan ensure the entire plan
duration is covered with non-overlapping cycles. duration is covered with non-overlapping cycles.
Once you edit a filler cycle, it become a user-defined Once you edit a filler cycle, it become a user-defined
cycle, which cannot be deleted cycle, which cannot be deleted
by the system.</p> by the system.</p>
+3 -1
View File
@@ -1557,7 +1557,7 @@ def plannedsession_totemplate_view(request,id=0):
ps.enddate = datetime.date(1970,1,1) ps.enddate = datetime.date(1970,1,1)
ps.save() ps.save()
url = reverse(plannedsession_create_view,kwargs={'userid':request.user.id}) url = reverse(plannedsession_create_view,kwargs={'userid':r.user.id})
startdatestring = startdate.strftime('%Y-%m-%d') startdatestring = startdate.strftime('%Y-%m-%d')
enddatestring = enddate.strftime('%Y-%m-%d') enddatestring = enddate.strftime('%Y-%m-%d')
@@ -2021,6 +2021,7 @@ def rower_create_trainingplan(request,userid=0):
startdate = form.cleaned_data['startdate'] startdate = form.cleaned_data['startdate']
status = form.cleaned_data['status'] status = form.cleaned_data['status']
enddate = form.cleaned_data['enddate'] enddate = form.cleaned_data['enddate']
notes = form.cleaned_data['notes']
try: try:
athletes = form.cleaned_data['rowers'] athletes = form.cleaned_data['rowers']
@@ -2033,6 +2034,7 @@ def rower_create_trainingplan(request,userid=0):
manager=themanager, manager=themanager,
startdate=startdate, startdate=startdate,
enddate=enddate,status=status, enddate=enddate,status=status,
notes=notes,
) )
p.save() p.save()
+2 -3
View File
@@ -5171,12 +5171,11 @@ def workout_split_view(request,id=0):
ids,mesgs = dataprep.split_workout( ids,mesgs = dataprep.split_workout(
r,row,splitsecond,splitmode r,row,splitsecond,splitmode
) )
for message in mesgs:
messages.info(request,message)
except IndexError: except IndexError:
messages.error(request,"Something went wrong in Split") messages.error(request,"Something went wrong in Split")
for message in mesgs:
messages.info(request,message)
if request.user == r: if request.user == r:
url = reverse('workouts_view') url = reverse('workouts_view')
+1
View File
@@ -0,0 +1 @@
{"Lin":0.9,"Mb":14,"BladeLength":0.46,"Lscull":2.425,"Nrowers":1,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":0.98}
+1
View File
@@ -0,0 +1 @@
{"Lin":1.14,"Mb":27,"BladeLength":0.46,"Lscull":2.975,"Nrowers":2,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1.05}
+1
View File
@@ -0,0 +1 @@
{"Lin":0.9,"Mb":27,"BladeLength":0.46,"Lscull":2.425,"Nrowers":2,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":1.05}
+1
View File
@@ -0,0 +1 @@
{"Lin":1.14,"Mb":50,"BladeLength":0.545,"Lscull":2.9325,"Nrowers":4,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1}
+1
View File
@@ -0,0 +1 @@
{"Lin":0.9,"Mb":52,"BladeLength":0.46,"Lscull":2.425,"Nrowers":4,"RowOrScull":"scull","Span":1.6,"CatchAngle":-0.93,"DragForm":1.11}
+1
View File
@@ -0,0 +1 @@
{"Lin":1.14,"Mb":151,"BladeLength":0.545,"Lscull":2.9325,"Nrowers":8,"RowOrScull":"row","Span":1.6,"CatchAngle":-0.93,"DragForm":1}