diff --git a/core/constants.py b/core/constants.py index 640ed8d..063361b 100644 --- a/core/constants.py +++ b/core/constants.py @@ -67,13 +67,6 @@ SIGS = [ ref_regex=r"(([A-Z]{2}\-\d{3})|([A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}))", icon="fa-person-hiking" ), - SIG( - name="MOTA", - comment_names=["MOTA"], - description="Mills on the Air", - ref_regex=r"X\d{4,6}", - icon="fa-fan" - ), SIG( name="ARLHS", comment_names=["ARLHS"], @@ -88,6 +81,13 @@ SIGS = [ ref_regex=r"[A-Z]{2}\d{4}", icon="fa-house-flood-water" ), + SIG( + name="MOTA", + comment_names=["MOTA"], + description="Mills on the Air", + ref_regex=r"X\d{4,6}", + icon="fa-fan" + ), SIG( name="SIOTA", comment_names=["SIOTA"], @@ -107,14 +107,16 @@ SIGS = [ comment_names=["ZLOTA"], description="New Zealand on the Air", ref_regex=r"ZL[A-Z]/[A-Z]{2}\-\d{3,4}", - icon="fa-kiwi-bird" + icon="fa-kiwi-bird", + region_flag="🇳🇿" ), SIG( name="WOTA", comment_names=["WOTA"], description="Wainwrights on the Air", ref_regex=r"[A-Z]{3}-[0-9]{2}", - icon="fa-w" + icon="fa-w", + region_flag="🇬🇧" ), SIG(name="BOTA", comment_names=[], @@ -126,14 +128,16 @@ SIGS = [ comment_names=["KRMNPA"], description="Keith Roget Memorial National Parks Award", ref_regex=r"VKFF\-\d{4}", - icon="fa-earth-oceania" + icon="fa-earth-oceania", + region_flag="🇦🇺" ), SIG( name="SANPCPA", comment_names=["SANPCPA"], description="South Australian National Parks and Conservation Parks Award", ref_regex=r"VKFF\-\d{4}", - icon="fa-earth-oceania" + icon="fa-earth-oceania", + region_flag="🇦🇺" ), SIG( name="LLOTA", @@ -161,21 +165,24 @@ SIGS = [ comment_names=["WAB"], description="Worked All Britain", ref_regex=r"[A-Z]{1,2}[0-9]{2}", - icon="fa-table-cells-large" + icon="fa-table-cells-large", + region_flag="🇬🇧" ), SIG( name="WAI", comment_names=["WAI"], description="Worked All Ireland", ref_regex=r"[A-Z][0-9]{2}", - icon="fa-table-cells-large" + icon="fa-table-cells-large", + region_flag="🇮🇪" ), SIG( name="DME", comment_names=["DME"], description="Diploma Municipios de España", ref_regex=r"\d{4,5}", - icon="fa-building" + icon="fa-building", + region_flag="🇪🇸" ), SIG( name="FEA", @@ -184,27 +191,31 @@ SIGS = [ # FEA references are technically [DE]\-\d{4}(\.\d)? but spotters always seem to miss out the D- or E- # prefix and just use FEA 1234, so we treat FEA reference IDs as if they were just the number. ref_regex=r"\d{4}(\.\d)?", - icon="fa-house-flood-water" + icon="fa-house-flood-water", + region_flag="🇪🇸" ), SIG( name="DTMBA", comment_names=["DTMBA"], description="Diploma Teatri Musei e Belle Arti", ref_regex=r"I-?[0-9]{3,4}\s?[A-Z]{2}", - icon="fa-masks-theater" + icon="fa-masks-theater", + region_flag="🇮🇹" ), SIG( name="BIWOTA", comment_names=["BIWOTA"], description="British Inland Waterways on the Air", - icon="fa-ship" + icon="fa-ship", + region_flag="🇬🇧" ), SIG( name="Toilets", comment_names=[], description="Toilets on the Air", ref_regex=r"T\-[0-9]{2}", - icon="fa-toilet" + icon="fa-toilet", + region_flag="🏴‍☠️" ), ] diff --git a/data/sig.py b/data/sig.py index aa27b3b..9ab71f1 100644 --- a/data/sig.py +++ b/data/sig.py @@ -21,3 +21,6 @@ class SIG: ref_regex: str | None = None # Icon to use in the UI when referencing this SIG. Chosen from the Font Awesome set. icon: str | None = None + # Emoji flag for the country or region where this SIG is relevant, if any. If None, this implies the SIG is in + # worldwide usage. + region_flag: str | None = None diff --git a/static/apidocs/openapi.yml b/static/apidocs/openapi.yml index 039ce9e..3571f1d 100644 --- a/static/apidocs/openapi.yml +++ b/static/apidocs/openapi.yml @@ -19,7 +19,7 @@ info: * Added DTMBA, FEA and BIWOTA SIGs * Removed the distinction between LSB & USB (both will now show as SSB) and between the various digital voice modes, which will now show as DV. - * Added `icon` to SIG information + * Added `icon` and `region_flag` to SIG information ### 2.0 @@ -1509,6 +1509,10 @@ components: type: string description: Icon from the Font Awesome set that represents this SIG, for use in the front end. example: "fa-tree" + region_flag: + type: string + description: Flag emoji, if this SIG is specific to a country or region. If null, this SIG is treated as worldwide. + example: "🇺🇳" SolarConditions: type: object diff --git a/static/js/spotsbandsandmap.js b/static/js/spotsbandsandmap.js index 62ca35d..e761ab7 100644 --- a/static/js/spotsbandsandmap.js +++ b/static/js/spotsbandsandmap.js @@ -40,14 +40,23 @@ function setHamHFBandToggles() { // Generate SIGs filter card. This one is also a special case. function generateSIGsMultiToggleFilterCard(sig_options) { - const $grid = $('
'); - sig_options.forEach(o => { + const $grid1 = $('
'); + $("#sig-options").append('Worldwide'); + sig_options.filter(o => o["region_flag"] == null).forEach(o => { const domSafeName = o["name"].replace(/^[^A-Za-z0-9]+|[^\w]+/gi, ""); - $grid.append(`
`); + $grid1.append(`
`); }); + $("#sig-options").append($grid1); + const $grid2 = $('
'); + $("#sig-options").append('Regional'); + sig_options.filter(o => o["region_flag"] != null).forEach(o => { + const domSafeName = o["name"].replace(/^[^A-Za-z0-9]+|[^\w]+/gi, ""); + $grid2.append(`
`); + }); + $("#sig-options").append($grid2); + $("#sig-options").append('Other'); // Bonus "NO_SIG" / "General DX" option - $grid.append(`
`); - $("#sig-options").append($grid); + $("#sig-options").append(`
`); $("#sig-options").append(``); } diff --git a/templates/add_spot.html b/templates/add_spot.html index b120a7b..2acfe82 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@
- + diff --git a/templates/alerts.html b/templates/alerts.html index 3987f42..faa54ff 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -84,7 +84,7 @@
- + diff --git a/templates/bands.html b/templates/bands.html index ad02136..14d32ad 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@
- - + + diff --git a/templates/base.html b/templates/base.html index fe90832..739bbfd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -15,10 +15,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index eccd375..6ddfe85 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 4e51dae..26507ae 100644 --- a/templates/map.html +++ b/templates/map.html @@ -113,8 +113,8 @@ const CARTODB_API_KEY = "{{ web_ui_options.get('cartodb_api_key', '') }}"; - - + + diff --git a/templates/spots.html b/templates/spots.html index ae63e8a..f01648b 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -113,8 +113,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index 847d4be..3a09430 100644 --- a/templates/status.html +++ b/templates/status.html @@ -86,7 +86,7 @@ - +