Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Use listview for add link when no workouts/nutrition plans are found

Roland Geider63c850e68b3d
diff --git a/wger/manager/templates/mobile/workout/overview.html b/wger/manager/templates/mobile/workout/overview.html
index e3f0b415b..a9bfa8b0e 100644
--- a/wger/manager/templates/mobile/workout/overview.html
+++ b/wger/manager/templates/mobile/workout/overview.html
@@ -6,9 +6,6 @@
{% block content %}
-
-
-{% if workouts %}
<ul data-role="listview" data-inset="false">
{% for workout in workouts %}
<li>
@@ -17,14 +14,14 @@
<p>{{ workout.creation_date }}</p>
</a>
</li>
+ {% empty %}
+ <li>
+ <a href="{% url 'wger.manager.views.workout.add' %}">
+ {% trans "No workouts found." %}<br>{% trans "Add one now." %}
+ </a>
+ </li>
{% endfor %}
</ul>
-{% else %}
- <a href="{% url 'wger.manager.views.workout.add' %}" data-role="button">
- {% trans "No workouts found." %}<br>{% trans "Add one now." %}
- </a>
-{% endif %}
-
{% endblock %}
diff --git a/wger/nutrition/templates/mobile/plan/overview.html b/wger/nutrition/templates/mobile/plan/overview.html
index fc90dfaff..a195190cc 100644
--- a/wger/nutrition/templates/mobile/plan/overview.html
+++ b/wger/nutrition/templates/mobile/plan/overview.html
@@ -17,7 +17,7 @@
</li>
{% empty %}
<li>
- <a href="{% url 'wger.nutrition.views.plan.add' %}" data-role="button">
+ <a href="{% url 'wger.nutrition.views.plan.add' %}">
{% trans "No nutrition plans." %}<br> {% trans "Add one now." %}
</a>
</li>
diff --git a/wger/nutrition/templates/mobile/plan/view.html b/wger/nutrition/templates/mobile/plan/view.html
index 6ea3c598e..c19b9c65c 100644
--- a/wger/nutrition/templates/mobile/plan/view.html
+++ b/wger/nutrition/templates/mobile/plan/view.html
@@ -157,7 +157,7 @@ $(document).ready(function() {
data-role="button">
{% trans "No meals for this plan." %}
{% trans "Add one now." %}
-</a>
+</a>
{% endfor %}
<p style="margin-top:2em;">