diff --git a/rowers/templates/plannedsession_multicreate.html b/rowers/templates/plannedsession_multicreate.html index b5afa83d..c496758e 100644 --- a/rowers/templates/plannedsession_multicreate.html +++ b/rowers/templates/plannedsession_multicreate.html @@ -100,8 +100,9 @@ {% endfor %} - Add More + Add More + Clone multiple sessions
diff --git a/rowers/templates/plannedsessioncreate.html b/rowers/templates/plannedsessioncreate.html index 7cc32aab..6c1e8f58 100644 --- a/rowers/templates/plannedsessioncreate.html +++ b/rowers/templates/plannedsessioncreate.html @@ -96,10 +96,10 @@ {{ ps.sessionvalue }} {{ ps.sessionunit }} - Edit + Edit - Clone + Clone diff --git a/rowers/templates/plannedsessionedit.html b/rowers/templates/plannedsessionedit.html index 4abbe83b..28847759 100644 --- a/rowers/templates/plannedsessionedit.html +++ b/rowers/templates/plannedsessionedit.html @@ -90,16 +90,10 @@ {{ ps.sessionvalue }} {{ ps.sessionunit }} - {% if timeperiod and rower %} Edit - {% elif timeperiod %} - Edit - {% else %} - Edit - {% endif %} - Clone + Clone Delete @@ -130,7 +124,7 @@ Clone
- +
diff --git a/rowers/templates/plannedsessions_multiclone_select.html b/rowers/templates/plannedsessions_multiclone_select.html index 7ee2b39a..773afaa0 100644 --- a/rowers/templates/plannedsessions_multiclone_select.html +++ b/rowers/templates/plannedsessions_multiclone_select.html @@ -95,15 +95,15 @@ Last Week + href="/rowers/sessions/multiclone/lastmonth"> Last Month + href="/rowers/sessions/multiclone/nextweek"> Next Week + href="/rowers/sessions/multiclone/nextmonth"> Next Month
diff --git a/rowers/views.py b/rowers/views.py index 8c912f98..16d1b947 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -11581,7 +11581,7 @@ def agegrouprecordview(request,sex='male',weightcategory='hwt', @user_passes_test(hasplannedsessions,login_url="/rowers/planmembership/", redirect_field_name=None) def plannedsession_multiclone_view( - request,timeperiod='nextweek', + request,timeperiod='none', rowerid=0, startdate=timezone.now()-datetime.timedelta(days=30), enddate=timezone.now()+datetime.timedelta(days=1)): @@ -11603,6 +11603,10 @@ def plannedsession_multiclone_view( if 'enddate' in request.session: enddate = iso8601.parse_date(request.session['enddate']) + if timeperiod != 'none': + startdate,enddate = get_dates_timeperiod(timeperiod) + + if request.method == 'POST' and 'daterange' in request.POST: dateform = DateRangeForm(request.POST) if dateform.is_valid(): @@ -11647,10 +11651,6 @@ def plannedsession_multiclone_view( return HttpResponseRedirect(url) - startdate = datetime.datetime.combine(startdate,datetime.time()) - enddate = datetime.datetime.combine(enddate,datetime.time(23,59,59)) - enddate = enddate+datetime.timedelta(days=1) - sps = PlannedSession.objects.filter( manager=request.user, rower__in=[r],