diff options
-rw-r--r-- | ctrack/core/views.py | 10 | ||||
-rw-r--r-- | ctrack/templates/pages/stakeholder_home.html | 21 |
2 files changed, 29 insertions, 2 deletions
diff --git a/ctrack/core/views.py b/ctrack/core/views.py index c9465f1..5f5627c 100644 --- a/ctrack/core/views.py +++ b/ctrack/core/views.py @@ -2,6 +2,7 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import render from ctrack.organisations.models import IncidentReport, Organisation +from ctrack.register.models import EngagementEvent @login_required @@ -12,10 +13,17 @@ def home_page(request): ) irs = IncidentReport.objects.filter(organisation__name=org) systems = org.applicablesystem_set.all() + peoples = org.person_set.all() + engagement_events = EngagementEvent.objects.filter(participants__in=peoples) return render( request, "pages/stakeholder_home.html", - context={"org": org, "systems": systems, "irs": irs}, + context={ + "org": org, + "systems": systems, + "irs": irs, + "engagement_events": engagement_events, + }, ) else: return render(request, "pages/home.html") diff --git a/ctrack/templates/pages/stakeholder_home.html b/ctrack/templates/pages/stakeholder_home.html index 209a063..7ddd7fa 100644 --- a/ctrack/templates/pages/stakeholder_home.html +++ b/ctrack/templates/pages/stakeholder_home.html @@ -155,7 +155,26 @@ <div class="row"> <div class="col md-12"> <h2>DfT Engagement</h2> - <p>No engagement with DfT currently scheduled</p> + <table class="table table-md"> + {% if engagement_events|length > 0 %} + {% for event in engagement_events %} + <thead> + <th>Date</td> + <th>Event</td> + <th>Description</td> + <th>DfT Comments</td> + </thead> + <tr> + <td>{{event.date }}</td> + <td><a href="#">{{ event.type}}</a></td> + <td>{{ event.short_description }}</td> + <td>{{ event.comments }}</td> + </tr> + {% endfor %} + {% else %} + <p>No engagement with DfT currently scheduled</p> + {% endif %} + </table> </div> </div> |