Skip to content

Commit 42921d5

Browse files
committed
Added 'Signals With The Same Base' table to the Signal Detailed View.
1 parent c2753fc commit 42921d5

File tree

2 files changed

+93
-30
lines changed

2 files changed

+93
-30
lines changed

src/signals/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,13 @@ def has_all_demographic_scopes(self) -> bool:
571571
"""
572572
return self.demographic_scope.count() == DemographicScope.objects.count()
573573

574+
@property
575+
def same_base_signals(self):
576+
"""
577+
Returns the signals that have the same base signal.
578+
"""
579+
return self.base.base_for.all() if self.base else None
580+
574581
class Meta:
575582
unique_together = ['name', 'source']
576583
ordering: list[str] = ["modified"]

src/templates/signals/signal_detail.html

Lines changed: 86 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ <h5>About this signal</h5>
181181
</td>
182182
</tr>
183183
<tr>
184-
<th scope="row">Available Since</th>
184+
<th scope="row">Temporal Scope Start</th>
185185
<td>
186-
{{ signal.from_date }}
186+
{{ signal.temporal_scope_start }}
187187
</td>
188188
</tr>
189189
<tr>
190-
<th scope="row">Available Until</th>
190+
<th scope="row">Temporal Scope End</th>
191191
<td>
192-
{{ signal.to_date }}
192+
{{ signal.temporal_scope_end }}
193193
</td>
194194
</tr>
195195
<tr>
@@ -218,40 +218,96 @@ <h5>Signals with same base</h5>
218218
<th scope="col">Active</th>
219219
<th scope="col">Data Source</th>
220220
<th scope="col">Description</th>
221-
<th scope="col">Pathogen/Disease Area</th>
222-
<th scope="col">Base Signal</th>
223-
<th scope="col">Last Updated</th>
221+
<th scope="col">Geographic Scope</th>
222+
<th scope="col">Geographic Granularity, aka Geo-Level</th>
223+
<th scope="col">Available Since</th>
224+
<th scope="col">Available Until</th>
225+
<th scope="col">Temporal Granularity</th>
226+
<th scope="col">Reporting Cadence</th>
227+
<th scope="col">Reporting Lag(nominal)</th>
228+
<th scope="col">Revision Cadence</th>
229+
<th scope="col">Demographic Scope</th>
230+
<!--<th scope="col">Demographic Disaggregation</th> -->
231+
<th scope="col">Pathogen / Syndrome</th>
232+
<th scope="col">Severity Pyramid Rungs</th>
233+
<th scope="col">Missingness</th>
234+
<th scope="col">License / Data Use Restrictions</th>
224235
</tr>
225236
</thead>
226237
<tbody>
227238
{% for signal in signal.same_base_signals %}
228-
<tr classs="clickable-table-row">
229-
<td onClick="location.href='{% url 'signal' pk=signal.id %}';" class="clickable-table-cell">{{ signal.display_name }}</td>
230-
{% if signal.active == True %}
231-
<td><i class="bi bi-circle-fill" style="color:green;" ></i></td>
232-
{% else %}
233-
<td><i class="bi bi-circle-fill" style="color:red;" ></i></td>
234-
{% endif %}
235-
<td>{{ signal.source.data_source }}</td>
236-
<td>{{ signal.description }}</td>
237-
<td>
238-
{% for pathogen in signal.pathogen.all %}
239-
<span class="badge rounded-pill bg-dark">{{ pathogen|title }}</span>
240-
{% endfor %}
239+
<tr>
240+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
241+
{{ signal.display_name }}
241242
</td>
242-
<td>
243-
{% if signal.base %}
244-
<a href="{% url 'signal' pk=signal.base.id %}">{{ signal.display_name }}</a>
243+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
244+
{% if signal.active == True%}
245+
<i class="bi bi-circle-fill" style="color:green;"></i>
245246
{% else %}
246-
--/--
247+
<i class="bi bi-circle-fill" style="color:red;"></i>
247248
{% endif %}
248249
</td>
249-
<td>
250-
{% if signal.last_updated %}
251-
{{ signal.last_updated|date:"Y-m-d" }}
252-
{% else %}
253-
--/--
254-
{% endif %}
250+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
251+
{{ signal.source.external_name }}
252+
</td>
253+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
254+
{{ signal.description }}
255+
</td>
256+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
257+
{{ signal.geographic_scope.name }}
258+
</td>
259+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
260+
{% for geography in signal.geography_signals.all %}
261+
<span class="badge rounded-pill bg-dark">
262+
{{ geography.display_name }}
263+
</span>
264+
{% endfor %}
265+
</td>
266+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
267+
{{ signal.temporal_scope_start }}
268+
</td>
269+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
270+
{{ signal.temporal_scope_end }}
271+
</td>
272+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
273+
{{ signal.time_type }}
274+
</td>
275+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
276+
{{ signal.reporting_cadence }}
277+
</td>
278+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
279+
{{ signal.typical_reporting_lag }}
280+
</td>
281+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
282+
{{ signal.typical_revision_cadence }}
283+
</td>
284+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
285+
{% for demographic_scope in signal.demographic_scope.all %}
286+
<span>
287+
{{ demographic_scope }}
288+
</span>
289+
{% endfor %}
290+
</td>
291+
<!-- <td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
292+
Place for Demographic Disaggregation
293+
</td> -->
294+
<td cla ss="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
295+
{% for pathogen in signal.pathogen.all %}
296+
<span class="badge rounded-pill bg-dark">
297+
{{ pathogen|title }}
298+
</span>
299+
{% endfor %}
300+
</td>
301+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
302+
{{ signal.severenity_pyramid_rungs }}
303+
</td>
304+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
305+
{{ signal.missingness }}
306+
</td>
307+
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
308+
{{ signal.license }}
309+
<br>
310+
{{ signal.restrictions }}
255311
</td>
256312
</tr>
257313
{% endfor %}

0 commit comments

Comments
 (0)