diff options
Diffstat (limited to 'app/dispatch/templates')
| -rw-r--r-- | app/dispatch/templates/dispatch/companies/list.html | 2 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/drivers/list.html | 2 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/nav.html | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/app/dispatch/templates/dispatch/companies/list.html b/app/dispatch/templates/dispatch/companies/list.html index 2654587..e0a128f 100644 --- a/app/dispatch/templates/dispatch/companies/list.html +++ b/app/dispatch/templates/dispatch/companies/list.html @@ -28,7 +28,9 @@ <td>{{ company.phone_number }}</td> <td>{{ company.email_address }}</td> <td class="right-align"> + {% if user.is_superuser %} <a href="{% url 'company_edit' company.id %}" class="btn orange">Edit</a> + {% endif %} <a href="{% url 'company_detail' company.id %}" class="btn blue">View</a> </td> </tr> diff --git a/app/dispatch/templates/dispatch/drivers/list.html b/app/dispatch/templates/dispatch/drivers/list.html index ccfb50d..4153fe9 100644 --- a/app/dispatch/templates/dispatch/drivers/list.html +++ b/app/dispatch/templates/dispatch/drivers/list.html @@ -23,7 +23,9 @@ <td>{{ driver.last_name }}</td> <td>{{ driver.email }}</td> <td class="right-align"> + {% if user.is_superuser %} <a href="{% url 'driver_edit' driver.id %}" class="btn orange">Edit</a> + {% endif %} <a href="{% url 'driver_detail' driver.id %}" class="btn blue">View</a> </td> </tr> diff --git a/app/dispatch/templates/dispatch/nav.html b/app/dispatch/templates/dispatch/nav.html index 5ba40d9..d40224c 100644 --- a/app/dispatch/templates/dispatch/nav.html +++ b/app/dispatch/templates/dispatch/nav.html @@ -1,8 +1,10 @@ -{% if user.is_authenticated %} +{% if request.user.is_authenticated %} <li><a href="{% url 'load_list' %}">Loads</a></li> - {% if user.is_superuser %} + {% if request.user.is_superuser %} <li><a href="{% url 'driver_list' %}">Drivers</a></li> <li><a href="{% url 'company_list' %}">Companies</a></li> + {% else %} + <li><a href="{% url 'driver_edit' request.user.id %}">My Account</a></li> {% endif %} <li><a href="{% url 'logout' %}">Logout</a></li> {% else %} |
