Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Make the toggle button for exercise comments work on workout page

Roland Geider292fdb1f03a8
diff --git a/wger/manager/templates/mobile/tags/render_day.html b/wger/manager/templates/mobile/tags/render_day.html
index b2dbef660..669c693bf 100644
--- a/wger/manager/templates/mobile/tags/render_day.html
+++ b/wger/manager/templates/mobile/tags/render_day.html
@@ -146,7 +146,7 @@
</span>
</strong></p>
- <p>
+ <p class="exercise-comments">
{% for comment in exercise.exercisecomment_set.all %}
{{comment}}<br>
{% endfor %}
diff --git a/wger/manager/templates/mobile/template.html b/wger/manager/templates/mobile/template.html
index 1b989deff..5e1d38e4c 100644
--- a/wger/manager/templates/mobile/template.html
+++ b/wger/manager/templates/mobile/template.html
@@ -69,6 +69,8 @@
<div data-role="panel" id="main-panel-navigation" data-display="overlay">
{% include 'navigation.html' %}
</div>
+
+ <div class="invisible" id="ajax-info"></div>
diff --git a/wger/manager/templates/mobile/workout/view.html b/wger/manager/templates/mobile/workout/view.html
index 819ca89a7..93e49f570 100644
--- a/wger/manager/templates/mobile/workout/view.html
+++ b/wger/manager/templates/mobile/workout/view.html
@@ -5,12 +5,28 @@
{% block title %}{% trans "Workout" %} – {{ workout.creation_date }}{% endblock %}
+
{% block header %}
+<script>
+$(document).on('pageinit', function () {
+ // Allow the sets to be sortable
+ //setup_sortable();
+
+ // Show/Hide the comments to the exercises
+ {% if user.userprofile.show_comments %}
+ showComment = 1;
+ $(".exercise-comments").show();
+ {% else %}
+ showComment = 0;
+ $(".exercise-comments").hide();
+ {% endif %}
+
+ toggle_comments();
+ });
+</script>
{% endblock %}
-
{% block content %}
-
{% if workout.comment %}
<p>
<span class="dimmed">{{workout.comment}}</span>