Private
Public Access
1
0
Files
rowsandall/rowers/templates/list_workouts.html
Sander Roosendaal 8faff699dd fix font
2021-12-27 14:44:31 +01:00

227 lines
6.2 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>
<script>
$(function() {
$("td.rankingtoggle").click( function() {
var workout_id = $(this).attr('workoutid');
console.log(workout_id);
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/workout/'+workout_id+'/toggle-ranking/', function(json) {
console.log(JSON.stringify(json));
rankingpiece = json.result;
tdid = "#star"+workout_id;
console.log(rankingpiece);
console.log($(tdid).length);
if (rankingpiece) {
$(tdid).addClass('yellow');
$(tdid).removeClass('notyellow');
$(tdid).html('&star;');
console.log('adding yellow '+tdid);
} else {
$(tdid).removeClass('yellow');
$(tdid).addClass('notyellow');
$(tdid).html('&star;');
console.log('remove yellow '+tdid);
};
});
});
});
</script>
{% endblock %}
{% block main %}
<style>
#mypointer {
cursor: pointer;
}
div.columns { width: 100%; }
div.columns div { width: 20%; padding: 10px; float: left; }
</style>
{% if team %}
<h1>{{ team.name }} Team Workouts</h1>
{% else %}
<h1>
Workouts of {{ rower.user.first_name }} {{ rower.user.last_name }}
</h1>
{% endif %}
<ul class="main-content">
<li class="grid_2" style="min-height:200px;">
<p>
Total meters: {{ totalmeters }}. Total time {{ totalhours }}:{{ totalminutes }}h.
<a href="/rowers/history/">Dig deeper</a>.
</p>
<p>
Activity chart by
<a href="{{ request.get_path }}?yaxis=trimp">TRIMP</a>,
<a href="{{ request.get_path }}?yaxis=rscore">rScore</a>,
<a href="{{ request.get_path }}?yaxis=duration">Time</a>.
</p>
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.css" type="text/css" />
<link rel="stylesheet" href="https://cdn.pydata.org/bokeh/release/bokeh-widgets-2.2.3.min.css" type="text/css" />
<script src="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.js"></script>
<script async="true" type="text/text/javascript">
Bokeh.set_log_level("info")
</script>
{{ interactiveplot |safe }}
{{ the_div |safe }}
</li>
<li class="grid_2">
<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>
<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>
<p>
<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 %}
</span>
</p>
</li>
{% if workouts %}
{% for workout in workouts %}
<li class="grid_4 divlines">
{{ workout.date|date:"Y-m-d" }} {{ workout.starttime|date:"H:i" }}
<div>
{% if workout.name != '' %}
<h3>
{{ workout.name }}
</h3>
{% else %}
<h3>
No Name
</h3>
{% endif %}
</div>
<div class="columns">
<div>
{{ workout.workouttype|icon|safe }}
</div>
<div>
<span style="color:#555">Distance</span><br>
{{ workout.distance|distanceprint }}
</div>
<div>
<span style="color:#555">Time</span><br>
{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
</div>
<div>
{% if workout|may_edit:request %}
<a class="small"
href={% url rower.defaultlandingpage id=workout.id|encode %}
title="Edit">
<i class="fas fa-search fa-fw"></i></a>
{% else %}
&nbsp;
{% endif %}
</div>
</div>
</li>
{% endfor %}
{% else %}
<li> No workouts found </li>
{% endif %}
{% 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 %}