diff --git a/src/fixtures/severity_pyramid_rungs.json b/src/fixtures/severity_pyramid_rungs.json index 163b91d..36568e9 100644 --- a/src/fixtures/severity_pyramid_rungs.json +++ b/src/fixtures/severity_pyramid_rungs.json @@ -126,8 +126,8 @@ "fields": { "created": "2024-08-15T09:57:49.327Z", "modified": "2024-08-15T13:07:46.136Z", - "name": "Case", - "display_name": "Case", + "name": "Ascertained (Case)", + "display_name": "Ascertained (Case)", "used_in": "signal_sets" } }, diff --git a/src/signal_sets/models.py b/src/signal_sets/models.py index aded6b7..d23e7b5 100644 --- a/src/signal_sets/models.py +++ b/src/signal_sets/models.py @@ -248,4 +248,4 @@ class Meta: @property def get_available_geographies(self): - return ", ".join([geo.display_name for geo in self.available_geographies.all()]) + return [geo.display_name for geo in self.available_geographies.all()] diff --git a/src/signal_sets/views.py b/src/signal_sets/views.py index b9fae1c..1051307 100644 --- a/src/signal_sets/views.py +++ b/src/signal_sets/views.py @@ -86,9 +86,9 @@ def get_url_params(self): url_params_str = f"{url_params_str}&{param_name}={param_value}" return url_params_dict, url_params_str - def get_related_signals(self, queryset): + def get_related_signals(self, queryset, signal_set_ids): related_signals = [] - for signal in queryset.prefetch_related( + for signal in queryset.filter(signal_set__id__in=signal_set_ids).prefetch_related( "signal_set", "source", "severity_pyramid_rung" ): related_signals.append( @@ -124,7 +124,7 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]: context["filter"] = filter context["signal_sets"] = filter.qs context["related_signals"] = json.dumps( - self.get_related_signals(filter.signals_qs) + self.get_related_signals(filter.signals_qs, filter.qs.values_list("id", flat=True)) ) context["available_geographies"] = Geography.objects.filter(used_in="signals") context["geographic_granularities"] = [ diff --git a/src/signals/admin.py b/src/signals/admin.py index 13102a2..552020e 100644 --- a/src/signals/admin.py +++ b/src/signals/admin.py @@ -103,6 +103,7 @@ class SeverityPyramidRungAdmin(admin.ModelAdmin): "display_name", "used_in", ) + exclude = ("id",) search_fields: tuple[Literal["name"]] = ("name",) diff --git a/src/staticfiles/admin/css/autocomplete.css b/src/staticfiles/admin/css/autocomplete.css index 7478c2c..69c94e7 100644 --- a/src/staticfiles/admin/css/autocomplete.css +++ b/src/staticfiles/admin/css/autocomplete.css @@ -273,7 +273,3 @@ select.admin-autocomplete { display: block; padding: 6px; } - -.errors .select2-selection { - border: 1px solid var(--error-fg); -} diff --git a/src/staticfiles/admin/css/base.css b/src/staticfiles/admin/css/base.css index ac28326..44f2fc8 100644 --- a/src/staticfiles/admin/css/base.css +++ b/src/staticfiles/admin/css/base.css @@ -13,7 +13,6 @@ html[data-theme="light"], --body-fg: #333; --body-bg: #fff; --body-quiet-color: #666; - --body-medium-color: #444; --body-loud-color: #000; --header-color: #ffc; @@ -85,8 +84,6 @@ html[data-theme="light"], "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - - color-scheme: light; } html, body { @@ -150,6 +147,7 @@ h1 { margin: 0 0 20px; font-weight: 300; font-size: 1.25rem; + color: var(--body-quiet-color); } h2 { @@ -165,7 +163,7 @@ h2.subhead { h3 { font-size: 0.875rem; margin: .8em 0 .3em 0; - color: var(--body-medium-color); + color: var(--body-quiet-color); font-weight: bold; } @@ -173,7 +171,6 @@ h4 { font-size: 0.75rem; margin: 1em 0 .8em 0; padding-bottom: 3px; - color: var(--body-medium-color); } h5 { @@ -220,10 +217,6 @@ fieldset { border-top: 1px solid var(--hairline-color); } -details summary { - cursor: pointer; -} - blockquote { font-size: 0.6875rem; color: #777; @@ -320,7 +313,7 @@ td, th { } th { - font-weight: 500; + font-weight: 600; text-align: left; } @@ -341,7 +334,7 @@ tfoot td { } thead th.required { - font-weight: bold; + color: var(--body-loud-color); } tr.alt { @@ -489,13 +482,8 @@ textarea { vertical-align: top; } -/* -Minifiers remove the default (text) "type" attribute from "input" HTML tags. -Add input:not([type]) to make the CSS stylesheet work the same. -*/ -input:not([type]), input[type=text], input[type=password], input[type=email], -input[type=url], input[type=number], input[type=tel], textarea, select, -.vTextField { +input[type=text], input[type=password], input[type=email], input[type=url], +input[type=number], input[type=tel], textarea, select, .vTextField { border: 1px solid var(--border-color); border-radius: 4px; padding: 5px 6px; @@ -504,13 +492,9 @@ input[type=url], input[type=number], input[type=tel], textarea, select, background-color: var(--body-bg); } -/* -Minifiers remove the default (text) "type" attribute from "input" HTML tags. -Add input:not([type]) to make the CSS stylesheet work the same. -*/ -input:not([type]):focus, input[type=text]:focus, input[type=password]:focus, -input[type=email]:focus, input[type=url]:focus, input[type=number]:focus, -input[type=tel]:focus, textarea:focus, select:focus, .vTextField:focus { +input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, +input[type=url]:focus, input[type=number]:focus, input[type=tel]:focus, +textarea:focus, select:focus, .vTextField:focus { border-color: var(--body-quiet-color); } @@ -894,10 +878,9 @@ a.deletelink:focus, a.deletelink:hover { margin-right: -300px; } -@media (forced-colors: active) { - #content-related { - border: 1px solid; - } +#footer { + clear: both; + padding: 10px; } /* COLUMN TYPES */ @@ -945,12 +928,6 @@ a.deletelink:focus, a.deletelink:hover { text-decoration: underline; } -@media (forced-colors: active) { - #header { - border-bottom: 1px solid; - } -} - #branding { display: flex; } diff --git a/src/staticfiles/admin/css/changelists.css b/src/staticfiles/admin/css/changelists.css index 005b776..573c389 100644 --- a/src/staticfiles/admin/css/changelists.css +++ b/src/staticfiles/admin/css/changelists.css @@ -139,12 +139,6 @@ margin: 0 0 0 30px; } -@media (forced-colors: active) { - #changelist-filter { - border: 1px solid; - } -} - #changelist-filter h2 { font-size: 0.875rem; text-transform: uppercase; @@ -159,6 +153,7 @@ font-weight: 400; padding: 0 15px; margin-bottom: 10px; + cursor: pointer; } #changelist-filter details summary > * { diff --git a/src/staticfiles/admin/css/dark_mode.css b/src/staticfiles/admin/css/dark_mode.css index 7e12a81..c49b6bc 100644 --- a/src/staticfiles/admin/css/dark_mode.css +++ b/src/staticfiles/admin/css/dark_mode.css @@ -5,8 +5,7 @@ --body-fg: #eeeeee; --body-bg: #121212; - --body-quiet-color: #d0d0d0; - --body-medium-color: #e0e0e0; + --body-quiet-color: #e0e0e0; --body-loud-color: #ffffff; --breadcrumbs-link-fg: #e0e0e0; @@ -30,8 +29,6 @@ --close-button-bg: #333333; --close-button-hover-bg: #666666; - - color-scheme: dark; } } @@ -42,8 +39,7 @@ html[data-theme="dark"] { --body-fg: #eeeeee; --body-bg: #121212; - --body-quiet-color: #d0d0d0; - --body-medium-color: #e0e0e0; + --body-quiet-color: #e0e0e0; --body-loud-color: #ffffff; --breadcrumbs-link-fg: #e0e0e0; @@ -67,8 +63,6 @@ html[data-theme="dark"] { --close-button-bg: #333333; --close-button-hover-bg: #666666; - - color-scheme: dark; } /* THEME SWITCH */ diff --git a/src/staticfiles/admin/css/forms.css b/src/staticfiles/admin/css/forms.css index 4f49b61..9a8dad0 100644 --- a/src/staticfiles/admin/css/forms.css +++ b/src/staticfiles/admin/css/forms.css @@ -44,6 +44,7 @@ label { .required label, label.required { font-weight: bold; + color: var(--body-fg); } /* RADIO BUTTONS */ @@ -75,20 +76,6 @@ form ul.inline li { padding-right: 7px; } -/* FIELDSETS */ - -fieldset .fieldset-heading, -fieldset .inline-heading, -:not(.inline-related) .collapse summary { - border: 1px solid var(--header-bg); - margin: 0; - padding: 8px; - font-weight: 400; - font-size: 0.8125rem; - background: var(--header-bg); - color: var(--header-link-color); -} - /* ALIGNED FIELDSETS */ .aligned label { @@ -97,12 +84,14 @@ fieldset .inline-heading, min-width: 160px; width: 160px; word-wrap: break-word; + line-height: 1; } .aligned label:not(.vCheckboxLabel):after { content: ''; display: inline-block; vertical-align: middle; + height: 1.625rem; } .aligned label + p, .aligned .checkbox-row + div.help, .aligned label + div.readonly { @@ -169,10 +158,6 @@ form .aligned select + div.help { padding-left: 10px; } -form .aligned select option:checked { - background-color: var(--selected-row); -} - form .aligned ul li { list-style: none; } @@ -183,7 +168,11 @@ form .aligned table p { } .aligned .vCheckboxLabel { - padding: 1px 0 0 5px; + float: none; + width: auto; + display: inline-block; + vertical-align: -3px; + padding: 0 0 5px 5px; } .aligned .vCheckboxLabel + p.help, @@ -205,8 +194,14 @@ fieldset .fieldBox { width: 200px; } -form .wide p.help, +form .wide p, form .wide ul.errorlist, +form .wide input + p.help, +form .wide input + div.help { + margin-left: 200px; +} + +form .wide p.help, form .wide div.help { padding-left: 50px; } @@ -220,16 +215,35 @@ form div.help ul { width: 450px; } -/* COLLAPSIBLE FIELDSETS */ +/* COLLAPSED FIELDSETS */ + +fieldset.collapsed * { + display: none; +} + +fieldset.collapsed h2, fieldset.collapsed { + display: block; +} + +fieldset.collapsed { + border: 1px solid var(--hairline-color); + border-radius: 4px; + overflow: hidden; +} + +fieldset.collapsed h2 { + background: var(--darkened-bg); + color: var(--body-quiet-color); +} + +fieldset .collapse-toggle { + color: var(--header-link-color); +} -.collapse summary .fieldset-heading, -.collapse summary .inline-heading { +fieldset.collapsed .collapse-toggle { background: transparent; - border: none; - color: currentColor; display: inline; - margin: 0; - padding: 0; + color: var(--link-fg); } /* MONOSPACE TEXTAREAS */ @@ -381,16 +395,14 @@ body.popup .submit-row { position: relative; } -.inline-related h4, -.inline-related:not(.tabular) .collapse summary { +.inline-related h3 { margin: 0; - color: var(--body-medium-color); + color: var(--body-quiet-color); padding: 5px; font-size: 0.8125rem; background: var(--darkened-bg); - border: 1px solid var(--hairline-color); - border-left-color: var(--darkened-bg); - border-right-color: var(--darkened-bg); + border-top: 1px solid var(--hairline-color); + border-bottom: 1px solid var(--hairline-color); } .inline-related h3 span.delete { @@ -409,6 +421,16 @@ body.popup .submit-row { width: 100%; } +.inline-related fieldset.module h3 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 0.6875rem; + text-align: left; + font-weight: bold; + background: #bcd; + color: var(--body-bg); +} + .inline-group .tabular fieldset.module { border: none; } diff --git a/src/staticfiles/admin/css/login.css b/src/staticfiles/admin/css/login.css index 805a34b..389772f 100644 --- a/src/staticfiles/admin/css/login.css +++ b/src/staticfiles/admin/css/login.css @@ -21,7 +21,7 @@ } .login #content { - padding: 20px; + padding: 20px 20px 0; } .login #container { diff --git a/src/staticfiles/admin/css/responsive.css b/src/staticfiles/admin/css/responsive.css index 932e824..bb53945 100644 --- a/src/staticfiles/admin/css/responsive.css +++ b/src/staticfiles/admin/css/responsive.css @@ -171,14 +171,9 @@ input[type="submit"], button { /* Forms */ label { - font-size: 1rem; + font-size: 0.875rem; } - /* - Minifiers remove the default (text) "type" attribute from "input" HTML - tags. Add input:not([type]) to make the CSS stylesheet work the same. - */ - .form-row input:not([type]), .form-row input[type=text], .form-row input[type=password], .form-row input[type=email], @@ -192,7 +187,7 @@ input[type="submit"], button { margin: 0; padding: 6px 8px; min-height: 2.25rem; - font-size: 1rem; + font-size: 0.875rem; } .form-row select { @@ -451,10 +446,14 @@ input[type="submit"], button { @media (max-width: 767px) { /* Layout */ - #header, #content { + #header, #content, #footer { padding: 15px; } + #footer:empty { + padding: 0; + } + div.breadcrumbs { padding: 10px 15px; } @@ -565,6 +564,10 @@ input[type="submit"], button { padding-top: 15px; } + fieldset.collapsed .form-row { + display: none; + } + .aligned label { width: 100%; min-width: auto; diff --git a/src/staticfiles/admin/css/responsive_rtl.css b/src/staticfiles/admin/css/responsive_rtl.css index 33b5784..31dc8ff 100644 --- a/src/staticfiles/admin/css/responsive_rtl.css +++ b/src/staticfiles/admin/css/responsive_rtl.css @@ -35,6 +35,11 @@ background-position: calc(100% - 8px) 9px; } + [dir="rtl"] .related-widget-wrapper-link + .selector { + margin-right: 0; + margin-left: 15px; + } + [dir="rtl"] .selector .selector-filter label { margin-right: 0; margin-left: 8px; @@ -53,22 +58,6 @@ padding-left: 0; padding-right: 16px; } - - [dir="rtl"] .selector-add { - background-position: 0 -80px; - } - - [dir="rtl"] .selector-remove { - background-position: 0 -120px; - } - - [dir="rtl"] .active.selector-add:focus, .active.selector-add:hover { - background-position: 0 -100px; - } - - [dir="rtl"] .active.selector-remove:focus, .active.selector-remove:hover { - background-position: 0 -140px; - } } /* MOBILE */ @@ -92,20 +81,4 @@ [dir="rtl"] .aligned .vCheckboxLabel { padding: 1px 5px 0 0; } - - [dir="rtl"] .selector-remove { - background-position: 0 0; - } - - [dir="rtl"] .active.selector-remove:focus, .active.selector-remove:hover { - background-position: 0 -20px; - } - - [dir="rtl"] .selector-add { - background-position: 0 -40px; - } - - [dir="rtl"] .active.selector-add:focus, .active.selector-add:hover { - background-position: 0 -60px; - } } diff --git a/src/staticfiles/admin/css/rtl.css b/src/staticfiles/admin/css/rtl.css index b8f60e0..9027c7e 100644 --- a/src/staticfiles/admin/css/rtl.css +++ b/src/staticfiles/admin/css/rtl.css @@ -151,7 +151,6 @@ form ul.inline li { form .aligned p.help, form .aligned div.help { - margin-left: 0; margin-right: 160px; padding-right: 10px; } @@ -165,13 +164,19 @@ form .aligned p.time div.help.timezonewarning { padding-right: 0; } -form .wide p.help, -form .wide ul.errorlist, -form .wide div.help { +form .wide p.help, form .wide div.help { padding-left: 0; padding-right: 50px; } +form .wide p, +form .wide ul.errorlist, +form .wide input + p.help, +form .wide input + div.help { + margin-right: 200px; + margin-left: 0px; +} + .submit-row { text-align: right; } @@ -197,7 +202,12 @@ fieldset .fieldBox { top: 0; left: auto; right: 10px; - background: url(../img/calendar-icons.svg) 0 -15px no-repeat; + background: url(../img/calendar-icons.svg) 0 -30px no-repeat; +} + +.calendarbox .calendarnav-previous:focus, +.calendarbox .calendarnav-previous:hover { + background-position: 0 -45px; } .calendarnav-next { @@ -207,6 +217,11 @@ fieldset .fieldBox { background: url(../img/calendar-icons.svg) 0 0 no-repeat; } +.calendarbox .calendarnav-next:focus, +.calendarbox .calendarnav-next:hover { + background-position: 0 -15px; +} + .calendar caption, .calendarbox h2 { text-align: center; } @@ -282,10 +297,6 @@ form .form-row p.datetime { margin-right: 2px; } -.inline-group .tabular td.original p { - right: 0; -} - .selector .selector-chooser { margin: 0; } diff --git a/src/staticfiles/admin/css/widgets.css b/src/staticfiles/admin/css/widgets.css index cc64811..d3d4732 100644 --- a/src/staticfiles/admin/css/widgets.css +++ b/src/staticfiles/admin/css/widgets.css @@ -519,9 +519,19 @@ span.clearable-file-input label { background: url(../img/calendar-icons.svg) 0 0 no-repeat; } +.calendarbox .calendarnav-previous:focus, +.calendarbox .calendarnav-previous:hover { + background-position: 0 -15px; +} + .calendarnav-next { right: 10px; - background: url(../img/calendar-icons.svg) 0 -15px no-repeat; + background: url(../img/calendar-icons.svg) 0 -30px no-repeat; +} + +.calendarbox .calendarnav-next:focus, +.calendarbox .calendarnav-next:hover { + background-position: 0 -45px; } .calendar-cancel { diff --git a/src/staticfiles/admin/img/README.txt b/src/staticfiles/admin/img/README.txt index bf81f35..4eb2e49 100644 --- a/src/staticfiles/admin/img/README.txt +++ b/src/staticfiles/admin/img/README.txt @@ -1,4 +1,4 @@ -All icons are taken from Font Awesome (https://fontawesome.com/) project. +All icons are taken from Font Awesome (http://fontawesome.io/) project. The Font Awesome font is licensed under the SIL OFL 1.1: - https://scripts.sil.org/OFL diff --git a/src/staticfiles/admin/img/calendar-icons.svg b/src/staticfiles/admin/img/calendar-icons.svg index 04c0274..dbf21c3 100644 --- a/src/staticfiles/admin/img/calendar-icons.svg +++ b/src/staticfiles/admin/img/calendar-icons.svg @@ -1,63 +1,14 @@ - - - - - - + + + + - - + + - - + + + + diff --git a/src/staticfiles/admin/img/icon-addlink.svg b/src/staticfiles/admin/img/icon-addlink.svg index 8d5c6a3..e004fb1 100644 --- a/src/staticfiles/admin/img/icon-addlink.svg +++ b/src/staticfiles/admin/img/icon-addlink.svg @@ -1,3 +1,3 @@ - + diff --git a/src/staticfiles/admin/img/icon-changelink.svg b/src/staticfiles/admin/img/icon-changelink.svg index 592b093..bbb137a 100644 --- a/src/staticfiles/admin/img/icon-changelink.svg +++ b/src/staticfiles/admin/img/icon-changelink.svg @@ -1,3 +1,3 @@ - + diff --git a/src/staticfiles/admin/js/SelectFilter2.js b/src/staticfiles/admin/js/SelectFilter2.js index 6957412..fc59eba 100644 --- a/src/staticfiles/admin/js/SelectFilter2.js +++ b/src/staticfiles/admin/js/SelectFilter2.js @@ -1,4 +1,4 @@ -/*global SelectBox, gettext, ngettext, interpolate, quickElement, SelectFilter*/ +/*global SelectBox, gettext, interpolate, quickElement, SelectFilter*/ /* SelectFilter2 - Turns a multiple-select box into a filter interface. diff --git a/src/staticfiles/admin/js/actions.js b/src/staticfiles/admin/js/actions.js index 04b25e9..6a2ae91 100644 --- a/src/staticfiles/admin/js/actions.js +++ b/src/staticfiles/admin/js/actions.js @@ -1,4 +1,4 @@ -/*global gettext, interpolate, ngettext, Actions*/ +/*global gettext, interpolate, ngettext*/ 'use strict'; { function show(selector) { diff --git a/src/staticfiles/admin/js/admin/RelatedObjectLookups.js b/src/staticfiles/admin/js/admin/RelatedObjectLookups.js index bc3acce..32e3f5b 100644 --- a/src/staticfiles/admin/js/admin/RelatedObjectLookups.js +++ b/src/staticfiles/admin/js/admin/RelatedObjectLookups.js @@ -96,8 +96,8 @@ // Extract the model from the popup url '...//add/' or // '...///change/' depending the action (add or change). const modelName = path.split('/')[path.split('/').length - (objId ? 4 : 3)]; - // Select elements with a specific model reference and context of "available-source". - const selectsRelated = document.querySelectorAll(`[data-model-ref="${modelName}"] [data-context="available-source"]`); + // Exclude autocomplete selects. + const selectsRelated = document.querySelectorAll(`[data-model-ref="${modelName}"] select:not(.admin-autocomplete)`); selectsRelated.forEach(function(select) { if (currentSelect === select) { diff --git a/src/staticfiles/admin/js/popup_response.js b/src/staticfiles/admin/js/popup_response.js index fecf0f4..2b1d3dd 100644 --- a/src/staticfiles/admin/js/popup_response.js +++ b/src/staticfiles/admin/js/popup_response.js @@ -1,3 +1,4 @@ +/*global opener */ 'use strict'; { const initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); diff --git a/src/staticfiles/admin/js/theme.js b/src/staticfiles/admin/js/theme.js index e79d375..794cd15 100644 --- a/src/staticfiles/admin/js/theme.js +++ b/src/staticfiles/admin/js/theme.js @@ -1,51 +1,56 @@ 'use strict'; { - function setTheme(mode) { - if (mode !== "light" && mode !== "dark" && mode !== "auto") { - console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`); - mode = "auto"; + window.addEventListener('load', function(e) { + + function setTheme(mode) { + if (mode !== "light" && mode !== "dark" && mode !== "auto") { + console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`); + mode = "auto"; + } + document.documentElement.dataset.theme = mode; + localStorage.setItem("theme", mode); } - document.documentElement.dataset.theme = mode; - localStorage.setItem("theme", mode); - } - function cycleTheme() { - const currentTheme = localStorage.getItem("theme") || "auto"; - const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; + function cycleTheme() { + const currentTheme = localStorage.getItem("theme") || "auto"; + const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; - if (prefersDark) { - // Auto (dark) -> Light -> Dark - if (currentTheme === "auto") { - setTheme("light"); - } else if (currentTheme === "light") { - setTheme("dark"); - } else { - setTheme("auto"); - } - } else { - // Auto (light) -> Dark -> Light - if (currentTheme === "auto") { - setTheme("dark"); - } else if (currentTheme === "dark") { - setTheme("light"); + if (prefersDark) { + // Auto (dark) -> Light -> Dark + if (currentTheme === "auto") { + setTheme("light"); + } else if (currentTheme === "light") { + setTheme("dark"); + } else { + setTheme("auto"); + } } else { - setTheme("auto"); + // Auto (light) -> Dark -> Light + if (currentTheme === "auto") { + setTheme("dark"); + } else if (currentTheme === "dark") { + setTheme("light"); + } else { + setTheme("auto"); + } } } - } - function initTheme() { - // set theme defined in localStorage if there is one, or fallback to auto mode - const currentTheme = localStorage.getItem("theme"); - currentTheme ? setTheme(currentTheme) : setTheme("auto"); - } + function initTheme() { + // set theme defined in localStorage if there is one, or fallback to auto mode + const currentTheme = localStorage.getItem("theme"); + currentTheme ? setTheme(currentTheme) : setTheme("auto"); + } - window.addEventListener('load', function(_) { - const buttons = document.getElementsByClassName("theme-toggle"); - Array.from(buttons).forEach((btn) => { - btn.addEventListener("click", cycleTheme); - }); - }); + function setupTheme() { + // Attach event handlers for toggling themes + const buttons = document.getElementsByClassName("theme-toggle"); + Array.from(buttons).forEach((btn) => { + btn.addEventListener("click", cycleTheme); + }); + initTheme(); + } - initTheme(); + setupTheme(); + }); } diff --git a/src/templates/signal_sets/signal_sets.html b/src/templates/signal_sets/signal_sets.html index 64e51b0..16717ae 100644 --- a/src/templates/signal_sets/signal_sets.html +++ b/src/templates/signal_sets/signal_sets.html @@ -567,7 +567,11 @@

{{ signal_set.geographic_scope }} - {{ signal_set.get_available_geographies }} + {% for available_geography in signal_set.get_available_geographies %} + + {{ available_geography }} + + {% endfor %} {{ signal_set.temporal_scope_start }} @@ -576,7 +580,9 @@

{{ signal_set.temporal_scope_end }} - {{ signal_set.temporal_granularity }} + + {{ signal_set.temporal_granularity }} + {{ signal_set.reporting_cadence }} @@ -738,6 +744,7 @@

const geoValues = {{ geographic_granularities|safe }}; var relatedSignals = JSON.parse(JSON.stringify({{ related_signals|safe }})); + console.log(relatedSignals.length) var urlParams = JSON.parse(JSON.stringify({{ url_params_dict|safe }})); @@ -758,7 +765,7 @@ initSelect2('geographic_value', geoValues); table.columns.adjust() - $("#totalRowsNumber").text(`Showing ${table.page.info().recordsTotal} Indicator ${pluralize(table.page.info().recordsTotal, 'Set')}`); + $("#totalRowsNumber").text(`Showing ${table.page.info().recordsTotal} indicator ${pluralize(table.page.info().recordsTotal, 'set')} containing ${relatedSignals.length} individual ${pluralize(relatedSignals.length, 'indicator')}`) }) // Add event listener for opening and closing details