From 2eb1c07e8c045db55ca7b974c91b12601416dcf6 Mon Sep 17 00:00:00 2001
From: Carlos Vega <carlos.vega@uni.lu>
Date: Thu, 3 Jan 2019 14:32:51 +0100
Subject: [PATCH] unified templates so the ui_active property works properly

---
 .../appointment_types/breadcrumb.html         |  2 +-
 .../templates/appointment_types/index.html    | 29 +++++++++++++++----
 smash/web/templates/configuration/index.html  |  2 +-
 smash/web/templates/doctors/index.html        |  4 +--
 .../equipment_and_rooms/equipment/index.html  |  2 +-
 .../flying_teams/index.html                   |  2 +-
 .../kit_requests/kit_requests.html            |  2 +-
 .../equipment_and_rooms/rooms/index.html      |  2 +-
 smash/web/templates/sidebar.html              | 29 +++++++++----------
 9 files changed, 46 insertions(+), 28 deletions(-)

diff --git a/smash/web/templates/appointment_types/breadcrumb.html b/smash/web/templates/appointment_types/breadcrumb.html
index 969dd7be..2ab1c8ec 100644
--- a/smash/web/templates/appointment_types/breadcrumb.html
+++ b/smash/web/templates/appointment_types/breadcrumb.html
@@ -1,5 +1,5 @@
 <li><a href="{% url 'web.views.appointments' %}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
-<li>Configuration</li>
+<li><a href="{% url 'web.views.equipment_and_rooms' %}">Equipment and rooms</a></li>
 <li class="active">
 	<a href="{% url 'web.views.appointment_types' %}">Appointment Types</a>
 </li>
\ No newline at end of file
diff --git a/smash/web/templates/appointment_types/index.html b/smash/web/templates/appointment_types/index.html
index 5a233a71..0d44cac8 100644
--- a/smash/web/templates/appointment_types/index.html
+++ b/smash/web/templates/appointment_types/index.html
@@ -18,11 +18,21 @@
         text-align: center;
         background-color: #dd4b39;
     }
+    .description{
+        margin: 0;
+        padding: 0;
+        line-height: 1.5;
+        font-variant: small-caps;
+        font-weight: 400;
+        font-size: 12pt;
+        text-align: justify;
+        padding-top: 5px;
+    }
     </style>
 {% endblock styles %}
 
 {% block ui_active_tab %}
-'general_conf'
+'appointment_types'
 {% endblock ui_active_tab %}
 
 {% block page_header %}
@@ -42,16 +52,24 @@
 
 {% block maincontent %}
 
-    <div>
-        <a class="btn btn-app" href="{% url 'web.views.appointment_type_add' %}">
-            <i class="fa fa-plus"></i> Add new appointment type
-        </a>
+    <div class="row">
+        <div class="col-lg-2 col-md-3 col-xs-4">
+            <a class="btn btn-app" href="{% url 'web.views.appointment_type_add' %}">
+                <i class="fa fa-plus"></i> Add new appointment type
+            </a>
+        </div>
+        <div class="col-xs-4">
+            <p class="description">
+            Appointment Types represent the different <u>assesments</u> (i.e.&nbsp;blood&nbsp;test) to be conducted during an appointment.
+            </p>
+        </div>
     </div>
 
     <div class="box-body">
         <table id="table" class="table table-bordered table-striped">
             <thead>
             <tr>
+                <th>Required Equipment</th>
                 <th>Code</th>
                 <th>Description</th>
                 <th>Default Duration</th>
@@ -63,6 +81,7 @@
             <tbody>
             {% for appointment_type in appointment_types %}
                 <tr>
+                    <td>{{ appointment_type.required_equipment.all|join:"; " }}</td>
                     <td>{{ appointment_type.code }}</td>
                     <td>{{ appointment_type.description }}</td>
                     <td>{{ appointment_type.default_duration }}</td>
diff --git a/smash/web/templates/configuration/index.html b/smash/web/templates/configuration/index.html
index d5580458..5c6e24c2 100644
--- a/smash/web/templates/configuration/index.html
+++ b/smash/web/templates/configuration/index.html
@@ -9,7 +9,7 @@
 
 {% endblock styles %}
 
-{% block ui_active_tab %}'general_conf'{% endblock ui_active_tab %}
+{% block ui_active_tab %}'settings'{% endblock ui_active_tab %}
 {% block page_header %}Configuration{% endblock page_header %}
 {% block page_description %}{% endblock page_description %}
 
diff --git a/smash/web/templates/doctors/index.html b/smash/web/templates/doctors/index.html
index e1b0fef9..2e14e509 100644
--- a/smash/web/templates/doctors/index.html
+++ b/smash/web/templates/doctors/index.html
@@ -25,9 +25,9 @@
 {% if worker_type == 'STAFF' %}
 'workers'
 {% elif worker_type == 'HEALTH_PARTNER' %}
-'health_partners'
+'health_partner'
 {% elif worker_type == 'VOUCHER_PARTNER' %}
-'voucher_partners'
+'voucher_partner'
 {% endif %}
 {% endblock ui_active_tab %}
 
diff --git a/smash/web/templates/equipment_and_rooms/equipment/index.html b/smash/web/templates/equipment_and_rooms/equipment/index.html
index d1869fa9..2a62cf45 100644
--- a/smash/web/templates/equipment_and_rooms/equipment/index.html
+++ b/smash/web/templates/equipment_and_rooms/equipment/index.html
@@ -7,7 +7,7 @@
     <link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
 {% endblock styles %}
 
-{% block ui_active_tab %}'equipment_and_rooms'{% endblock ui_active_tab %}
+{% block ui_active_tab %}'equipment_items'{% endblock ui_active_tab %}
 {% block page_header %}Equipment definitions{% endblock page_header %}
 {% block page_description %}{% endblock page_description %}
 
diff --git a/smash/web/templates/equipment_and_rooms/flying_teams/index.html b/smash/web/templates/equipment_and_rooms/flying_teams/index.html
index df8165b1..c815e3ea 100644
--- a/smash/web/templates/equipment_and_rooms/flying_teams/index.html
+++ b/smash/web/templates/equipment_and_rooms/flying_teams/index.html
@@ -7,7 +7,7 @@
     <link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
 {% endblock styles %}
 
-{% block ui_active_tab %}'equipment_and_rooms'{% endblock ui_active_tab %}
+{% block ui_active_tab %}'flying_teams'{% endblock ui_active_tab %}
 {% block page_header %}Flying teams{% endblock page_header %}
 {% block page_description %}management{% endblock page_description %}
 
diff --git a/smash/web/templates/equipment_and_rooms/kit_requests/kit_requests.html b/smash/web/templates/equipment_and_rooms/kit_requests/kit_requests.html
index 16b7dbf0..2e3beade 100644
--- a/smash/web/templates/equipment_and_rooms/kit_requests/kit_requests.html
+++ b/smash/web/templates/equipment_and_rooms/kit_requests/kit_requests.html
@@ -1,6 +1,6 @@
 {% extends "_base.html" %}
 
-{% block ui_active_tab %}'equipment_and_rooms'{% endblock ui_active_tab %}
+{% block ui_active_tab %}'kit_requests'{% endblock ui_active_tab %}
 {% block page_header %}
     Kits required between {{ start_date | date:"Y-m-d" }} and {% if end_date %}  {{ end_date | date:"Y-m-d" }}
 {% else %} end of time {% endif %}
diff --git a/smash/web/templates/equipment_and_rooms/rooms/index.html b/smash/web/templates/equipment_and_rooms/rooms/index.html
index c5d34b72..7cb6f5f4 100644
--- a/smash/web/templates/equipment_and_rooms/rooms/index.html
+++ b/smash/web/templates/equipment_and_rooms/rooms/index.html
@@ -7,7 +7,7 @@
     <link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
 {% endblock styles %}
 
-{% block ui_active_tab %}'equipment_and_rooms'{% endblock ui_active_tab %}
+{% block ui_active_tab %}'rooms'{% endblock ui_active_tab %}
 {% block page_header %}Rooms{% endblock page_header %}
 {% block page_description %}management{% endblock page_description %}
 
diff --git a/smash/web/templates/sidebar.html b/smash/web/templates/sidebar.html
index 524b8dd3..a91be3d7 100644
--- a/smash/web/templates/sidebar.html
+++ b/smash/web/templates/sidebar.html
@@ -34,16 +34,19 @@
 
     <li data-desc="equipment_and_rooms" class="treeview">
         <a href="{% url 'web.views.equipment_and_rooms' %}">
-            <i class="fa fa-building-o"></i> <span>Equipment&amp;rooms</span>
+            <i class="fa fa-building-o"></i> <span>Equipment &amp; Rooms</span>
             <span class="pull-right-container">
               <i class="fa fa-angle-left pull-right"></i>
             </span>
         </a>
         <ul class="treeview-menu">
-            <li><a href="{% url 'web.views.equipment' %}">Equipment items</a></li>
-              <li><a href="{% url 'web.views.equipment_and_rooms.flying_teams' %}">Flying teams</a></li>
-              <li><a href="{% url 'web.views.kit_requests' %}">Kit requests</a></li>
-              <li><a href="{% url 'web.views.equipment_and_rooms.rooms' %}">Rooms</a></li>
+                <li data-desc="equipment_items"><a href="{% url 'web.views.equipment' %}">Equipment items</a></li>
+            {% if "change_appointmenttype" in permissions %}
+                <li data-desc="appointment_types"><a href="{% url 'web.views.appointment_types' %}">Appointment Types</a></li>
+            {% endif %}
+                <li data-desc="flying_teams"><a href="{% url 'web.views.equipment_and_rooms.flying_teams' %}">Flying teams</a></li>
+                <li data-desc="kit_requests"><a href="{% url 'web.views.kit_requests' %}">Kit requests</a></li>
+                <li data-desc="rooms"><a href="{% url 'web.views.equipment_and_rooms.rooms' %}">Rooms</a></li>
         </ul>
     </li>
 
@@ -88,31 +91,27 @@
         </a>
         <ul class="treeview-menu">
             {% if "change_configurationitem" in permissions %}
-            <li><a href="{% url 'web.views.configuration' %}">General</a></li>
+            <li data-desc="settings"><a href="{% url 'web.views.configuration' %}">General</a></li>
             {% endif %}
 
             {% if "change_language" in permissions %}
-            <li><a href="{% url 'web.views.languages' %}">Languages</a></li>
-            {% endif %}
-
-            {% if "change_appointmenttype" in permissions %}
-            <li><a href="{% url 'web.views.appointment_types' %}">Appointment Types</a></li>
+            <li data-desc="languages"><a href="{% url 'web.views.languages' %}">Languages</a></li>
             {% endif %}
 
             {% if study.has_voucher_types and "change_vouchertype" in permissions %}
-            <li><a href="{% url 'web.views.voucher_types' %}">Voucher types</a></li>
+            <li data-desc="voucher_types"><a href="{% url 'web.views.voucher_types' %}">Voucher types</a></li>
             {% endif %}
 
             {% if study.has_vouchers and "change_worker" in permissions %}
-            <li><a href="{% url 'web.views.workers' 'VOUCHER_PARTNER' %}">Voucher partners</a></li>
+            <li data-desc="voucher_partner"><a href="{% url 'web.views.workers' 'VOUCHER_PARTNER' %}">Voucher partners</a></li>
             {% endif %}
 
             {% if "change_worker" in permissions %}
-            <li><a href="{% url 'web.views.workers' 'HEALTH_PARTNER' %}">Health partners</a></li>
+            <li data-desc="health_partner"><a href="{% url 'web.views.workers' 'HEALTH_PARTNER' %}">Health partners</a></li>
             {% endif %}
 
             {% if "change_study" in permissions %}
-            <li><a href="{% url 'web.views.edit_study' study_id %}">Study</a></li>
+            <li data-desc="study_conf"><a href="{% url 'web.views.edit_study' study_id %}">Study</a></li>
             {% endif %}
         </ul>
     </li>
-- 
GitLab