From d5a912cfddc9bcd0157f35f9181cdaaf8aa214f1 Mon Sep 17 00:00:00 2001
From: Nico Vermaas <vermaas@astron.nl>
Date: Fri, 5 Mar 2021 12:52:43 +0100
Subject: [PATCH] add task details page

---
 atdb/taskdatabase/templates/tables2/base.html  | 10 ++++++++--
 atdb/taskdatabase/templates/tables2/index.html |  2 +-
 atdb/taskdatabase/views.py                     |  3 ++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/atdb/taskdatabase/templates/tables2/base.html b/atdb/taskdatabase/templates/tables2/base.html
index 0b17f1fc..6edc87dc 100644
--- a/atdb/taskdatabase/templates/tables2/base.html
+++ b/atdb/taskdatabase/templates/tables2/base.html
@@ -36,14 +36,20 @@
             <!-- Header -->
                 <li><a class="navbar-brand" href="{% url 'homepage' %}">
                      <img src="{% static 'taskdatabase/ldvlogo_small.png' %}"  height="30" alt="">
-                    ATDB-LDV</a>
+                    ATDB-LDV Dashboard</a>
                 </li>
                 <li><a class="nav-link" href="{% url 'homepage' %}">Tasks</a></li>
+                <li><a class="nav-link" href="{% url 'task-details' 0 0 %}">Details</a></li>
                 <li><a class="nav-link" href="{% url 'tables2' %}">Query</a></li>
                 <li><a class="nav-link" href="{% url 'diagram' %}">State Diagram</a></li>
-                <li><a class="nav-link" href="{% url 'admin:index' %}">Admin</a></li>
+                {% if user.is_staff %}
+                    <li><a class="nav-link" href="{% url 'admin:index' %}" target="_blank">Admin Page</a></li>
+                {% endif %}
+
             </ul>
+            User: {{ user.get_username }}
         </div>
+
         {% include 'taskdatabase/filter/search.html' %}
 
     </nav>
diff --git a/atdb/taskdatabase/templates/tables2/index.html b/atdb/taskdatabase/templates/tables2/index.html
index 7d27fdc5..cc2e8339 100644
--- a/atdb/taskdatabase/templates/tables2/index.html
+++ b/atdb/taskdatabase/templates/tables2/index.html
@@ -1,4 +1,4 @@
-{% extends 'tables2/base.html' %}
+{% extends 'taskdatabase/base.html' %}
 {% load render_table from django_tables2 %}
 {% load bootstrap3 %}
 
diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py
index 6cd5f764..732d6030 100644
--- a/atdb/taskdatabase/views.py
+++ b/atdb/taskdatabase/views.py
@@ -176,8 +176,8 @@ class DashboardView(ListView):
     # but if 'context_object_name' is defined, then this returned list is named and can be accessed that way in html.
     context_object_name = 'my_tasks'
 
-class ChartsView(ListView):
 
+class ChartsView(ListView):
     template_name = 'dashboard/charts.html'
     model = Task
     queryset = Task.objects.all()
@@ -185,6 +185,7 @@ class ChartsView(ListView):
     # but if 'context_object_name' is defined, then this returned list is named and can be accessed that way in html.
     context_object_name = 'my_tasks'
 
+
 class TaskTables2View(SingleTableView):
     model = Task
     table_class = TaskTable
-- 
GitLab