/
activity_list.html
67 lines (59 loc) · 2.18 KB
/
activity_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load humanize duration %}
{% block title %}Home by Two - Strava Activities{% endblock %}
{% block content %}
<h1>Strava Activities</h1>
<form method="post">
{% csrf_token %}
<ul class="list-stacked list-stacked--tight mrgb">
{% for activity in strava_activities %}
<li class="mrgb-">
<div class="flex">
<div class="flex-shrink mrgr-">
<input name="use_for_training" type="checkbox" value="{{ activity.pk }}"{% if activity.use_for_training %} checked{% endif %}>
</div>
<div class="flex-grow">
<div>
<a class="strava" href="{{ activity.get_strava_url }}">
{{ activity.activity_type }}: {{ activity.name }}
</a>
</div>
<div>
{{ activity.start_date|naturalday }}
{% if activity.distance %}
- {{ activity.get_distance.km|floatformat:"01"|intcomma }}km
{% endif %}
{% if activity.total_elevation_gain %}
- {{ activity.get_total_elevation_gain.m|floatformat:"0"|intcomma }}m+
{% endif %}
{% if activity.moving_time %}
- {{ activity.moving_time|duration }}
{% endif %}
</div>
</div>
</div>
</li>
{% empty %}
<li>No activities yet.</li>
{% endfor %}
</ul>
<button class="btn btn--primary">{% trans "Include (checked) / exclude (unchecked) activities from training model" %}</button>
</form>
<div class="pagination">
<span class="step-links">
{% if page_obj.has_previous %}
<a href="?page=1">« first</a>
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">next</a>
<a href="?page={{ page_obj.paginator.num_pages }}">last »</a>
{% endif %}
</span>
</div>
{% endblock content %}