acceptable version of list_workouts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% extends "newbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
xo
|
||||
{% block title %}Rowsandall Workouts List{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
@@ -73,7 +73,7 @@
|
||||
</form>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<li class="grid_2">
|
||||
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
@@ -83,12 +83,74 @@
|
||||
|
||||
{{ the_div |safe }}
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
{% if team %}
|
||||
<h3>{{ team.name }} Team Workouts</h3>
|
||||
{% else %}
|
||||
<h3>Workouts of {{ rower.user.first_name }} {{ rower.user.last_name }}</h3>
|
||||
<li>
|
||||
{% if team %}
|
||||
<h3>{{ team.name }} Team Workouts</h3>
|
||||
{% else %}
|
||||
<h3>
|
||||
Workouts of {{ rower.user.first_name }} {{ rower.user.last_name }}
|
||||
</h3>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<span>
|
||||
{% if workouts.has_previous %}
|
||||
{% if request.GET.q %}
|
||||
<a class="wh" href="?page=1&q={{ request.GET.q }}">
|
||||
<i class="fas fa-arrow-alt-to-left"></i>
|
||||
</a>
|
||||
<a class="wh" href="?page={{ workouts.previous_page_number }}&q={{ request.GET.q }}">
|
||||
<i class="fas fa-arrow-alt-left"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="wh" href="?page=1">
|
||||
<i class="fas fa-arrow-alt-to-left"></i>
|
||||
</a>
|
||||
<a class="wh" href="?page={{ workouts.previous_page_number }}">
|
||||
<i class="fas fa-arrow-alt-left"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
Page {{ workouts.number }} of {{ workouts.paginator.num_pages }}.
|
||||
</span>
|
||||
|
||||
{% if workouts.has_next %}
|
||||
{% if request.GET.q %}
|
||||
<a class="wh" href="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}&q={{ request.GET.q }}">
|
||||
<i class="fas fa-arrow-alt-right"></i>
|
||||
</a>
|
||||
<a class="wh" href="?page={{ workouts.paginator.num_pages }}&q={{ request.GET.q }}">
|
||||
<i class="fas fa-arrow-alt-to-right">
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="wh" href="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}">
|
||||
<i class="fas fa-arrow-alt-right"></i>
|
||||
</a>
|
||||
<a class="wh" href="?page={{ workouts.paginator.num_pages }}">
|
||||
<i class="fas fa-arrow-alt-to-right"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
{% if rankingonly and not team %}
|
||||
<a href="/rowers/list-workouts">
|
||||
<i class="far fa-star"></i>Show All Workouts
|
||||
</a>
|
||||
{% elif not team %}
|
||||
<a href="/rowers/list-workouts/ranking">
|
||||
<i class="fas fa-star"></i>Show Only Ranking Pieces
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
|
||||
{% if workouts %}
|
||||
<table width="100%" class="listtable shortpadded">
|
||||
@@ -182,70 +244,19 @@
|
||||
</li>
|
||||
{% if announcements %}
|
||||
<li class="grid_4">
|
||||
<h2>What's New?</h2>
|
||||
<h3>What's New?</h3>
|
||||
</li>
|
||||
{% for a in announcements %}
|
||||
<li>
|
||||
<div class="site-announcement-box">
|
||||
<div class="site-announcement">
|
||||
<i>{{ a.created }}:</i>
|
||||
<em>{{ a.created }}:</em>
|
||||
{{ a.announcement|urlize }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<li class="grid_2">
|
||||
{% if rankingonly and not team %}
|
||||
<a href="/rowers/list-workouts">All Workouts</a>
|
||||
{% elif not team %}
|
||||
<a href="/rowers/list-workouts/ranking">Ranking Pieces Only</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
{% if user|is_promember %}
|
||||
<a href="/rowers/workouts-join-select">Glue Workouts</a>
|
||||
{% else %}
|
||||
<a href="/rowers/promembership">Glue</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
<span>
|
||||
{% if workouts.has_previous %}
|
||||
{% if request.GET.q %}
|
||||
<a class="wh" href="?page={{ workouts.previous_page_number }}&q={{ request.GET.q }}"><</a>
|
||||
{% else %}
|
||||
<a class="wh" href="?page={{ workouts.previous_page_number }}"><</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
Page {{ workouts.number }} of {{ workouts.paginator.num_pages }}.
|
||||
</span>
|
||||
|
||||
{% if workouts.has_next %}
|
||||
{% if request.GET.q %}
|
||||
<a class="wh" href="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}&q={{ request.GET.q }}">></a>
|
||||
{% else %}
|
||||
<a class="wh" href="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}">></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<button class="dropbtn">
|
||||
{{ rower.user.first_name }} {{ rower.user.last_name }}
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for member in user|team_members %}
|
||||
<a href="/rowers/u/{{ member.id }}/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
<h1>Workouts</h1>
|
||||
<ul class="cd-accordion-menu animated">
|
||||
<li id="workouts-list">
|
||||
@@ -12,6 +14,15 @@
|
||||
<li>
|
||||
<a href="#0"><i class="fas fa-file-upload fa-fw"></i> Upload</a>
|
||||
</li>
|
||||
<li>
|
||||
{% if user|is_promember %}
|
||||
<a href="/rowers/workouts-join-select">
|
||||
{% else %}
|
||||
<a href="/rowers/promembership">Glue Workouts</a>
|
||||
{% endif %}
|
||||
<i class="fas fa-layer-plus fa-fw"></i> Glue Workouts
|
||||
</a>
|
||||
</li>
|
||||
<li class="has-children" id="imports">
|
||||
<input type="checkbox" name ="group-1" id="group-1">
|
||||
<label for="group-1"><i class="fas fa-cloud-download fa-fw"></i> Import</label>
|
||||
@@ -26,3 +37,21 @@
|
||||
</ul>
|
||||
</li>
|
||||
</ul> <!-- cd-accordion-menu -->
|
||||
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
<p> </p>
|
||||
|
||||
<ul class="cd-accordion-menu animated">
|
||||
<li class="has-children" id="athletes">
|
||||
<input type="checkbox" name="athlete-selector" id="athlete-selector">
|
||||
<label for="athlete-selector"><i class="fas fa-users fa-fw"></i> Athletes</label>
|
||||
<ul>
|
||||
{% for member in user|team_members %}
|
||||
<a href="/rowers/u/{{ member.id }}/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">
|
||||
<i class="fas fa-user fa-fw"></i> {{ member.first_name }} {{ member.last_name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
@@ -6466,7 +6466,7 @@ def workouts_view(request,message='',successmessage='',
|
||||
|
||||
messages.info(request,successmessage)
|
||||
messages.error(request,message)
|
||||
|
||||
|
||||
return render(request, 'list_workouts.html',
|
||||
{'workouts': workouts,
|
||||
'active': 'nav-workouts',
|
||||
|
||||
Reference in New Issue
Block a user