Skip to content

Commit 0a8ac7d

Browse files
committed
OKRS24-218 Changed Signal List View table. Added new columns.
1 parent 6c82ce5 commit 0a8ac7d

File tree

2 files changed

+75
-17
lines changed

2 files changed

+75
-17
lines changed

src/signals/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ class GeographySignal(models.Model):
176176
class Meta:
177177
unique_together = ('geography', 'signal')
178178

179+
@property
180+
def display_name(self) -> str:
181+
"""
182+
Returns the display name of the geography signal.
183+
184+
:return: The display name of the geography signal.
185+
:rtype: str
186+
"""
187+
return f'{self.geography.name} (by Delphi)' if self.aggregated_by_delphi else self.geography.name
188+
179189

180190
class GeographyUnit(TimeStampedModel):
181191
"""

src/templates/signals/signals.html

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -288,20 +288,31 @@ <h2 class="accordion-header">
288288
<table class="table table-borderless table-hover signals-list-table">
289289
<thead>
290290
<tr>
291-
<th scope="col" style="padding-left: 0px; padding-right: 0px;"></th>
291+
<th scope="col"></th>
292292
<th scope="col">Name</th>
293293
<th scope="col">Active</th>
294294
<th scope="col">Data Source</th>
295295
<th scope="col">Description</th>
296-
<th scope="col">Pathogen/Disease Area</th>
297-
<th scope="col">Base Signal</th>
298-
<th scope="col">Last Updated</th>
296+
<th scope="col">Geographic Scope</th>
297+
<th scope="col">Geographic Granularity, aka Geo-Level</th>
298+
<th scope="col">Available Since</th>
299+
<th scope="col">Available Until</th>
300+
<th scope="col">Temporal Granularity</th>
301+
<th scope="col">Reporting Cadence</th>
302+
<th scope="col">Reporting Lag(nominal)</th>
303+
<th scope="col">Revision Cadence</th>
304+
<th scope="col">Demographic Scope</th>
305+
<!--<th scope="col">Demographic Disaggregation</th> -->
306+
<th scope="col">Pathogen / Syndrome</th>
307+
<th scope="col">Severity Pyramid Rungs</th>
308+
<th scope="col">Missingness</th>
309+
<th scope="col">License / Data Use Restrictions</th>
299310
</tr>
300311
</thead>
301312
<tbody>
302313
{% for signal in signals %}
303314
<tr>
304-
<td style="padding-left: 0px; padding-right: 0px;">
315+
<td>
305316
<input type="checkbox" name="id" value="{{ signal.id }}">
306317
{{ form.id|as_crispy_field }}
307318
</td>
@@ -319,26 +330,63 @@ <h2 class="accordion-header">
319330
{{ signal.source.external_name }}
320331
</td>
321332
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
322-
{{ signal.description}}
333+
{{ signal.description }}
323334
</td>
324335
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
336+
{{ signal.geographic_scope.name }}
337+
</td>
338+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
339+
{% for geography in signal.geography_signals.all %}
340+
<span class="badge rounded-pill bg-dark">
341+
{{ geography.display_name }}
342+
</span>
343+
{% endfor %}
344+
</td>
345+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
346+
{{ signal.temporal_scope_start }}
347+
</td>
348+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
349+
{{ signal.temporal_scope_end }}
350+
</td>
351+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
352+
{{ signal.time_type }}
353+
</td>
354+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
355+
{{ signal.reporting_cadence }}
356+
</td>
357+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
358+
{{ signal.typical_reporting_lag }}
359+
</td>
360+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
361+
{{ signal.typical_revision_cadence }}
362+
</td>
363+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
364+
{% for demographic_scope in signal.demographic_scope.all %}
365+
<span>
366+
{{ demographic_scope }}
367+
</span>
368+
{% endfor %}
369+
</td>
370+
<!-- <td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
371+
Place for Demographic Disaggregation
372+
</td> -->
373+
<td cla ss="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
325374
{% for pathogen in signal.pathogen.all %}
326-
<span class="badge rounded-pill bg-dark">{{ pathogen|title }}</span>
375+
<span class="badge rounded-pill bg-dark">
376+
{{ pathogen|title }}
377+
</span>
327378
{% endfor %}
328379
</td>
329380
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
330-
{% if signal.base %}
331-
<a href="{% url 'signal' pk=signal.base.id %}">{{ signal.display_name }}</a>
332-
{% else %}
333-
<span>--/--</span>
334-
{% endif %}
381+
{{ signal.severenity_pyramid_rungs }}
335382
</td>
336383
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
337-
{% if signal.last_updated %}
338-
{{ signal.last_updated|date:"Y-m-d" }}
339-
{% else %}
340-
<span>--/--</span>
341-
{% endif %}
384+
{{ signal.missingness }}
385+
</td>
386+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
387+
{{ signal.license }}
388+
<br>
389+
{{ signal.restrictions }}
342390
</td>
343391
</tr>
344392
{% endfor %}

0 commit comments

Comments
 (0)