aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-23 13:22:26 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-23 13:22:26 +0100
commit262bc5a20a02316ffef70b5f7f371d91165b1652 (patch)
tree7c2a3b6a00c9629c07c16071e3f82f9df5e8224c
parenta01d6eaef59c492072199c22e3ad66af84556e10 (diff)
added some more summary numbers to home page
-rw-r--r--ctrack/core/views.py12
-rw-r--r--ctrack/templates/pages/home.html41
2 files changed, 21 insertions, 32 deletions
diff --git a/ctrack/core/views.py b/ctrack/core/views.py
index d9129e8..3984b2d 100644
--- a/ctrack/core/views.py
+++ b/ctrack/core/views.py
@@ -4,7 +4,7 @@ from django.shortcuts import render
from ctrack.caf.models import EssentialService, CAF, ApplicableSystem
from ctrack.organisations.models import IncidentReport, Organisation, Person, Submode
from ctrack.organisations.utils import inspectors_for_each_mode
-from ctrack.register.models import EngagementEvent
+from ctrack.register.models import EngagementEvent, SingleDateTimeEvent
def home_page(request):
@@ -30,6 +30,11 @@ def home_page(request):
caf_users = get_user_model().objects.all()
no_orgs = Organisation.objects.count()
no_people = Person.objects.count()
+ no_singledatetime_events = SingleDateTimeEvent.objects.count()
+ no_meetings = SingleDateTimeEvent.objects.filter(type_descriptor="MEETING").count()
+ no_emails = SingleDateTimeEvent.objects.filter(type_descriptor="EMAIL").count()
+ no_phone_calls = SingleDateTimeEvent.objects.filter(type_descriptor="PHONE_CALL").count()
+ no_video_conferences = SingleDateTimeEvent.objects.filter(type_descriptor="VIDEO_CALL").count()
no_cafs = CAF.objects.count()
no_oes = Organisation.objects.filter(oes=True).count()
no_essential_services = EssentialService.objects.count()
@@ -41,9 +46,14 @@ def home_page(request):
"no_oes": no_oes,
"no_orgs": no_orgs,
"no_people": no_people,
+ "no_singledatetime_events": no_singledatetime_events,
+ "no_meetings": no_meetings,
"no_cafs": no_cafs,
"no_essential_services": no_essential_services,
"no_systems": no_systems,
+ "no_emails": no_emails,
+ "no_phone_calls": no_phone_calls,
+ "no_video_conferences": no_video_conferences,
"caf_users": caf_users,
"submodes": submodes,
"submode_inspector_dict": submode_inspector_dict,
diff --git a/ctrack/templates/pages/home.html b/ctrack/templates/pages/home.html
index 5155c5e..d3a1309 100644
--- a/ctrack/templates/pages/home.html
+++ b/ctrack/templates/pages/home.html
@@ -32,16 +32,18 @@
</h3>
<p>There are currently <span class="lead font-weight-bold">{{ no_orgs }}</span> <a
href="{% url "organisations:list" %}">organisations</a> on ctrack, of which <span
- class="lead font-weight-bold">{{ no_oes }}</span> are <a href="{% url "organisations:list_oes" %}">OES</a>, comprising <span
- class="lead font-weight-bold">{{ no_people }}</span> <a href="{% url "organisations:people" %}">people</a>.
+ class="lead font-weight-bold">{{ no_oes }}</span> are <a href="{% url "organisations:list_oes" %}">OES</a>,
+ comprising <span
+ class="lead font-weight-bold">{{ no_people }}</span> <a href="{% url "organisations:people" %}">people</a>.
OES are responsible for <span class="lead font-weight-bold">{{ no_essential_services }}</span> NIS <a
href="#">essential services</a>. There have been a total of <span
- class="lead font-weight-bold">X</span> <a href="#">interactions</a> with OES by inspectors,
- including <span class="lead font-weight-bold">X</span> emails, <span
- class="lead font-weight-bold">X</span>
- phone calls, <span class="lead font-weight-bold">X</span> video conferences, and <span
- class="lead font-weight-bold">X</span>
- meetings.</p>
+ class="lead font-weight-bold">{{ no_singledatetime_events }}</span> interactions with OES by
+ inspectors,
+ including <span class="lead font-weight-bold">{{ no_emails }}</span> emails, <span
+ class="lead font-weight-bold">{{ no_phone_calls }}</span>
+ phone calls, <span class="lead font-weight-bold">{{ no_video_conferences }}</span> video conferences, and
+ <span
+ class="lead font-weight-bold">{{ no_meetings }}</span> meetings.</p>
<p class="small">Use these high level lists to view things by <strong>lead inspector</strong>, <strong>sub-mode</strong>
and other attributes:</p>
@@ -137,29 +139,6 @@
</div>
</div>
- <!-- Example row of columns -->
- {# <div class="row">#}
- {# <div class="col-md-4">#}
- {# <h1>OES/Organisations</h1>#}
- {# <p>There are currently <span class="lead font-weight-bold">53</span> <a#}
- {# href="{% url "organisations:list" %}">organisations</a> on ctrack, comprising <span#}
- {# class="lead font-weight-bold">124</span> <a href="{% url "organisations:people" %}">people</a>.</p>#}
- {# <p><a class="btn btn-secondary" href="#" role="button">View details &raquo;</a></p>#}
- {# </div>#}
- {# <div class="col-md-4">#}
- {# <h1>CAFs</h1>#}
- {# <p>There are <span class="lead font-weight-bold">93</span> <a href="{% url "caf:caf_list" %}">CAFs</a> on ctrack.#}
- {# </p>#}
- {# <p><a class="btn btn-secondary" href="#" role="button">View details &raquo;</a></p>#}
- {# </div>#}
- {# <div class="col-md-4">#}
- {# <h2>Heading</h2>#}
- {# <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta#}
- {# felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum#}
- {# massa justo sit amet risus.</p>#}
- {# <p><a class="btn btn-secondary" href="#" role="button">View details &raquo;</a></p>#}
- {# </div>#}
- {# </div>#}
<hr>
<div class="container">