diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-09-29 12:02:36 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-09-29 12:02:36 +0100 |
commit | cf4ee94db89e697d625106e78831b7e219cd8c03 (patch) | |
tree | c1441f4d521c43f19664e5c50616df7a5564fa66 /ctrack/organisations | |
parent | 5f477692e5b3a1c2209c0c17e5dc303ea81e7a32 (diff) |
OES engagements on org detail page improved with dates
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/templates/organisations/organisation_detail.html | 43 | ||||
-rw-r--r-- | ctrack/organisations/views.py | 2 |
2 files changed, 35 insertions, 10 deletions
diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html index c02f0ee..4af5d6f 100644 --- a/ctrack/organisations/templates/organisations/organisation_detail.html +++ b/ctrack/organisations/templates/organisations/organisation_detail.html @@ -19,7 +19,7 @@ </div> </div> - <div class="row" id="top-row"> + <div class="row" id="top-row"> <div class="col-md-6"> <div class="card bg-light"> @@ -91,7 +91,7 @@ </table> </div> </div> - </div> + </div> </div> <div class="row pb-2"> @@ -130,7 +130,6 @@ </div> - <div class="row"> <div class="col-md-12 my-2"> <div class="card bg-light"> @@ -205,12 +204,38 @@ class="btn btn-outline-primary btn-sm float-right">Add new...</a></div> <div class="table table-responsive"> - <table class="table table-bordered"> - {% if engagement_events|length > 0 %}{% for event in engagement_events %} - <tr> - <td><a href="#">{{ event.type }}</a></td> - <td>{{ event.short_description }}</td> - </tr> {% endfor %} + <table class="table table-sm table-bordered"> + <thead> + <tr> + <th>Date</th> + <th>Type</th> + <th>Description</th> + <th>Response Requested</th> + <th>Response Due</th> + </tr> + </thead> + {% if engagement_events|length > 0 %} + {% for event in engagement_events %} + <tr> + <td>{{ event.date |date:"D d M Y H:i" }}</td> + <td><a href="#">{{ event.type }}</a></td> + <td>{{ event.short_description }}</td> + {% if event.response_date_requested %} + <td style="color: {{ event.days_to_response_due.descriptor }}">{{ event.response_date_requested |date:"D d M Y" }}</td> + {% else %} + <td>NA</td> + {% endif %} + {% if event.response_received %} + <td>{{ event.response_received | date:"D d M Y" }}</td> + {% else %} + {% if event.response_date_requested %} + <td style="color: {{ event.days_to_response_due.descriptor }};">{{ event.days_to_response_due.days}} {{ event.days_to_response_due.day_str }}</td> + {% else %} + <td>NA</td> + {% endif %} + {% endif %} + </tr> + {% endfor %} {% else %} <a class="btn btn-outline-primary btn-sm" href="{% url "register:create" %}" role="button">Add new...</a> diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index de6d819..9658abf 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -83,7 +83,7 @@ class OrganisationDetailView(LoginRequiredMixin, PermissionRequiredMixin, Detail org = kwargs["object"] peoples = org.person_set.all() cafs = org.caf_set.all() - engagement_events = EngagementEvent.objects.filter(participants__in=peoples) + engagement_events = EngagementEvent.objects.filter(participants__in=peoples).order_by("-date") essential_services = EssentialService.objects.filter(organisation=org) no_addr = org.addresses.count() if no_addr > 1: |