From 247a88d2d129a83a8891ae0d356e23d513259e14 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Fri, 23 Oct 2020 16:10:06 +0100 Subject: improved CAF detail page --- ctrack/caf/templates/caf/caf_detail.html | 46 +++++++++++--------------------- ctrack/caf/views.py | 2 +- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/ctrack/caf/templates/caf/caf_detail.html b/ctrack/caf/templates/caf/caf_detail.html index 53b7efe..52da584 100644 --- a/ctrack/caf/templates/caf/caf_detail.html +++ b/ctrack/caf/templates/caf/caf_detail.html @@ -8,49 +8,25 @@
-
-
-

{{ object }}

-
-
+

{{ object }}

- {% if tde and sde %} -

History:

-
-
- No events registered for this CAF. - Register Event -
-
- {% endif %}
+
Key Events:
    - {% for event in twin_date_events %} - {% if event.end_date %} -
  • {{ event.type }} - Completed: {{ event.end_date|date:"j M Y" }}
  • - {% else %} -
  • {{ event.type }} - Started: {{ event.date|date:"j M Y" }}
  • - {% endif %} - {% endfor %} - {% for event in single_date_events %} -
  • - {{ event.type }} + {% for event in all_events %} +
  • + {{ event.type_descriptor }} Completed: {{ event.date|date:"j M Y" }}
  • {% endfor %}
-
@@ -113,7 +89,8 @@ d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/> - New Single Date Event | + New Single Date Event + | +
@@ -181,6 +159,13 @@ new...
+ + + + + + + {% if systems|length > 0 %} {% for system in systems %} @@ -196,6 +181,7 @@ Add new... {% endif %} +
NameDescription
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index e8479ab..eb74036 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -27,7 +27,7 @@ def caf_detail_view(request, pk): # caf_principles = CAFPrinciple.objects.all() _scrs = [] _events = list(itertools.chain(caf.cafsingledateevent_set.all(), caf.caftwindateevent_set.all())) - all_events = sorted(_events, key=lambda x: x.date, reverse=True) + all_events = sorted(_events, key=lambda x: x.date, reverse=False) for ass in assessments: lst_scores = [ass, CAFAssessmentOutcomeScore.objects.filter(caf_assessment=ass)] _scrs.append(lst_scores) -- cgit v1.2.3