Private
Public Access
1
0

lots of ui changes

This commit is contained in:
Sander Roosendaal
2021-03-08 12:02:11 +01:00
parent 35d97797c7
commit 760ac8702d
9 changed files with 148 additions and 601 deletions

View File

@@ -5,29 +5,10 @@
{% block title %}New Planned Session{% endblock %}
{% block main %}
<h1>Create Sessions for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
<h1>New Session</h1>
<ul class="main-content">
<li class="grid_2">
<p>
<form enctype="multipart/form-data" method="get">
<table>
{{ dateform.as_table }}
</table>
<input type="Submit" value="Set Date Range">
</form>
</p>
</li>
<li class="grid_2">
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
{{ timeperiod|timedeltadays }} days</a>
</p>
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
{{ timeperiod|timedeltadays }} days</a>
</p>
</li>
<li class="grid_2">
<h1>New Session</h1>
<li class="grid_4">
<form enctype="multipart/form-data" action=""
method="post">
{% if form.errors %}
@@ -40,120 +21,12 @@
{{ form.as_table }}
</table>
{% csrf_token %}
<input class="button" type="submit" value="Save">
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p><input class="button" type="submit" value="Save and Create New Session" name="_addanother"></p>
</form>
<div class="padded" id="id_guidance">
</li>
<li class="grid_2">
<h1>Plan</h1>
<p>
Click on session name to view
</p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>After</th>
<th>Before</th>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Clone</th>
<th>Delete</th>
<th>Library</th>
</tr>
</thead>
<tbody>
{% for ps in plannedsessions %}
<tr>
<td> {{ ps.startdate|date:"Y-m-d" }} </td>
<td> {{ ps.enddate|date:"Y-m-d" }} </td>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/edit/user/{{ rower.user.id }}/?when={{ timeperiod }}/?when={{ timeperiod }}">
<i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}/?when={{ timeperiod }}">
<i class="fas fa-clone fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/maketemplate/"><i class="fas fa-books fa-fw"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
<li class="grid_2">
<h1>Session Library</h1>
{% if alltags %}
<p>
Click on a tag to filter:
{% for tag in alltags %}
<a href="/rowers/sessions/create/?when={{ timeperiod }}&tag={{ tag }}">{{ tag }}</a>
{% endfor %}
</p>
<p>
<a href="/rowers/sessions/create/?when={{ timeperiod }}">Clear tags</a>
</p>
{% endif %}
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Copy to Calendar</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in sessiontemplates %}
<tr>
<td>
{% if ps.name != '' %}
{{ ps.name }}
{% else %}
Unnamed Session
{% endif %}
</td>
<td> {{ ps.sessionvalue }} {{ ps.sessionunit }} </td>
<td>
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">
<i class="fas fa-clone fa-fw"></i>
</a>
</td>
{% if ps.manager == request.user %}
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/?next={{ request.path|urlencode }}"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
{% else %}
<td></td><td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</li>
</ul>
{% endblock %}

View File

@@ -10,25 +10,7 @@
<ul class="main-content">
<li class="grid_2">
<p>
<form enctype="multipart/form-data" method="get">
<table>
{{ dateform.as_table }}
</table>
<input type="Submit" value="Set Date Range">
</form>
</p>
</li>
<li class="grid_2">
<p><a href="/rowers/sessions/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
{{ timeperiod|timedeltadays }} days</a>
</p>
<p><a href="/rowers/sessions/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
{{ timeperiod|timedeltadays }} days</a>
</p>
</li>
<li class="grid_2">
<li class="grid_4">
<h2>{{ thesession.name }}</h2>
{% if user.is_authenticated and user|is_manager %}
<p>
@@ -52,104 +34,16 @@
<div id="id_guidance">
</div>
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p>
<a href="/rowers/sessions/{{ thesession.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i> Delete</a>
<a href="/rowers/sessions/{{ thesession.id }}/clone/?when={{ timeperiod }}"><i class="fas fa-clone fa-fw"></i> Clone</a>
</p>
<input class="button"
action="/rowers/sessions/{{ thesession.id }}/edit/user/{{ rower.user.id }}/" type="submit" value="Save">
</form>
</li>
<li class="grid_2">
<h2>Plan</h2>
<p>
Click on session name to view
</p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>After</th>
<th>Before</th>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Clone</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in plannedsessions %}
<tr>
<td> {{ ps.startdate|date:"Y-m-d" }} </td>
<td> {{ ps.enddate|date:"Y-m-d" }} </td>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/edit/user/{{ rower.user.id }}/?when={{ timeperiod }}"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}"><i class="fas fa-clone fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
<li class="grid_2">
<h1>Session Library</h1>
<p>
Click on session name to clone to current period
</p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in sessiontemplates %}
<tr>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/"><i class="fas fa-trash-alt fa-fw"></i> Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
</ul>
{% endblock %}

View File

@@ -9,13 +9,14 @@
<h1>Planned Sessions for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
<p>
<a href="/rowers/sessions/create/?when={{ timeperiod }}"> <i class="far fa-calendar-plus fa-fw"></i>&nbsp;Add Session
<a href="/rowers/sessions/create/?when={{ timeperiod }}"> <i class="fas fa-calendar-plus fa-fw"></i>&nbsp;Add Session
</a>
{% if request.user|user_teams %}
<a href="/rowers/sessions/teamcreate/?when={{ timeperiod }}">
<i class="fas fa-whistle fa-fw"></i>&nbsp;Add Group Session
</a>
{% endif %}
<a href="/rowers/sessions/library/"><i class="fas fa-books fa-fw"></i>&nbsp;Add Session from Library</a>
</p>
<ul class="main-content">
@@ -40,8 +41,7 @@
<li class="grid_4">
{% if plannedsessions %}
<p>
Click on session name to view, edit to change the session and on the
traffic light symbol to add workouts to the session
Click on the session name to view, on the circle to attach workouts to the session.
</p>
<table width="90%" class="listtable shortpadded">
<thead>
@@ -53,6 +53,8 @@
<th align="left">Type</th>
<th align="left">Mode</th>
<th align="left">Edit</th>
<th align="left">Clone</th>
<th align="left">Delete</th>
<th align="left">Planned</th>
<th align="left">Actual</th>
<th align="left">&nbsp;</th>
@@ -106,6 +108,22 @@
{% else %}
&nbsp;
{% endif %}
</td>
<td>
{% if ps.manager == request.user %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}"><i class="fas fa-clone fa-fw"></i></a>
{% else %}
&nbsp;
{% endif %}
</td>
<td>
{% if ps.manager == request.user %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i></a>
{% else %}
&nbsp;
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ actualvalue|lookup:ps.id }}</td>

View File

@@ -5,163 +5,37 @@
{% block title %}New Planned Session{% endblock %}
{% block main %}
<h1>Create Team Session</h1>
<h1>New Team Session</h1>
<ul class="main-content">
<li class="grid_2">
<p>
<form enctype="multipart/form-data" method="get">
<table>
{{ dateform.as_table }}
</table>
<input type="Submit" value="Set Date Range">
</form>
</p>
</li>
<li class="grid_2">
<p><a href="/rowers/sessions/teamcreate/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
{{ timeperiod|timedeltadays }} days</a>
</p>
<p><a href="/rowers/sessions/teamcreate/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
{{ timeperiod|timedeltadays }} days</a>
</p>
</li>
</ul>
<li class="grid_4">
<form enctype="multipart/form-data" action="" method="post">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
<ul class="main-content">
<li class="grid_2">
{% csrf_token %}
<h1>New Team Session</h1>
<table>
{{ teamform.as_table }}
</table>
<table>
{{ form.as_table }}
</table>
<input class="button green" type="submit" value="Save">
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p><input class="button" type="submit" value="Save and Create New Session" name="_addanother"></p>
<div id="id_guidance" class="padded">
</div>
</li>
{% if plannedsessions %}
<li class="grid_2">
<h1>Team Plan Sessions</h1>
<p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>After</th>
<th>Before</th>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Clone</th>
<th>Delete</th>
<th>To Library</th>
</tr>
</thead>
<tbody>
{% for ps in plannedsessions %}
<tr>
<td> {{ ps.startdate|date:"Y-m-d" }} </td>
<td> {{ ps.enddate|date:"Y-m-d" }} </td>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/edit/"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/clone/"><i class="fas fa-clone fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/maketemplate/"><i class="fas fa-books fa-fw"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</p>
</li>
{% endif %}
<li class="grid_2">
<h1>Session Library</h1>
{% if alltags %}
<p>
Click on a tag to filter:
{% for tag in alltags %}
<a href="/rowers/sessions/create/?when={{ timeperiod }}&tag={{ tag }}">{{ tag }}</a>
{% endfor %}
</p>
<p>
<a href="/rowers/sessions/create/?when={{ timeperiod }}">Clear tags</a>
</p>
{% endif %}
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Copy to Calendar</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in sessiontemplates %}
<tr>
<td>
{% if ps.name != '' %}
{{ ps.name }}
{% else %}
Unnamed Session
{% endif %}
</td>
<td> {{ ps.sessionvalue }} {{ ps.sessionunit }} </td>
<td>
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/team/">
<i class="fas fa-clone fa-fw"></i>
</a>
</td>
{% if ps.manager == request.user %}
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/?next={{ request.path|urlencode }}"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
{% else %}
<td></td><td></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</li>
</ul>
</form>
</li>
</ul>
{% endblock %}

View File

@@ -5,129 +5,37 @@
{% block title %}New Planned Session{% endblock %}
{% block main %}
<h1>Edit Team Session</h1>
<h1>Edit Session {{ plannedsession.name }}</h1>
<ul class="main-content">
<li class="grid_2">
<li class="grid_4">
<p>
<form enctype="multipart/form-data" method="get">
<table>
{{ dateform.as_table }}
</table>
<input type="Submit" value="Set Date Range">
</form>
</p>
</li>
<li class="grid_2">
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|previousperiodstart }}&enddate={{ timeperiod|previousperiodend}}">Back by
{{ timeperiod|timedeltadays }} days</a>
</p>
<p><a href="/rowers/sessions/coach/?startdate={{ timeperiod|nextperiodstart }}&enddate={{ timeperiod|nextperiodend}}">Forward by
{{ timeperiod|timedeltadays }} days</a>
</p>
</li>
</ul>
<form enctype="multipart/form-data" action="" method="post">
{% if form.errors %}
<p style="color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
{% csrf_token %}
<ul class="main-content">
<li class="grid_2">
<h1>Select Team</h1>
<p>
Selecting a team assigns this session to all members of the team.
Unselecting a team does not remove rowers
who are already assigned to this session. Use the Rowers selection for that.
</p><p>
<table>
{{ teamform.as_table }}
</table></p>
</li>
<li class="grid_2">
<h1>Select Rowers</h1>
<p>
</table>
<table>
{{ rowersform.as_table }}
</table>
</p>
</li>
<li class="grid_2">
<h1>Session {{ plannedsession.name }}</h1>
<li class="grid_4">
<table>
{{ form.as_table }}
</table>
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p>
<a href="/rowers/sessions/{{ plannedsession.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i> Delete</a>
</p>
<p>
<a href="/rowers/sessions/{{ plannedsession.id }}/clone"><i class="fas fa-clone fa-fw"></i> Clone</a>
</p>
<p>
<input type="submit" value="Save">
</p>
<div id="id_guidance" class="padded">
</div>
</li>
<li class="grid_2">
{% if plannedsessions %}
<h1>Team Plan Sessions</h1>
<p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>After</th>
<th>Before</th>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Clone</th>
<th>Delete</th>
<th>To Library</th>
</tr>
</thead>
<tbody>
{% for ps in plannedsessions %}
<tr>
<td> {{ ps.startdate|date:"Y-m-d" }} </td>
<td> {{ ps.enddate|date:"Y-m-d" }} </td>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/edit"><i class="fas fa-pencil-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/clone"><i class="fas fa-clone fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i></a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/maketemplate/"><i class="fas fa-books fa-fw"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</p>
{% endif %}
</li>
</ul>
</form>
{% endblock %}

View File

@@ -5,13 +5,12 @@
{% block title %}Create Library Session{% endblock %}
{% block main %}
<h1>Edit Session Template</h1>
<h1>Create New Library Session</h1>
<ul class="main-content">
<li class="grid_2">
<h2>Create New Library Session</h2>
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %}
<p style="color: red;">
@@ -27,51 +26,12 @@
<div id="id_guidance">
</div>
<input class="button"
type="submit" value="Save">
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p><input class="button" type="submit" value="Save and Create New Session" name="_addanother"></p>
</form>
</li>
<li class="grid_2">
<h1>Library</h1>
<p>
Click on session name to clone to current period
</p>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in sessiontemplates %}
<tr>
<td>
{% if ps.name != '' %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">{{ ps.name }}</a>
{% else %}
<a class="small"
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">Unnamed Session</a>
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/"><i class="fas fa-pencil-alt fa-fw"></i> </a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/"><i class="fas fa-trash-alt fa-fw"></i> </a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
</ul>
{% endblock %}

View File

@@ -5,13 +5,12 @@
{% block title %}Update Library Session{% endblock %}
{% block main %}
<h1>Edit Session Template</h1>
<h1>Edit Library Session: {{ thesession.name }}</h1>
<ul class="main-content">
<li class="grid_2">
<h2>{{ thesession.name }}</h2>
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %}
<p style="color: red;">
@@ -27,49 +26,15 @@
<div id="id_guidance">
</div>
<p><input class="button" type="submit" value="Save" name="_save"></p>
<p><input class="button" type="submit" value="Save and Keep Editing" name="_continue"></p>
<p>
<a href="/rowers/sessions/{{ thesession.id }}/deleteconfirm"><i class="fas fa-trash-alt fa-fw"></i> Delete</a>
</p>
<input class="button"
action="/rowers/sessions/{{ thesession.id }}/templateedit/" type="submit" value="Save">
</form>
</li>
<li class="grid_2">
<h1>Library</h1>
<table class="listtable shortpadded" width="80%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>&nbsp;</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
{% for ps in sessiontemplates %}
<tr>
<td>
{% if ps.name != '' %}
{{ ps.name }}
{% else %}
Unnamed Session
{% endif %}
</td>
<td> {{ ps.sessionvalue }} </td>
<td> {{ ps.sessionunit }} </td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/"><i class="fas fa-pencil-alt fa-fw"></i> </a>
</td>
<td>
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/"><i class="fas fa-trash-alt fa-fw"></i> </a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
</ul>
{% endblock %}

View File

@@ -838,8 +838,10 @@ urlpatterns = [
re_path(r'^sessions/multicreate/user/(?P<userid>\d+)/$',
views.plannedsession_multicreate_view,
name='plannedsession_multicreate_view'),
re_path(r'^sessions/(?P<id>\d+)/edit/$',views.plannedsession_edit_view),
re_path(r'^sessions/(?P<id>\d+)/templateedit/',views.plannedsession_templateedit_view),
re_path(r'^sessions/(?P<id>\d+)/edit/$',views.plannedsession_edit_view,
name='plannedsession_edit_view'),
re_path(r'^sessions/(?P<id>\d+)/templateedit/',views.plannedsession_templateedit_view,
name='plannedsession_templateedit_view'),
re_path(r'^sessions/(?P<id>\d+)/maketemplate/$',views.plannedsession_totemplate_view),
re_path(r'^sessions/(?P<id>\d+)/compare/$',
views.plannedsession_compare_view,

View File

@@ -531,9 +531,18 @@ def plannedsession_create_view(request,
request.session['fenddate'] = str(arrow.get(ps.enddate))
request.session['fprefdate'] = str(arrow.get(ps.preferreddate))
url = reverse(plannedsessions_view,kwargs={
'userid':userid,
})
if '_continue' in request.POST:
url = reverse('plannedsession_edit_view',kwargs={
'id':ps.id,
})
elif '_addanother' in request.POST:
url = reverse('plannedsession_create_view',kwargs={'userid':userid})
return HttpResponseRedirect(url)
else:
@@ -639,11 +648,23 @@ def plannedsession_create_view(request,
'enddate':enddate,
})
breadcrumbs = [
{
'url': reverse(plannedsessions_view),
'name': 'Planned Sessions'
},
{
'url': reverse(plannedsession_create_view),
'name': 'Add Session'
}
]
return render(request,'plannedsessioncreate.html',
{
'teams':get_my_teams(request.user),
'plan':trainingplan,
'dateform':dateform,
'breadcrumbs':breadcrumbs,
'form':sessioncreateform,
'active':'nav-plan',
'plannedsessions':sps,
@@ -676,7 +697,16 @@ def plannedsession_createtemplate_view(request,
sessioncreateform.save_m2m()
add_rower_session(r,ps)
url = reverse("template_library_view")
url = reverse('template_library_view')
if '_continue' in request.POST:
url = reverse('plannedsession_templateedit_view',kwargs={
'id':ps.id,
})
elif '_addanother' in request.POST:
url = reverse('plannedsession_createtemplate_view')
return HttpResponseRedirect(url)
else:
sessioncreateform = PlannedSessionTemplateForm()
@@ -714,6 +744,10 @@ def plannedsession_createtemplate_view(request,
'url': reverse(plannedsessions_view),
'name': 'Sessions'
},
{
'url':reverse('template_library_view'),
'name': 'Session Library'
},
{
'url':reverse(plannedsession_createtemplate_view),
'name': 'Create Library Session'
@@ -725,6 +759,7 @@ def plannedsession_createtemplate_view(request,
'teams':get_my_teams(request.user),
'plan':trainingplan,
'form':sessioncreateform,
'breadcrumbs':breadcrumbs,
'active':'nav-plan',
'rower':r,
'alltags':alltags,
@@ -929,8 +964,17 @@ def plannedsession_teamcreate_view(request,
url = reverse(plannedsessions_view,kwargs={
'userid':userid,
})
if '_continue' in request.POST:
url = reverse('plannedsession_edit_view',kwargs={
'id':ps.id,
})
elif '_addanother' in request.POST:
url = reverse('plannedsession_create_view',kwargs={'userid':userid})
return HttpResponseRedirect(url)
#url = reverse(plannedsession_teamcreate_view)
#startdatestring = startdate.strftime('%Y-%m-%d')
#enddatestring = enddate.strftime('%Y-%m-%d')
@@ -1117,17 +1161,20 @@ def plannedsession_teamedit_view(request,
add_rower_session(r,ps)
url = reverse(plannedsession_teamedit_view,
url = reverse('plannedsessions_view')
if "_continue" in request.POST:
url = reverse(plannedsession_edit_view,
kwargs={
'id':id,
'id':int(ps.id),
'userid':r.user.id,
})
startdatestring = startdate.strftime('%Y-%m-%d')
enddatestring = enddate.strftime('%Y-%m-%d')
url += '?when='+startdatestring+'/'+enddatestring
next = request.GET.get('next', url)
return HttpResponseRedirect(next)
return HttpResponseRedirect(url)
else:
sessioncreateform = PlannedSessionForm(instance=ps)
sessionteamselectform = PlannedSessionTeamForm(
@@ -1820,29 +1867,32 @@ def plannedsession_templateedit_view(request,id=0):
else:
messages.error(request,message)
url = reverse(plannedsession_templateedit_view,
kwargs = {
'id':int(ps.id),
url = reverse('template_library_view')
if '_continue' in request.POST:
url = reverse('plannedsession_templateedit_view',kwargs={
'id':ps.id,
})
startdatestring = startdate.strftime('%Y-%m-%d')
enddatestring = enddate.strftime('%Y-%m-%d')
url += '?when='+startdatestring+'/'+enddatestring
next = request.GET.get('next', url)
return HttpResponseRedirect(next)
return HttpResponseRedirect(url)
breadcrumbs = [
{
'url': reverse(plannedsessions_view),
'name': 'Sessions'
},
{
'url': reverse('template_library_view'),
'name': 'Library',
},
{
'url':reverse(plannedsession_templateedit_view,
kwargs={
'id':id,
}
),
'name': 'Edit'
'name': 'Edit Session'
}
]
@@ -1946,6 +1996,9 @@ def plannedsession_edit_view(request,id=0,userid=0):
else:
messages.error(request,message)
url = reverse('plannedsessions_view')
if "_continue" in request.POST:
url = reverse(plannedsession_edit_view,
kwargs={
'id':int(ps.id),