Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add check to show the add/edit ingredient links

Roland Geider23072ef059f3
diff --git a/nutrition/templates/ingredient_overview.html b/nutrition/templates/ingredient_overview.html
index e3763ea48..3f1f9a4d7 100644
--- a/nutrition/templates/ingredient_overview.html
+++ b/nutrition/templates/ingredient_overview.html
@@ -32,6 +32,7 @@
{% endblock %}
{% block sidebar %}
+{% if perms.exercises %}
<h3>{% trans "Options" %}</h3>
<p>
<a href="{% url ingredient-add %}">
@@ -43,4 +44,5 @@
{% trans "Add ingredient" %}
</a>
</p>
+{% endif %}
{% endblock %}
diff --git a/nutrition/templates/view_ingredient.html b/nutrition/templates/view_ingredient.html
index c7c07b50d..8a728b4c5 100644
--- a/nutrition/templates/view_ingredient.html
+++ b/nutrition/templates/view_ingredient.html
@@ -72,6 +72,7 @@
{% block sidebar %}
+{% if perms.exercises %}
<h3>{% trans "Options" %}</h3>
<p>
@@ -98,5 +99,6 @@
{% trans 'Edit ingredient' %}
</a>
</p>
+{% endif %}
{% endblock %}