diff --git a/templates/partials/page/calendar.html b/templates/partials/page/calendar.html index 991aade..70974ce 100644 --- a/templates/partials/page/calendar.html +++ b/templates/partials/page/calendar.html @@ -3,180 +3,176 @@ id="refreshViewElement">
-
-
-
-
- - -
- - {% if selected_view == 'month' %} -

{{ strftime(selected_date, '%B, %Y') }}

- {% else %} -

{{ strftime(selected_date, '%Y') }}

- {% endif %} - {{ - person['PersonName']}} -
- -
- - -
- -
- -
-
-{% if selected_view == 'month' %} -
-
- -
- - Sun -
-
- - Mon -
-
- - Tue -
-
- - Wed -
-
- - Thu -
-
- - Fri -
-
- - Sat -
-
- -
- - {% for i in range((end_date-start_date).days + 1) %} - {% set date = start_date + timedelta(days=i) %} - {% set workout = - get_first_element_from_list_with_matching_attribute(person['Workouts'], - 'StartDate', - date) %} -
-
- {{ date.day }} -
-
- {% if workout['TopSets']|length > 0 %} - {% for topset in workout['TopSets'] %} - - {% endfor %} - {% endif %} + +
+ + {% if selected_view == 'month' %} +

{{ strftime(selected_date, '%B, %Y') }}

+ {% else %} +

{{ strftime(selected_date, '%Y') }}

+ {% endif %} + {{ + person['PersonName']}} +
+ +
+ + +
+
+ + {% if selected_view == 'month' %} +
+
+ +
+ + Sun +
+
+ + Mon +
+
+ + Tue +
+
+ + Wed +
+
+ + Thu +
+
+ + Fri +
+
+ + Sat
- {% endfor %} -
-
-{% elif selected_view == 'year'%} -
+
-
- {% for i in range(12) %} - {% set date = start_date + relativedelta(months=i) %} - {% set first_day_of_month = date.replace(day=1) %} - {% set last_day_of_month = date + relativedelta(day=31) %} - {% set (first_day, last_day) = first_and_last_visible_days_in_month(first_day_of_month, last_day_of_month) - %} -
-
{{ - strftime(first_day_of_month, '%B %Y') }} -
-
-
-
S
-
M
-
T
-
W
-
T
-
F
-
S
+ {% for i in range((end_date-start_date).days + 1) %} + {% set date = start_date + timedelta(days=i) %} + {% set workout = + get_first_element_from_list_with_matching_attribute(person['Workouts'], + 'StartDate', + date) %} +
+
+ {{ date.day }}
- -
- {% for i in range((last_day-first_day).days + 1) %} - {% set day_date = first_day + timedelta(days=i) %} - {% set workout = - get_first_element_from_list_with_matching_attribute(person['Workouts'], - 'StartDate', - day_date) %} - {% set is_in_month = day_date.month == first_day_of_month.month%} -
- {% if is_in_month %} - {{ day_date.day }} {% endif %}
+
+ {% if workout['TopSets']|length > 0 %} + {% for topset in workout['TopSets'] %} + {% endfor %} + {% endif %}
+ {% endfor %} +
- - {% endfor %} -
-
-{% endif %} -
+ {% elif selected_view == 'year'%} +
+
+ {% for i in range(12) %} + {% set date = start_date + relativedelta(months=i) %} + {% set first_day_of_month = date.replace(day=1) %} + {% set last_day_of_month = date + relativedelta(day=31) %} + {% set (first_day, last_day) = first_and_last_visible_days_in_month(first_day_of_month, last_day_of_month) + %} +
+
{{ + strftime(first_day_of_month, '%B %Y') }} +
+
+
+
S
+
M
+
T
+
W
+
T
+
F
+
S
+
+ +
+ {% for i in range((last_day-first_day).days + 1) %} + {% set day_date = first_day + timedelta(days=i) %} + {% set workout = + get_first_element_from_list_with_matching_attribute(person['Workouts'], + 'StartDate', + day_date) %} + {% set is_in_month = day_date.month == first_day_of_month.month%} +
+ {% if is_in_month %} + {{ day_date.day }} {% endif %}
+ {% endfor %} +
+
+
+ + {% endfor %} + +
+
+ {% endif %} +
+
{{ render_partial('partials/stats.html', stats=person['Stats']) }}