Make admin links link to current task or tool

This commit is contained in:
Adam Goldsmith 2021-05-20 18:42:36 -04:00
parent 192848fb43
commit 71074e6f1b
3 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,8 @@
{% block title %} {{ tool.name }} - {{ task.name }} | {{ block.super }} {% endblock %}
{% block admin_link %}{% url 'admin:tasks_task_change' task.id %}{% endblock %}
{% block content %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">

View File

@ -2,6 +2,8 @@
{% block title %} {{ tool }} | {{ block.super }} {% endblock %}
{% block admin_link %}{% url 'admin:tasks_tool_change' tool.id %}{% endblock %}
{% block content %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">

View File

@ -20,7 +20,7 @@
<div id="user-nav" class="collapse navbar-collapse justify-content-end">
<div class="navbar-nav">
{% if user.is_staff %}
<a class="nav-item nav-link" href="/admin"> Admin </a>
<a class="nav-item nav-link" href="{% block admin_link %}/admin{% endblock %}"> Admin </a>
{% endif %}
{% if user.is_authenticated %}
<a class="nav-item nav-link" href="/auth/logout"> Logout: {{ user }} </a>