Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Don't show the edit/delete links to users without those permissions

Roland Geider9d11c264e332
diff --git a/exercises/templates/view.html b/exercises/templates/view.html
index 29cb8781c..90ec8896b 100644
--- a/exercises/templates/view.html
+++ b/exercises/templates/view.html
@@ -40,10 +40,12 @@
{% endif %}
</td>
<td class="align-right">
+ {% if perms.exercises %}
<div class="editoptions">
<a href="{% url exercises.views.exercisecomment_delete comment.id %}" title="{% trans "Delete" %}">[x]</a>
<a href="{% url exercises.views.exercise_view exercise.id comment.id %}" title="{% trans "Edit" %}">[e]</a>
</div>
+ {% endif %}
</td>
</tr>
{% empty %}
@@ -73,10 +75,12 @@
Side bar?
-->
{% block sidebar %}
+{% if perms.exercises %}
<h3>{% trans "Options" %}</h3>
<p>
<a href="{% url exercises.views.exercise_edit exercise.id %}">{% trans "Edit" %}</a> |
<a href="{% url exercises.views.exercise_delete exercise.id %}">{% trans "Delete" %}</a>
</p>
-{% endblock %}
\ No newline at end of file
+{% endif %}
+{% endblock %}