Private
Public Access
1
0

acceptable version of list_workouts

This commit is contained in:
Sander Roosendaal
2018-09-27 21:27:01 +02:00
parent 8aa72c49f4
commit 20c2339f15
7 changed files with 162 additions and 188 deletions

View File

@@ -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 }}">&lt;</a>
{% else %}
<a class="wh" href="?page={{ workouts.previous_page_number }}">&lt;</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 }}">&gt;</a>
{% else %}
<a class="wh" href="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}?page={{ workouts.next_page_number }}">&gt;</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 %}
&nbsp;
{% endif %}
</div>
</li>
</ul>
{% endblock %}