Skip to content
Snippets Groups Projects
Commit 0ab27750 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '201-list-shown-after-clicking-on-notifications' into 'master'

Resolve "list shown after clicking on notifications"

Closes #201

See merge request NCER-PD/scheduling-system!129
parents f6e3b3cc cf3519d7
No related branches found
No related tags found
1 merge request!129Resolve "list shown after clicking on notifications"
Pipeline #
......@@ -9,7 +9,7 @@ SUBJECT_LIST_REQUIRE_CONTACT = "REQUIRE_CONTACT"
SUBJECT_LIST_VOUCHER_EXPIRY = "VOUCHER_EXPIRY"
SUBJECT_LIST_CHOICES = {
SUBJECT_LIST_GENERIC: 'Generic',
SUBJECT_LIST_GENERIC: 'Generic subject list',
SUBJECT_LIST_NO_VISIT: 'Subjects without visit',
SUBJECT_LIST_REQUIRE_CONTACT: 'Subjects required contact',
SUBJECT_LIST_VOUCHER_EXPIRY: 'Subject with vouchers to be expired soon'
......
......@@ -12,7 +12,7 @@ VISIT_LIST_APPROACHING_WITHOUT_APPOINTMENTS = "APPROACHING_WITHOUT_APPOINTMENTS"
VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT = "APPROACHING_FOR_MAIL_CONTACT"
VISIT_LIST_CHOICES = {
VISIT_LIST_GENERIC: 'Generic',
VISIT_LIST_GENERIC: 'Generic visit list',
VISIT_LIST_EXCEEDED_TIME: 'exceeded visit time',
VISIT_LIST_UNFINISHED: 'unfinished visits',
VISIT_LIST_MISSING_APPOINTMENTS: 'visits with missing appointments',
......
......@@ -9,10 +9,10 @@
{% endblock styles %}
{% block ui_active_tab %}'appointments'{% endblock ui_active_tab %}
{% block page_header %}Appointments{% endblock page_header %}
{% block page_header %}{{ list_description }}{% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block title %}{{ block.super }} - Appointments{% endblock %}
{% block title %}{{ block.super }} - {{ list_description }}{% endblock %}
{% block breadcrumb %}
{% include "appointments/breadcrumb.html" %}
......
......@@ -8,10 +8,10 @@
{% endblock styles %}
{% block ui_active_tab %}'subjects'{% endblock ui_active_tab %}
{% block page_header %}Subjects{% endblock page_header %}
{% block page_header %}{{ list_description }}{% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block title %}{{ block.super }} - Subjects{% endblock %}
{% block title %}{{ block.super }} - {{ list_description }}{% endblock %}
{% block breadcrumb %}
{% include "subjects/breadcrumb.html" %}
......
......@@ -10,10 +10,10 @@
{% endblock styles %}
{% block ui_active_tab %}'visits'{% endblock ui_active_tab %}
{% block page_header %}Visits{% endblock page_header %}
{% block page_header %}{{ list_description }}{% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block title %}{{ block.super }} - Visits{% endblock %}
{% block title %}{{ block.super }} - {{ list_description }}{% endblock %}
{% block breadcrumb %}
{% include "visits/breadcrumb.html" %}
......@@ -40,6 +40,7 @@
function getVisitEditUrl(id) {
return "{% url 'web.views.visit_details' 12345678 %}".replace(/12345678/, id);
}
$.get("{% url 'web.api.visits.columns' visit_list_type %}", function (data) {
createVisitsTable({
locations_url: "{% url 'web.api.locations' %}",
......
# coding=utf-8
import logging
import unittest
from django.test import TestCase
......@@ -14,6 +15,7 @@ from web.views.notifications import get_today_midnight_date
logger = logging.getLogger(__name__)
# @unittest.skip("test redcap server is down")
class TestRedcapConnector(TestCase):
def test_invalid_configuration(self):
redcap_connection = RedcapConnector()
......
import logging
import unittest
from django.urls import reverse
......@@ -13,6 +14,7 @@ class RedcapViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.missing_redcap_subject'))
self.assertEqual(response.status_code, 200)
# @unittest.skip("test redcap server is down")
def test_render_workers_list_request_with_valid_connection(self):
prepare_test_redcap_connection()
......@@ -23,6 +25,7 @@ class RedcapViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.inconsistent_redcap_subject'))
self.assertEqual(response.status_code, 200)
# @unittest.skip("test redcap server is down")
def test_render_add_worker_request_with_valid_connection(self):
prepare_test_redcap_connection()
......
......@@ -27,6 +27,7 @@ def appointments(request):
def unfinished_appointments(request):
context = {
'list_type': APPOINTMENT_LIST_UNFINISHED,
'list_description': 'List of unfinished appointments'
}
return wrap_response(request, "appointments/list.html", context)
......
......@@ -9,19 +9,24 @@ from ..forms import VisitDetailForm, SubjectAddForm, SubjectEditForm, StudySubje
from ..models import StudySubject, MailTemplate, Worker, Study
from ..models.constants import GLOBAL_STUDY_ID
from ..models.study_subject_list import SUBJECT_LIST_GENERIC, SUBJECT_LIST_NO_VISIT, SUBJECT_LIST_REQUIRE_CONTACT, \
SUBJECT_LIST_VOUCHER_EXPIRY
SUBJECT_LIST_VOUCHER_EXPIRY, SUBJECT_LIST_CHOICES
logger = logging.getLogger(__name__)
def subjects(request):
def subject_list(request, subject_list_type):
context = {
'list_type': SUBJECT_LIST_GENERIC,
'worker': Worker.get_by_user(request.user)
'list_type': subject_list_type,
'worker': Worker.get_by_user(request.user),
'list_description': SUBJECT_LIST_CHOICES[subject_list_type],
}
return wrap_response(request, 'subjects/index.html', context)
def subjects(request):
return subject_list(request, SUBJECT_LIST_GENERIC)
def subject_add(request):
study = Study.objects.filter(id=GLOBAL_STUDY_ID)[0]
if request.method == 'POST':
......@@ -47,24 +52,15 @@ def subject_add(request):
def subject_no_visits(request):
context = {
'list_type': SUBJECT_LIST_NO_VISIT,
}
return wrap_response(request, 'subjects/index.html', context)
return subject_list(request, SUBJECT_LIST_NO_VISIT)
def subject_voucher_expiry(request):
context = {
'list_type': SUBJECT_LIST_VOUCHER_EXPIRY,
}
return wrap_response(request, 'subjects/index.html', context)
return subject_list(request, SUBJECT_LIST_VOUCHER_EXPIRY)
def subject_require_contact(request):
context = {
'list_type': SUBJECT_LIST_REQUIRE_CONTACT,
}
return wrap_response(request, 'subjects/index.html', context)
return subject_list(request, SUBJECT_LIST_REQUIRE_CONTACT)
def subject_edit(request, id):
......
......@@ -6,7 +6,7 @@ from django.shortcuts import get_object_or_404, redirect
from notifications import waiting_for_appointment
from web.models.study_visit_list import VISIT_LIST_GENERIC, VISIT_LIST_MISSING_APPOINTMENTS, \
VISIT_LIST_APPROACHING_WITHOUT_APPOINTMENTS, VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT, VISIT_LIST_EXCEEDED_TIME, \
VISIT_LIST_UNFINISHED
VISIT_LIST_UNFINISHED, VISIT_LIST_CHOICES
from . import wrap_response
from ..forms import VisitDetailForm, VisitAddForm, SubjectDetailForm, StudySubjectDetailForm
from ..models import Visit, Appointment, StudySubject, MailTemplate
......@@ -15,7 +15,11 @@ logger = logging.getLogger(__name__)
def show_visits(request, visit_list_type):
return wrap_response(request, 'visits/index.html', {'visit_list_type': visit_list_type})
context = {
'visit_list_type': visit_list_type,
'list_description': VISIT_LIST_CHOICES[visit_list_type]
}
return wrap_response(request, 'visits/index.html', context)
def visits(request):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment