Skip to content

Pre development #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/signals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,13 @@ def has_all_demographic_scopes(self) -> bool:
"""
return self.demographic_scope.count() == DemographicScope.objects.count()

@property
def same_base_signals(self):
"""
Returns the signals that have the same base signal.
"""
return self.base.base_for.all() if self.base else None

class Meta:
unique_together = ['name', 'source']
ordering: list[str] = ["modified"]
Expand Down
122 changes: 89 additions & 33 deletions src/templates/signals/signal_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ <h5>About this signal</h5>
</td>
</tr>
<tr>
<th scope="row">Geography</th>
<th scope="row">Geographic Granularity, aka Geo-Level</th>
<td>
<ul class="no-padding">
{% for geography in signal.available_geography.all %}
{% for geography in signal.geography_signals.all %}
<a href="{% url 'signals' %}?available_geography={{ geography.id }}">
<span class="badge rounded-pill bg-dark">
{{ geography }}
{{ geography.display_name }}
</span>
</a>
{% endfor %}
Expand Down Expand Up @@ -181,15 +181,15 @@ <h5>About this signal</h5>
</td>
</tr>
<tr>
<th scope="row">Available Since</th>
<th scope="row">Temporal Scope Start</th>
<td>
{{ signal.from_date }}
{{ signal.temporal_scope_start }}
</td>
</tr>
<tr>
<th scope="row">Available Until</th>
<th scope="row">Temporal Scope End</th>
<td>
{{ signal.to_date }}
{{ signal.temporal_scope_end }}
</td>
</tr>
<tr>
Expand Down Expand Up @@ -218,40 +218,96 @@ <h5>Signals with same base</h5>
<th scope="col">Active</th>
<th scope="col">Data Source</th>
<th scope="col">Description</th>
<th scope="col">Pathogen/Disease Area</th>
<th scope="col">Base Signal</th>
<th scope="col">Last Updated</th>
<th scope="col">Geographic Scope</th>
<th scope="col">Geographic Granularity, aka Geo-Level</th>
<th scope="col">Available Since</th>
<th scope="col">Available Until</th>
<th scope="col">Temporal Granularity</th>
<th scope="col">Reporting Cadence</th>
<th scope="col">Reporting Lag(nominal)</th>
<th scope="col">Revision Cadence</th>
<th scope="col">Demographic Scope</th>
<!--<th scope="col">Demographic Disaggregation</th> -->
<th scope="col">Pathogen / Syndrome</th>
<th scope="col">Severity Pyramid Rungs</th>
<th scope="col">Missingness</th>
<th scope="col">License / Data Use Restrictions</th>
</tr>
</thead>
<tbody>
{% for signal in signal.same_base_signals %}
<tr classs="clickable-table-row">
<td onClick="location.href='{% url 'signal' pk=signal.id %}';" class="clickable-table-cell">{{ signal.display_name }}</td>
{% if signal.active == True %}
<td><i class="bi bi-circle-fill" style="color:green;" ></i></td>
{% else %}
<td><i class="bi bi-circle-fill" style="color:red;" ></i></td>
{% endif %}
<td>{{ signal.source.data_source }}</td>
<td>{{ signal.description }}</td>
<td>
{% for pathogen in signal.pathogen.all %}
<span class="badge rounded-pill bg-dark">{{ pathogen|title }}</span>
{% endfor %}
<tr>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.display_name }}
</td>
<td>
{% if signal.base %}
<a href="{% url 'signal' pk=signal.base.id %}">{{ signal.display_name }}</a>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{% if signal.active == True%}
<i class="bi bi-circle-fill" style="color:green;"></i>
{% else %}
--/--
<i class="bi bi-circle-fill" style="color:red;"></i>
{% endif %}
</td>
<td>
{% if signal.last_updated %}
{{ signal.last_updated|date:"Y-m-d" }}
{% else %}
--/--
{% endif %}
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.source.external_name }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.description }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.geographic_scope.name }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{% for geography in signal.geography_signals.all %}
<span class="badge rounded-pill bg-dark">
{{ geography.display_name }}
</span>
{% endfor %}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.temporal_scope_start }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.temporal_scope_end }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.time_type }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.reporting_cadence }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.typical_reporting_lag }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.typical_revision_cadence }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{% for demographic_scope in signal.demographic_scope.all %}
<span>
{{ demographic_scope }}
</span>
{% endfor %}
</td>
<!-- <td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
Place for Demographic Disaggregation
</td> -->
<td cla ss="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{% for pathogen in signal.pathogen.all %}
<span class="badge rounded-pill bg-dark">
{{ pathogen|title }}
</span>
{% endfor %}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.severenity_pyramid_rungs }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.missingness }}
</td>
<td class="clickable-table-cell" onClick="location.href='{% url 'signal' pk=signal.id %}';">
{{ signal.license }}
<br>
{{ signal.restrictions }}
</td>
</tr>
{% endfor %}
Expand Down
8 changes: 4 additions & 4 deletions src/templates/signals/signals.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2 class="accordion-header" id="pathogen-heading">
Pathogen / Syndrome
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
data-bs-title="Pathogen / Syndrome"
data-bs-content="{{ filter_descriptions.SignalFilter.pathogen }}">
data-bs-content="{{ filters_descriptions.SignalFilter.pathogen }}">
<i class="bi bi-info-circle"></i>
</a>
</label>
Expand Down Expand Up @@ -90,7 +90,7 @@ <h2 class="accordion-header" id="active-heading">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#available_geography-collapse" aria-expanded="false" aria-controls="active-collapse">
<label for="id_available_geography" class="form-label">
Geo-level
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover" data-bs-title="Available Geography" data-bs-content="{{ filters_descriptions.SignalFilter.available_geography }}"><i class="bi bi-info-circle"></i></a>
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover" data-bs-title="Geo-level" data-bs-content="{{ filters_descriptions.SignalFilter.available_geography }}"><i class="bi bi-info-circle"></i></a>
</label>
</button>
</h2>
Expand All @@ -117,7 +117,7 @@ <h2 class="accordion-header" id="severenity_pyramid_rungs-heading">
Severity Pyramid
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
data-bs-title="Severity Pyramid"
data-bs-content="{{ filters_descriptions.SignalFilter.severity_pyramid }}">
data-bs-content="{{ filters_descriptions.SignalFilter.severenity_pyramid_rungs }}">
<i class="bi bi-info-circle"></i>
</a>
</label>
Expand All @@ -144,7 +144,7 @@ <h2 class="accordion-header" id="source-heading">
<label for="id_source" class="form-label">
Data Source
<a tabindex="0" role="button" class="info-button" data-bs-toggle="popover"
data-bs-title="Source"
data-bs-title="Data Source"
data-bs-content="{{ filters_descriptions.SignalFilter.source }}">
<i class="bi bi-info-circle"></i>
</a>
Expand Down
Loading