mirror of https://github.com/snachodog/mybuddy.git
Add permissions check for timer detail view buttons.
This commit is contained in:
parent
a51d9e4c83
commit
cf1598fe2c
|
@ -6,17 +6,29 @@
|
||||||
<div class="jumbotron text-center">
|
<div class="jumbotron text-center">
|
||||||
<h1 class="display-1">{{ object.duration }}</h1>
|
<h1 class="display-1">{{ object.duration }}</h1>
|
||||||
<p class="lead text-muted">Started {{ object.start }} by {{ object.user }}</p>
|
<p class="lead text-muted">Started {{ object.start }} by {{ object.user }}</p>
|
||||||
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
|
||||||
href="{% url 'feeding-add' %}?timer={{ timer.id }}"
|
{% if perms.core.add_feeding %}
|
||||||
role="button"><i class="fa fa-spoon" aria-hidden="true"></i> Feeding</a>
|
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
||||||
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
href="{% url 'feeding-add' %}?timer={{ timer.id }}"
|
||||||
href="{% url 'sleep-add' %}?timer={{ timer.id }}"
|
role="button"><i class="fa fa-spoon" aria-hidden="true"></i> Feeding</a>
|
||||||
role="button"><i class="fa fa-bed" aria-hidden="true"></i> Sleep</a>
|
{% endif %}
|
||||||
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
|
||||||
href="{% url 'tummytime-add' %}?timer={{ timer.id }}"
|
{% if perms.core.add_sleep %}
|
||||||
role="button"><i class="fa fa-smile-o" aria-hidden="true"></i> Tummy Time</a>
|
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
||||||
<a class="btn btn-danger btn-lg btn-block p-3 mb-3"
|
href="{% url 'sleep-add' %}?timer={{ timer.id }}"
|
||||||
href="{% url 'timer-delete' timer.id %}"
|
role="button"><i class="fa fa-bed" aria-hidden="true"></i> Sleep</a>
|
||||||
role="button"><i class="fa fa-times-circle" aria-hidden="true"></i> Delete Timer</a>
|
{% endif %}
|
||||||
|
|
||||||
|
{% if perms.core.add_tummytime %}
|
||||||
|
<a class="btn btn-success btn-lg btn-block p-3 mb-3"
|
||||||
|
href="{% url 'tummytime-add' %}?timer={{ timer.id }}"
|
||||||
|
role="button"><i class="fa fa-smile-o" aria-hidden="true"></i> Tummy Time</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if perms.core.delete_timer %}
|
||||||
|
<a class="btn btn-danger btn-lg btn-block p-3 mb-3"
|
||||||
|
href="{% url 'timer-delete' timer.id %}"
|
||||||
|
role="button"><i class="fa fa-times-circle" aria-hidden="true"></i> Delete Timer</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue