add admin links to expense and revenue list and detail templates. Do we have a nicer way of linking to stuff in the admin?

This commit is contained in:
Thomas Steen Rasmussen 2019-03-30 07:21:11 +01:00
parent 3e79567713
commit ad256b0df4
4 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,9 @@
{% endif %}
<br>
{% if request.user.is_staff %}
<a href="{% url 'admin:index' %}economy/expense/{{ expense.uuid }}/change/" class="btn btn-primary"><i class="fas fa-edit"></i> Open in Admin</a>
{% endif %}
<a href="{% url 'backoffice:expense_list' camp_slug=camp.slug %}" class="btn btn-primary"><i class="fas fa-undo"></i> Back to Expense List</a>
{% endblock content %}

View file

@ -16,6 +16,9 @@
</form>
{% endif %}
<br>
{% if request.user.is_staff %}
<a href="{% url 'admin:index' %}economy/revenue/{{ revenue.uuid }}/change/" class="btn btn-primary"><i class="fas fa-edit"></i> Open in Admin</a>
{% endif %}
<a href="{% url 'backoffice:revenue_list' camp_slug=camp.slug %}" class="btn btn-primary"><i class="fas fa-undo"></i> Back to Revenue List</a>
{% endblock content %}

View file

@ -49,6 +49,9 @@
<td>
{% if request.resolver_match.app_name == "backoffice" %}
<a class="btn btn-primary" href="{% url 'backoffice:expense_detail' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-search"></i> Details</a>
{% if request.user.is_staff %}
<a class="btn btn-primary" href="{% url 'admin:index' %}economy/expense/{{ expense.uuid }}/change/"><i class="fas fa-edit"></i> Admin</a>
{% endif %}
{% else %}
<a class="btn btn-primary" href="{% url 'economy:expense_detail' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-search"></i> Details</a>
<a class="btn btn-primary" href="{% url 'economy:expense_update' camp_slug=camp.slug pk=expense.uuid %}"><i class="fas fa-edit"></i> Update</a>

View file

@ -25,6 +25,9 @@
<td>
{% if request.resolver_match.app_name == "backoffice" %}
<a class="btn btn-primary" href="{% url 'backoffice:revenue_detail' camp_slug=camp.slug pk=revenue.uuid %}"><i class="fas fa-search"></i> Details</a>
{% if request.user.is_staff %}
<a class="btn btn-primary" href="{% url 'admin:index' %}economy/revenue/{{ revenue.uuid }}/change/"><i class="fas fa-edit"></i> Admin</a>
{% endif %}
{% else %}
<a class="btn btn-primary" href="{% url 'economy:revenue_detail' camp_slug=camp.slug pk=revenue.uuid %}"><i class="fas fa-search"></i> Details</a>
<a class="btn btn-primary" href="{% url 'economy:revenue_update' camp_slug=camp.slug pk=revenue.uuid %}"><i class="fas fa-edit"></i> Update</a>