diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/templates/caf/caf_detail.html | 32 | ||||
-rw-r--r-- | ctrack/caf/views.py | 7 | ||||
-rw-r--r-- | ctrack/register/views.py | 2 |
3 files changed, 38 insertions, 3 deletions
diff --git a/ctrack/caf/templates/caf/caf_detail.html b/ctrack/caf/templates/caf/caf_detail.html index b323ace..2e88b15 100644 --- a/ctrack/caf/templates/caf/caf_detail.html +++ b/ctrack/caf/templates/caf/caf_detail.html @@ -8,8 +8,36 @@ <div class="row"> <div class="col-12"> - <h4 class="bg-info mb-2 p-2 border-top border-bottom rounded border-secondary text-white">{{ object }} <span class="badge badge-primary float-right">{{ object.confidence_grading }}</span> - <span class="badge badge-primary float-right">{{ object.quality_grading }}</span> </h4> + <h4 class="bg-info mb-2 p-2 border-top border-bottom rounded border-secondary text-white">{{ object }} <span + class="badge badge-primary float-right">{{ object.confidence_grading }}</span> + <span class="badge badge-primary float-right">{{ object.quality_grading }}</span></h4> + </div> + </div> + + <div class="row"> + <div class="col-12"> + <h3>Current status:</h3> + <div class="row"> + <div class="col-md-12 m-2 p-1"> + {% if not events %} + No events registered for this CAF. + <span class="float-right"><a href="#" type="button" class="btn btn-outline-primary btn-sm">Register Event</a></span> + {% endif %} + </div> + </div> + <div class="row"> + <div class="col-md-12"> + <ul class="list-group"> + {% for event in events %} + {% if not event.ended %} + <li class="list-group-item list-group-item-{{ event.badge_code }}"><a + href="#">{{ event.event.type }}</a> + <span class="float-right">Started: {{ event.event.date|date:"j M Y" }}</span></li> + {% endif %} + {% endfor %} + </div> + </div> + </ul> </div> </div> diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index b95965b..d11fa8c 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -31,11 +31,18 @@ def caf_detail_view(request, pk): for ass in assessments: lst_scores = [ass, CAFAssessmentOutcomeScore.objects.filter(caf_assessment=ass)] _scrs.append(lst_scores) + events_related_to_caf = caf.get_events() + events = [] + for event in events_related_to_caf: + if not event.end_date: + events.append(dict(event=event, ended=False, badge_code="warning")) + context = { "object": caf, "assessments_and_scores": _scrs, "organisation": caf.organisation, "systems": caf.systems.all(), + "events": events } return render(request, "caf/caf_detail.html", context) diff --git a/ctrack/register/views.py b/ctrack/register/views.py index dfefc1b..5a0d84f 100644 --- a/ctrack/register/views.py +++ b/ctrack/register/views.py @@ -1,7 +1,7 @@ from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect -from django.urls import reverse, reverse_lazy +from django.urls import reverse_lazy from django.views.generic import FormView, DeleteView from ctrack.organisations.models import Organisation |