Skip to content

Added grey ovals to display geo granularity and temporal granularity.… #137

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 1 commit into from
Mar 12, 2025
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
4 changes: 2 additions & 2 deletions src/fixtures/severity_pyramid_rungs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/signal_sets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
6 changes: 3 additions & 3 deletions src/signal_sets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"] = [
Expand Down
1 change: 1 addition & 0 deletions src/signals/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class SeverityPyramidRungAdmin(admin.ModelAdmin):
"display_name",
"used_in",
)
exclude = ("id",)
search_fields: tuple[Literal["name"]] = ("name",)


Expand Down
4 changes: 0 additions & 4 deletions src/staticfiles/admin/css/autocomplete.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,3 @@ select.admin-autocomplete {
display: block;
padding: 6px;
}

.errors .select2-selection {
border: 1px solid var(--error-fg);
}
47 changes: 12 additions & 35 deletions src/staticfiles/admin/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,8 +84,6 @@ html[data-theme="light"],
"Segoe UI Emoji",
"Segoe UI Symbol",
"Noto Color Emoji";

color-scheme: light;
}

html, body {
Expand Down Expand Up @@ -150,6 +147,7 @@ h1 {
margin: 0 0 20px;
font-weight: 300;
font-size: 1.25rem;
color: var(--body-quiet-color);
}

h2 {
Expand All @@ -165,15 +163,14 @@ 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;
}

h4 {
font-size: 0.75rem;
margin: 1em 0 .8em 0;
padding-bottom: 3px;
color: var(--body-medium-color);
}

h5 {
Expand Down Expand Up @@ -220,10 +217,6 @@ fieldset {
border-top: 1px solid var(--hairline-color);
}

details summary {
cursor: pointer;
}

blockquote {
font-size: 0.6875rem;
color: #777;
Expand Down Expand Up @@ -320,7 +313,7 @@ td, th {
}

th {
font-weight: 500;
font-weight: 600;
text-align: left;
}

Expand All @@ -341,7 +334,7 @@ tfoot td {
}

thead th.required {
font-weight: bold;
color: var(--body-loud-color);
}

tr.alt {
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}
Expand Down
7 changes: 1 addition & 6 deletions src/staticfiles/admin/css/changelists.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -159,6 +153,7 @@
font-weight: 400;
padding: 0 15px;
margin-bottom: 10px;
cursor: pointer;
}

#changelist-filter details summary > * {
Expand Down
10 changes: 2 additions & 8 deletions src/staticfiles/admin/css/dark_mode.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,8 +29,6 @@

--close-button-bg: #333333;
--close-button-hover-bg: #666666;

color-scheme: dark;
}
}

Expand All @@ -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;
Expand All @@ -67,8 +63,6 @@ html[data-theme="dark"] {

--close-button-bg: #333333;
--close-button-hover-bg: #666666;

color-scheme: dark;
}

/* THEME SWITCH */
Expand Down
Loading
Loading