aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/caf')
-rw-r--r--ctrack/caf/templates/caf/caf_detail.html32
-rw-r--r--ctrack/caf/views.py7
2 files changed, 37 insertions, 2 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)