diff --git a/readme.md b/readme.md index 93dd9e238548efd031376c7f54e58c06d7a89741..189382cdc7f7820a305667c55b21418a638a0e55 100644 --- a/readme.md +++ b/readme.md @@ -54,3 +54,4 @@ MEDIA_ROOT = '/tmp/media' # Warning! `/tmp` directory can be flushed in any mome ## Development - Remember, that before working you have to activate _virtualenv_, by: `devel@host ~/home/smash/scheduling-system $ . env/bin/activate` - In order to run development server, run: `devel@host ~/home/smash/scheduling-system/smash $ ./manage.py runserver` and go to `127.0.0.1:8000` in browser + - For reference of HTML tempalte, see [https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html#](https://almsaeedstudio.com/themes/AdminLTE/pages/widgets.html#) diff --git a/smash/web/forms.py b/smash/web/forms.py index ef870ce1f2eb8471e0b2a98ea41f6b1b926c2aa7..7834007e9b59e8cfb1dccc1e072883cabf2986f9 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 c733dfa173e4544bd6dc49221db8accee8841ed0..8ac791e79c21c83f30f3576ec01eb0592ca31e4d 100644 --- a/smash/web/models.py +++ b/smash/web/models.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User, AnonymousUser import datetime -def get_is_current_year(): +def get_current_year(): return datetime.datetime.now().year class Language (models.Model): @@ -26,23 +26,34 @@ 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_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 = ( - ('NCO', 'Not contacted'), - ('TST', 'Test group'), - ('LEA', 'Level A'), - ('LEB', 'Level B'), - ('OPT', 'Opted out'), - ('REJ', 'Rejected'), - ('DEA', 'Dead') + (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') ) def mark_as_dead(self): - self.status = 'DEA' + self.status = STATUS_CHOICES_DEAD self.save() def mark_as_rejected(self): @@ -307,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 cbb02ca63851695f3feeadf72e97720b9fb904dd..451d91cf9d187e18f8728b813e88da50d1451135 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/assignments/index.html b/smash/web/templates/assignments/index.html index 1ebe0c5460de149fa8cad6d58d2dd6113520c2d1..43d23a38c19c943ac3611c0250a516876bcdc4fb 100644 --- a/smash/web/templates/assignments/index.html +++ b/smash/web/templates/assignments/index.html @@ -133,7 +133,7 @@ center: 'title', right: 'month,agendaWeek' }, - editable: true, + editable: false, events: [ {% for approach in approaching_list %} { diff --git a/smash/web/templates/doctors/details.html b/smash/web/templates/doctors/details.html index dfc9a99b4a2e638875b9335fc948da6676e8e950..d2e3ed6b7ff865aea36756662058a056744f96be 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 42f1bb0e6b70730a381d9b8d6a7ec2d3454670e3..3a5d8a41f70af76e851655bdc0dc19195efe9393 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> diff --git a/smash/web/views.py b/smash/web/views.py index 3231d94541b5b4b70924c1f6e0e4ac136569deb3..d214ccfa353c490dd545e1521741f02c1010583c 100644 --- a/smash/web/views.py +++ b/smash/web/views.py @@ -301,8 +301,7 @@ def assignment_add(request, id): form = AppointmentAddForm(initial={'visit': id}) form.fields['visit'].widget = forms.HiddenInput() - vid = id - return wrap_response(request, 'assignments/add.html', {'form': form, 'visitID': vid}) + return wrap_response(request, 'assignments/add.html', {'form': form, 'visitID': id}) def assignment_edit(request, id): if request.method == 'POST':