Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

If there are no ingredients, don't show the warning in a bullet list.

Roland Geider495005c9650d
diff --git a/nutrition/templates/ingredient_overview.html b/nutrition/templates/ingredient_overview.html
index 9a6f667f0..b70b8bad4 100644
--- a/nutrition/templates/ingredient_overview.html
+++ b/nutrition/templates/ingredient_overview.html
@@ -19,20 +19,32 @@ $(document).ready(function() {
<h2>{% trans "Ingredient overview" %}</h2>
+{% if ingredients %}
<ul>
{% for ingredient in ingredients %}
<li>
<a href="{% url nutrition.views.ingredient_view ingredient.id %}">{{ ingredient.name }}</a>
</li>
-{% empty %}
- <li>
- <div class="box warning">
- {% trans "No ingredients." %} {% trans "Use link to add one." %}
- </div>
- </li>
{% endfor %}
</ul>
+{% else %}
+ <div class="box warning">
+ {% trans "No ingredients." %} {% trans "Use link to add one." %}
+ </div>
+{% endif %}
+
+{% endblock %}
-<a href="{% url nutrition.views.ingredient_edit None %}"
- class="modal-dialog">{% trans "Add ingredient" %}</a>
+{% block sidebar %}
+<h3>{% trans "Options" %}</h3>
+<p>
+ <a href="{% url nutrition.views.ingredient_edit None %}">
+ <img src="{% static 'images/icons/new.svg' %}"
+ width="32"
+ height="32"
+ alt="{% trans 'Add ingredient' %}"
+ title="{% trans 'Add ingredient' %}">
+ {% trans "Add ingredient" %}
+ </a>
+</p>
{% endblock %}