Skip to content

Commit 2e9284e

Browse files
committed
Merge branch 'development' of https://github.com/cmu-delphi/signal_documentation into OKRS24-187-Signals-Add-a-filter-to-show-only-base-signals
2 parents 264552d + 5c48bff commit 2e9284e

File tree

6 files changed

+77
-231
lines changed

6 files changed

+77
-231
lines changed

src/assets/css/custom.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
padding: 0;
6868
}
6969

70+
.pt-05 {
71+
padding-top: 0.5rem;
72+
}
73+
7074
.border-left {
7175
border-left: 1px solid #e4e4e4;
7276
}
@@ -125,4 +129,8 @@
125129

126130
.select2-container .select2-selection--single .select2-selection__rendered {
127131
padding-left: 0px!important;
128-
}
132+
}
133+
134+
.popover {
135+
max-width: 50%;
136+
}

src/fixtures/nation.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{
3+
"model": "signals.geographyunit",
4+
"pk": 3985,
5+
"fields": {
6+
"created": "2024-05-27T13:52:04.705Z",
7+
"modified": "2024-05-27T13:52:04.705Z",
8+
"geo_id": "US",
9+
"name": "United States",
10+
"display_name": "United States",
11+
"level": 5,
12+
"geography": 5
13+
}
14+
}
15+
]

src/signal_documentation/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848

4949

5050
# SECURITY WARNING: don't run with debug turned on in production!
51-
DEBUG = bool(strtobool(os.getenv('DEBUG', 'True')))
51+
# DEBUG = bool(strtobool(os.getenv('DEBUG', 'True')))
52+
DEBUG = True
5253

5354

5455
# SECURITY WARNING: keep the secret key used in production secret!

src/templates/index.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<link href="{% static 'vendor/remixicon/remixicon.css' %}" rel="stylesheet">
2828
<link href="{% static 'vendor/simple-datatables/style.css' %}" rel="stylesheet">
2929

30+
<!-- Vendor JS Files -->
31+
<script src="{% static 'vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
32+
3033
<!-- Template Main CSS File -->
3134
<link href="{% static 'css/style.css' %}" rel="stylesheet" />
3235
<link href="{% static 'css/custom.css' %}" rel="stylesheet" />
@@ -106,28 +109,27 @@
106109
<footer class="py-3 my-4">
107110
<ul class="nav justify-content-center border-bottom pb-3 mb-3">
108111
<li class="nav-item">
109-
<a href="#" class="nav-link px-2 text-muted">Home</a>
112+
<a href="https://delphi.cmu.edu/about/" class="nav-link px-2 text-muted">Delphi</a>
110113
</li>
111114
<li class="nav-item">
112-
<a href="#" class="nav-link px-2 text-muted">Features</a>
115+
<a href="https://cmu-delphi.github.io/delphi-epidata/" class="nav-link px-2 text-muted">API</a>
113116
</li>
114117
<li class="nav-item">
115-
<a href="#" class="nav-link px-2 text-muted">Pricing</a>
118+
<a href="https://github.com/cmu-delphi/" class="nav-link px-2 text-muted">GitHub</a>
116119
</li>
117120
<li class="nav-item">
118-
<a href="#" class="nav-link px-2 text-muted">FAQs</a>
121+
<a href="https://www.cmu.edu/" class="nav-link px-2 text-muted">CMU</a>
119122
</li>
120123
<li class="nav-item">
121-
<a href="#" class="nav-link px-2 text-muted">About</a>
124+
<a href="https://delphi.cmu.edu/covidcast/" class="nav-link px-2 text-muted">Overview</a>
122125
</li>
123126
</ul>
124-
<p class="text-center text-muted">© 2022 Company, Inc</p>
127+
<p class="text-center text-muted">© 2024, Delphi Group</p>
125128
</footer>
126129

127130
<!-- Template Main JS File -->
128131

129132
<script src="{% static 'vendor/apexcharts/apexcharts.min.js' %}"></script>
130-
<script src="{% static 'vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
131133
<script src="{% static 'vendor/chart.js/chart.umd.js' %}"></script>
132134
<script src="{% static 'vendor/echarts/echarts.min.js' %}"></script>
133135
<script src="{% static 'vendor/quill/quill.min.js' %}"></script>
@@ -136,7 +138,7 @@
136138

137139
<script src="{% static 'js/main.js' %}"></script>
138140

139-
141+
140142
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
141143
</body>
142144
</html>

src/templates/signals/epivis_export_data_block.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h5>Plot / Export data</h5>
106106
<script>
107107
var geoValues = [];
108108
var currentMode = 'epivis';
109-
109+
110110
function getFilteredGeographicValues(geographicType) {
111111
var data = geoValues.reduce((data, geoValue) => {
112112
if (geoValue.geoType === geographicType) {
@@ -130,7 +130,7 @@ <h5>Plot / Export data</h5>
130130
} else {
131131
data = [];
132132
}
133-
133+
134134

135135
$('#geographic_value').select2({
136136
data: data,
@@ -146,7 +146,7 @@ <h5>Plot / Export data</h5>
146146

147147
function handleModeChange(mode) {
148148
document.getElementById("epivis-form").reset();
149-
149+
150150
var choose_dates = document.getElementsByName('choose_date');
151151
if (mode === 'epivis') {
152152
currentMode = 'epivis';
@@ -179,7 +179,7 @@ <h5>Plot / Export data</h5>
179179
$(document).ready(function () {
180180
{% for geography in signal.available_geography.all %}
181181
{% for unit in geography.geography_units.all %}
182-
geoValues.push({'id': '{{ unit.geo_id }}', 'geoType': '{{ unit.geography }}', 'text': '{{ unit.display_name }}'});
182+
geoValues.push({'id': '{{ unit.geo_id }}', 'geoType': '{{ unit.geography }}', 'text': '{{ unit.display_name }}'});
183183
{% endfor %}
184184
{% endfor %}
185185

@@ -201,11 +201,14 @@ <h5>Plot / Export data</h5>
201201

202202
function submitMode(event) {
203203
event.preventDefault();
204-
204+
205205
var dataSource = document.getElementById('source').value;
206206
var dataSignal = document.getElementById('signal').value;
207207
var geographicType = document.getElementById('geographic_type').value;
208-
var geographicValue = $('#geographic_value').select2('data').map((el) => el.id).join(',');
208+
// geographicValue is a comma separated string of geographic values. type can be string or integer
209+
// in case of string, it should be converted to lowercase
210+
// else it will be treated as integer
211+
var geographicValue = $('#geographic_value').select2('data').map((el) => (typeof el.id === 'string') ? el.id.toLowerCase() : el.id).join(',');
209212

210213
if (geographicType === 'Choose...' || geographicValue === '') {
211214
showWarningAlert("Geographic Type or Geographic Value is not selected.");

0 commit comments

Comments
 (0)