From 24f124fe49a2810f41ce05e2e7606acdedf0b610 Mon Sep 17 00:00:00 2001
From: Jacek Lebioda <jacek.lebioda.001@student.uni.lu>
Date: Mon, 6 Feb 2017 14:38:14 +0100
Subject: [PATCH] Fixes

---
 smash/web/forms.py                       |  4 +++
 smash/web/models.py                      | 31 +++++++++++++++---------
 smash/web/templates/_base.html           |  4 +--
 smash/web/templates/doctors/details.html |  2 +-
 smash/web/templates/subjects/index.html  |  2 +-
 5 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/smash/web/forms.py b/smash/web/forms.py
index ef870ce1..7834007e 100644
--- a/smash/web/forms.py
+++ b/smash/web/forms.py
@@ -66,11 +66,15 @@ class AppointmentEditForm(ModelForm):
         model = Appointment
         fields = '__all__'
 
+    datetime_when = forms.DateTimeField(label='Appointment on (YYYY-MM-DD HH:MM:SS)')
+
 class AppointmentAddForm(ModelForm):
     class Meta:
         model = Appointment
         exclude = ['is_finished']
 
+    datetime_when = forms.DateTimeField(label='Appointment on (YYYY-MM-DD HH:MM:SS)')
+
 class VisitDetailForm(ModelForm):
     datetime_begin = forms.DateField(label="Visit begins on",
         widget=forms.SelectDateWidget(years=YEAR_CHOICES)
diff --git a/smash/web/models.py b/smash/web/models.py
index 437b629e..8ac791e7 100644
--- a/smash/web/models.py
+++ b/smash/web/models.py
@@ -26,20 +26,29 @@ class Language (models.Model):
     image_img.allow_tags = True
 
 class Subject(models.Model):
+    SEX_CHOICES_MALE = 'M'
+    SEX_CHOICES_FEMALE = 'F'
+
     SEX_CHOICES = (
-        ('M','Male'),
-        ('F','Female'),
+        (SEX_CHOICES_MALE,'Male'),
+        (SEX_CHOICES_FEMALE,'Female'),
     )
 
     STATUS_CHOICES_DEAD = 'DEA'
-
-    STATUS_CHOICES = (  # Remember to check dependencies if changed
-        ('NCO', 'Not contacted'),
-        ('TST', 'Test group'),
-        ('LEA', 'Level A'),
-        ('LEB', 'Level B'),
-        ('OPT', 'Opted out'),
-        ('REJ', 'Rejected'),
+    STATUS_CHOICES_REJECTED = 'REJ'
+    STATUS_CHOICES_NOT_CONTACTED = 'NCO'
+    STATUS_CHOICES_TEST_GROUP = 'TST'
+    STATUS_CHOICES_LEVEL_A = 'LEA'
+    STATUS_CHOICES_LEVEL_B = 'LEB'
+    STATUS_CHOICES_OPTED_OUT = 'OPT'
+
+    STATUS_CHOICES = (
+        (STATUS_CHOICES_NOT_CONTACTED, 'Not contacted'),
+        (STATUS_CHOICES_TEST_GROUP, 'Test group'),
+        (STATUS_CHOICES_LEVEL_A, 'Level A'),
+        (STATUS_CHOICES_LEVEL_B, 'Level B'),
+        (STATUS_CHOICES_OPTED_OUT, 'Opted out'),
+        (STATUS_CHOICES_REJECTED, 'Rejected'),
         (STATUS_CHOICES_DEAD, 'Dead')
     )
 
@@ -309,7 +318,7 @@ class Worker (models.Model):
         person = Worker.objects.filter(user=the_user)
 
         if len(person) == 0:
-            return ('Guest', 'Test account')
+            return ('User/admin', 'Without worker information')
         else:
             # For get_*_display, see:
             # https://docs.djangoproject.com/en/1.10/topics/db/models/#field-options
diff --git a/smash/web/templates/_base.html b/smash/web/templates/_base.html
index cbb02ca6..451d91cf 100644
--- a/smash/web/templates/_base.html
+++ b/smash/web/templates/_base.html
@@ -78,7 +78,7 @@ desired effect
       <div class="navbar-custom-menu">
         <ul class="nav navbar-nav">
           <!-- Messages: style can be found in dropdown.less-->
-          <li class="dropdown messages-menu">
+          <li class="dropdown messages-menu" style="display: none">
             <!-- Menu toggle button -->
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">
               <i class="fa fa-envelope-o"></i>
@@ -123,7 +123,7 @@ desired effect
           <!-- /.messages-menu -->
 
           <!-- Notifications Menu -->
-          <li class="dropdown notifications-menu">
+          <li class="dropdown notifications-menu" style="display: none">
             <!-- Menu toggle button -->
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">
               <i class="fa fa-bell-o"></i>
diff --git a/smash/web/templates/doctors/details.html b/smash/web/templates/doctors/details.html
index dfc9a99b..d2e3ed6b 100644
--- a/smash/web/templates/doctors/details.html
+++ b/smash/web/templates/doctors/details.html
@@ -8,7 +8,7 @@
   <link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
 {% endblock styles %}
 
-{% block page_title %}'worker'{% endblock page_title %}
+{% block page_title %}'workers'{% endblock page_title %}
 {% block page_header %}Worker details{% endblock page_header %}
 {% block page_description %}details{% endblock page_description %}
 
diff --git a/smash/web/templates/subjects/index.html b/smash/web/templates/subjects/index.html
index 42f1bb0e..3a5d8a41 100644
--- a/smash/web/templates/subjects/index.html
+++ b/smash/web/templates/subjects/index.html
@@ -35,7 +35,7 @@
 				<th>First name</th>
 				<th>Last name</th>
 				<th>Country</th>
-				<th>Languages</th>
+				<th data-sorter="false" data-filter="false">Languages</th>
 				<th class="filter-select filter-exact" data-placeholder="Select type">Type</th>
 				<th>Last visit</th>
 				<th>Details</th>
-- 
GitLab