Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

If there are no nutritional plans, don't show the warning in a bullet list

Roland Geidera50f31dcca7c
diff --git a/nutrition/templates/nutrition_overview.html b/nutrition/templates/nutrition_overview.html
index 8768f125c..593abdc9b 100644
--- a/nutrition/templates/nutrition_overview.html
+++ b/nutrition/templates/nutrition_overview.html
@@ -9,29 +9,31 @@
<h2>{% trans "Your nutrition plans" %}</h2>
-<ul>
-{% for plan in plans %}
- <li>
- <a href="{% url nutrition.views.view plan.id %}">
- {% if plan.description %}
- {{ plan.description }}
- {% else %}
- {% trans "Nutrition plan" %}
- {% endif %}
- </a>
- – {{ plan.creation_date }}
- </li>
-{% empty %}
- <li>
- <div class="box warning">
- {% trans "No nutrition plans." %} {% trans "Use link to add one." %}
- </div>
- </li>
-{% endfor %}
-</ul>
+{% if plans %}
+ <ul>
+ {% for plan in plans %}
+ <li>
+ <a href="{% url nutrition.views.view plan.id %}">
+ {% if plan.description %}
+ {{ plan.description }}
+ {% else %}
+ {% trans "Nutrition plan" %}
+ {% endif %}
+ </a>
+ – {{ plan.creation_date }}
+ </li>
+ {% endfor %}
+ </ul>
+{% else %}
+ <div class="box warning">
+ {% trans "No nutrition plans." %} {% trans "Use link to add one." %}
+ </div>
+{% endif %}
+
{% endblock %}
+
{% block sidebar%}
<h3>{% trans "Options" %}</h3>
<p>
@@ -43,4 +45,4 @@
title="{% trans 'Add nutrition plan' %}">
{% trans "Add nutrition plan" %}</a>
</p>
-{% endblock %}
\ No newline at end of file
+{% endblock %}