314 lines
9.7 KiB
HTML
314 lines
9.7 KiB
HTML
{% extends "newbase.html" %}
|
|
{% load static %}
|
|
{% load rowerfilters %}
|
|
|
|
{% block title %}Rowsandall Workouts List{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
setTimeout("location.reload(true);",180000);
|
|
</script>
|
|
<script
|
|
type='text/javascript'
|
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
|
</script>
|
|
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
<style>
|
|
#mypointer {
|
|
cursor: pointer;
|
|
}
|
|
div.columns { width: 100%; }
|
|
div.columns div { width: 20%; padding: 10px; float: left; }
|
|
div.icondiv svg { height: 35px; }
|
|
</style>
|
|
|
|
|
|
{% if team %}
|
|
<h1>{{ team.name }} Team Workouts</h1>
|
|
{% else %}
|
|
<h1>
|
|
Workouts of {{ rower.user.first_name }} {{ rower.user.last_name }}
|
|
</h1>
|
|
{% endif %}
|
|
|
|
{% if nr_commutes %}
|
|
<p>
|
|
<a href="?show_commutes=true">Show {{ nr_commutes }} commutes</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
<ul class="main-content">
|
|
<li class="grid_4">
|
|
<span>
|
|
{% if workouts.has_previous %}
|
|
{% if request.GET.q %}
|
|
<a href="?page=1&q={{ request.GET.q }}">
|
|
<i class="fas fa-arrow-alt-to-left"></i>
|
|
</a>
|
|
<a
|
|
href="?page={{ workouts.previous_page_number }}&q={{ request.GET.q }}&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-left"></i>
|
|
</a>
|
|
{% else %}
|
|
<a href="?page=1&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-to-left"></i>
|
|
</a>
|
|
<a href="?page={{ workouts.previous_page_number }}&when={{ timeperiod }}">
|
|
<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 href="{{ request.path }}?page={{ workouts.next_page_number }}&q={{ request.GET.q }}&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-right"></i>
|
|
</a>
|
|
<a
|
|
href="?page={{ workouts.paginator.num_pages }}&q={{ request.GET.q }}&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-to-right"></i>
|
|
</a>
|
|
{% else %}
|
|
<a href="{{ request.path }}?page={{ workouts.next_page_number }}&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-right"></i>
|
|
</a>
|
|
<a href="?page={{ workouts.paginator.num_pages }}&when={{ timeperiod }}">
|
|
<i class="fas fa-arrow-alt-to-right"></i>
|
|
</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if not request.GET.selectworkouts %}
|
|
<span>
|
|
<a href="./?selectworkouts=true">Bulk Actions</a>
|
|
</span>
|
|
{% else %}
|
|
<span>
|
|
<a href="./">Close Bulk Actions</a>
|
|
</span>
|
|
{% endif %}
|
|
</span>
|
|
</li>
|
|
|
|
{% if workouts %}
|
|
{% if request.GET.selectworkouts %}
|
|
<li class="grid_4">
|
|
<form enctype="multipart/form-data" method="post">
|
|
<h3>Bulk Operation</h3>
|
|
<p>Please select workouts from the list to do a bulk operation on.</p>
|
|
{{ actionform.as_p }}
|
|
{% csrf_token %}
|
|
<input name='selectworkouts' type="submit" value="Submit">
|
|
</li>
|
|
{% endif %}
|
|
|
|
{% for workout in workouts %}
|
|
{% if not workout.is_commute or not user.rower.small_commutes %}
|
|
<li class="grid_4 divlines">
|
|
{% if request.GET.selectworkouts %}
|
|
<input type="checkbox" id="workoutid" value={{ workout.id|encode }} name="workoutid" />
|
|
{% endif %}
|
|
{{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
|
|
{% if workout.privacy == 'hidden' %}
|
|
<span style="font-size: smaller"><i class="fa-solid fa-eye-slash"></i></span>
|
|
{% endif %}
|
|
{% if workout.duplicate %}
|
|
<span style="font-size: smaller"><i class="fal fa-angle-double-up"></i></span>
|
|
{% endif %}
|
|
{% if workout.rankingpiece %}
|
|
<span style="font-size: smaller"><i class="fal fa-asterisk"></i></span>
|
|
{% endif %}
|
|
{% if workout.rpe == 0 and not workout.duplicate %}
|
|
<span style="font-size: smaller">
|
|
<a href="/rowers/workout/{{ workout.id|encode }}/edit/">No RPE</a>
|
|
</span>
|
|
{% endif %}
|
|
<div>
|
|
{% if workout.name != '' %}
|
|
<h3>
|
|
{% if team %}
|
|
<a
|
|
href={% url rower.defaultlandingpage3 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage3|verbose }}">
|
|
{{ workout.name }} ({{ workout.user.user.first_name }} {{ workout.user.user.last_name}})
|
|
</a>
|
|
{% else %}
|
|
<a
|
|
href={% url rower.defaultlandingpage3 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage3|verbose }}">
|
|
{{ workout.name }}
|
|
</a>
|
|
{% endif %}
|
|
</h3>
|
|
{% else %}
|
|
<h3>
|
|
{% if team %}
|
|
<a
|
|
href={% url rower.defaultlandingpage id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage|verbose }}">
|
|
No Name ({{ workout.user.user.first_name }} {{ workout.user.user.last_name}})
|
|
</a>
|
|
{% else %}
|
|
<a
|
|
href={% url rower.defaultlandingpage id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage|verbose }}">
|
|
No Name
|
|
</a>
|
|
{% endif %}
|
|
</h3>
|
|
{% endif %}
|
|
</div>
|
|
<div class="workoutcontainer">
|
|
<div class="icondiv">
|
|
{% with workout.workouttype|icon|safe as templateName %}
|
|
{% include templateName %}
|
|
{% endwith %}
|
|
</div>
|
|
<div class="workoutelement">
|
|
<span style="color:#555">Distance</span><br>
|
|
{{ workout.distance|distanceprint }}
|
|
</div>
|
|
<div class="workoutelement">
|
|
<span style="color:#555">Time</span><br>
|
|
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
|
|
</div>
|
|
<div class="workoutelement">
|
|
{% if workout|may_edit:request %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage|landingicon }}"></i></a>
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
</div>
|
|
<div class="workoutelement">
|
|
{% if workout|may_edit:request %}
|
|
{% if rower.defaultlandingpage2 != 'workout_delete' %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage2 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage2|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
|
{% else %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage2 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage2|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
|
{% endif %}
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{% elif show_commutes and user.rower.small_commutes %}
|
|
<li class="grid_4 divlines">
|
|
<div class="workoutcontainer">
|
|
<div class="workoutelement">
|
|
<span style="font-size: smaller"><i class="fa-solid fa-train"></i></span>
|
|
</div>
|
|
|
|
<div class="workoutelement">
|
|
<span style="color:#555">Distance</span>
|
|
{{ workout.distance|distanceprint }}
|
|
</div>
|
|
<div class="workoutelement">
|
|
<span style="color:#555">Time</span>
|
|
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
|
|
</div>
|
|
<div class="workoutelement">
|
|
{% if workout|may_edit:request %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage|landingicon }}"></i></a>
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
</div>
|
|
<div class="workoutelement">
|
|
{% if workout|may_edit:request %}
|
|
{% if rower.defaultlandingpage2 != 'workout_delete' %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage2 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage2|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
|
{% else %}
|
|
<a class="small"
|
|
href={% url rower.defaultlandingpage2 id=workout.id|encode %}
|
|
title="{{ rower.defaultlandingpage2|verbose }}">
|
|
<i class="{{ rower.defaultlandingpage2|landingicon }}"></i></a>
|
|
{% endif %}
|
|
{% else %}
|
|
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
<li> No workouts found </li>
|
|
{% endif %}
|
|
{% if request.GET.selectworkouts %}
|
|
</form>
|
|
{% endif %}
|
|
<li class="grid_4">
|
|
<p>Filter on date
|
|
<form enctype="multipart/form-data" method="post">
|
|
<table>
|
|
{{ dateform.as_table }}
|
|
</table>
|
|
{% csrf_token %}
|
|
</p>
|
|
<p>and keyword</p>
|
|
<p>
|
|
{{ searchform }}
|
|
</p>
|
|
<p>
|
|
<input name='daterange' type="submit" value="Select workouts">
|
|
</form>
|
|
</p>
|
|
</li>
|
|
<li class="grid_4" style="min-height:400px;">
|
|
<p>
|
|
Total meters: {{ totalmeters }}. Total time {{ totalhours }}:{{ totalminutes }}h.
|
|
<a href="/rowers/history/">Dig deeper</a>.
|
|
</p>
|
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
|
|
{{ the_div |safe }}
|
|
{{ interactiveplot |safe }}
|
|
|
|
</li>
|
|
{% if announcements %}
|
|
<li class="grid_4">
|
|
<h3>What's New?</h3>
|
|
</li>
|
|
{% for a in announcements %}
|
|
<li>
|
|
<div class="site-announcement-box">
|
|
<div class="site-announcement">
|
|
<em>{{ a.created }}:</em>
|
|
{{ a.announcement|urlshorten:20 }}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</ul>
|
|
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
{% include 'menu_workouts.html' %}
|
|
{% endblock %}
|