From 47b4ddb5c8c8fa8b7628485284754b69af2f6b5b Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sat, 31 Jan 2026 08:52:28 +0000 Subject: [PATCH] Reduce duplication in HTML pages with includes. Closes #103 --- templates/alerts.html | 139 +------------ templates/bands.html | 114 ++--------- templates/cards/bands.html | 6 + .../color-scheme-and-band-color-scheme.html | 11 + templates/cards/color-scheme.html | 8 + templates/cards/de-continent.html | 6 + templates/cards/duration-limit-alerts.html | 19 ++ templates/cards/dx-continent.html | 6 + templates/cards/location.html | 9 + templates/cards/map-features.html | 11 + templates/cards/modes.html | 6 + templates/cards/number-of-alerts.html | 13 ++ templates/cards/number-of-spots.html | 13 ++ templates/cards/sigs.html | 6 + templates/cards/sources.html | 6 + templates/cards/spot-age.html | 13 ++ templates/cards/table-columns-alerts.html | 35 ++++ templates/cards/table-columns-spots.html | 43 ++++ templates/cards/time-zone.html | 11 + templates/map.html | 124 ++---------- templates/spots.html | 191 ++---------------- templates/widgets/band-color-scheme.html | 13 ++ templates/widgets/color-scheme.html | 6 + templates/widgets/display-area-header.html | 10 + templates/widgets/filters-area-header.html | 10 + .../widgets/filters-display-buttons.html | 2 + templates/widgets/refresh-timer.html | 1 + templates/widgets/run-pause.html | 7 + templates/widgets/search.html | 4 + 29 files changed, 326 insertions(+), 517 deletions(-) create mode 100644 templates/cards/bands.html create mode 100644 templates/cards/color-scheme-and-band-color-scheme.html create mode 100644 templates/cards/color-scheme.html create mode 100644 templates/cards/de-continent.html create mode 100644 templates/cards/duration-limit-alerts.html create mode 100644 templates/cards/dx-continent.html create mode 100644 templates/cards/location.html create mode 100644 templates/cards/map-features.html create mode 100644 templates/cards/modes.html create mode 100644 templates/cards/number-of-alerts.html create mode 100644 templates/cards/number-of-spots.html create mode 100644 templates/cards/sigs.html create mode 100644 templates/cards/sources.html create mode 100644 templates/cards/spot-age.html create mode 100644 templates/cards/table-columns-alerts.html create mode 100644 templates/cards/table-columns-spots.html create mode 100644 templates/cards/time-zone.html create mode 100644 templates/widgets/band-color-scheme.html create mode 100644 templates/widgets/color-scheme.html create mode 100644 templates/widgets/display-area-header.html create mode 100644 templates/widgets/filters-area-header.html create mode 100644 templates/widgets/filters-display-buttons.html create mode 100644 templates/widgets/refresh-timer.html create mode 100644 templates/widgets/run-pause.html create mode 100644 templates/widgets/search.html diff --git a/templates/alerts.html b/templates/alerts.html index 5295f56..6505fe5 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -4,164 +4,47 @@
-

Loading...

+ {% module Template("widgets/refresh-timer.html", web_ui_options=web_ui_options) %}

- - + {% module Template("widgets/filters-display-buttons.html", web_ui_options=web_ui_options) %}

-
-
-
- Filters -
-
- -
-
- -
+ {% module Template("widgets/filters-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
DX Continent
-

-
-
+ {% module Template("cards/dx-continent.html", web_ui_options=web_ui_options) %}
-
-
-
Sources
-

-
-
+ {% module Template("cards/sources.html", web_ui_options=web_ui_options) %}
-
-
-
Duration Limit
-

- Hide any alerts lasting more than:
- -

-

- -

-
-
+ {% module Template("cards/duration-limit-alerts.html", web_ui_options=web_ui_options) %}
-
-
-
- Display -
-
- -
-
- -
+ {% module Template("widgets/display-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Time Zone
-

Use - -

-
-
+ {% module Template("cards/time-zone.html", web_ui_options=web_ui_options) %}
-
-
-
Number of Alerts
-

Show up to - - alerts -

-
-
+ {% module Template("cards/number-of-alerts.html", web_ui_options=web_ui_options) %}
-
-
-
Theme
-

- - -

-
-
+ {% module Template("cards/color-scheme.html", web_ui_options=web_ui_options) %}
-
-
-
Table Data
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
+ {% module Template("cards/table-columns-alerts.html", web_ui_options=web_ui_options) %}
diff --git a/templates/bands.html b/templates/bands.html index c805e1e..e275029 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -4,142 +4,52 @@
-

Loading...

+ {% module Template("widgets/refresh-timer.html", web_ui_options=web_ui_options) %}

- - + {% module Template("widgets/filters-display-buttons.html", web_ui_options=web_ui_options) %}

-
-
-
- Filters -
-
- -
-
- -
+ {% module Template("widgets/filters-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Bands
-

-
-
+ {% module Template("cards/bands.html", web_ui_options=web_ui_options) %}
-
-
-
SIGs
-

-
-
+ {% module Template("cards/sigs.html", web_ui_options=web_ui_options) %}
-
-
-
Sources
-

-
-
+ {% module Template("cards/sources.html", web_ui_options=web_ui_options) %}
-
-
-
DX Continent
-

-
-
+ {% module Template("cards/dx-continent.html", web_ui_options=web_ui_options) %}
-
-
-
DE Continent
-

-
-
+ {% module Template("cards/de-continent.html", web_ui_options=web_ui_options) %}
-
-
-
Modes
-

-
-
+ {% module Template("cards/modes.html", web_ui_options=web_ui_options) %}
-
-
-
- Display -
-
- -
-
- -
+ {% module Template("widgets/display-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Spot Age
-

Last - - minutes -

-
-
+ {% module Template("cards/spot-age.html", web_ui_options=web_ui_options) %}
-
-
-
Theme
-

- - -

-

-
- -

-
-
+ {% module Template("cards/color-scheme-and-band-color-scheme.html", web_ui_options=web_ui_options) %}
diff --git a/templates/cards/bands.html b/templates/cards/bands.html new file mode 100644 index 0000000..ea3ed1f --- /dev/null +++ b/templates/cards/bands.html @@ -0,0 +1,6 @@ +
+
+
Bands
+

+
+
\ No newline at end of file diff --git a/templates/cards/color-scheme-and-band-color-scheme.html b/templates/cards/color-scheme-and-band-color-scheme.html new file mode 100644 index 0000000..b718ef9 --- /dev/null +++ b/templates/cards/color-scheme-and-band-color-scheme.html @@ -0,0 +1,11 @@ +
+
+
Theme
+

+ {% module Template("widgets/color-scheme.html", web_ui_options=web_ui_options) %} +

+

+ {% module Template("widgets/band-color-scheme.html", web_ui_options=web_ui_options) %} +

+
+
\ No newline at end of file diff --git a/templates/cards/color-scheme.html b/templates/cards/color-scheme.html new file mode 100644 index 0000000..45f7e7d --- /dev/null +++ b/templates/cards/color-scheme.html @@ -0,0 +1,8 @@ +
+
+
Theme
+

+ {% module Template("widgets/color-scheme.html", web_ui_options=web_ui_options) %} +

+
+
\ No newline at end of file diff --git a/templates/cards/de-continent.html b/templates/cards/de-continent.html new file mode 100644 index 0000000..c22e8ca --- /dev/null +++ b/templates/cards/de-continent.html @@ -0,0 +1,6 @@ +
+
+
DE Continent
+

+
+
\ No newline at end of file diff --git a/templates/cards/duration-limit-alerts.html b/templates/cards/duration-limit-alerts.html new file mode 100644 index 0000000..54a4a5c --- /dev/null +++ b/templates/cards/duration-limit-alerts.html @@ -0,0 +1,19 @@ +
+
+
Duration Limit
+

+ Hide any alerts lasting more than:
+ +

+

+ +

+
+
\ No newline at end of file diff --git a/templates/cards/dx-continent.html b/templates/cards/dx-continent.html new file mode 100644 index 0000000..a721c71 --- /dev/null +++ b/templates/cards/dx-continent.html @@ -0,0 +1,6 @@ +
+
+
DX Continent
+

+
+
\ No newline at end of file diff --git a/templates/cards/location.html b/templates/cards/location.html new file mode 100644 index 0000000..2e074f6 --- /dev/null +++ b/templates/cards/location.html @@ -0,0 +1,9 @@ +
+
+
Location
+
+ + +
+
+
\ No newline at end of file diff --git a/templates/cards/map-features.html b/templates/cards/map-features.html new file mode 100644 index 0000000..43ebbb2 --- /dev/null +++ b/templates/cards/map-features.html @@ -0,0 +1,11 @@ +
+
+
Map Features
+
+
+ + +
+
+
+
\ No newline at end of file diff --git a/templates/cards/modes.html b/templates/cards/modes.html new file mode 100644 index 0000000..dc2cc75 --- /dev/null +++ b/templates/cards/modes.html @@ -0,0 +1,6 @@ +
+
+
Modes
+

+
+
\ No newline at end of file diff --git a/templates/cards/number-of-alerts.html b/templates/cards/number-of-alerts.html new file mode 100644 index 0000000..67c13fb --- /dev/null +++ b/templates/cards/number-of-alerts.html @@ -0,0 +1,13 @@ +
+
+
Number of Alerts
+

Show up to + + alerts +

+
+
\ No newline at end of file diff --git a/templates/cards/number-of-spots.html b/templates/cards/number-of-spots.html new file mode 100644 index 0000000..cea3432 --- /dev/null +++ b/templates/cards/number-of-spots.html @@ -0,0 +1,13 @@ +
+
+
Number of Spots
+

Show up to + + spots +

+
+
\ No newline at end of file diff --git a/templates/cards/sigs.html b/templates/cards/sigs.html new file mode 100644 index 0000000..e847186 --- /dev/null +++ b/templates/cards/sigs.html @@ -0,0 +1,6 @@ +
+
+
SIGs
+

+
+
\ No newline at end of file diff --git a/templates/cards/sources.html b/templates/cards/sources.html new file mode 100644 index 0000000..5970cba --- /dev/null +++ b/templates/cards/sources.html @@ -0,0 +1,6 @@ +
+
+
Sources
+

+
+
\ No newline at end of file diff --git a/templates/cards/spot-age.html b/templates/cards/spot-age.html new file mode 100644 index 0000000..634cfc4 --- /dev/null +++ b/templates/cards/spot-age.html @@ -0,0 +1,13 @@ +
+
+
Spot Age
+

Last + + minutes +

+
+
\ No newline at end of file diff --git a/templates/cards/table-columns-alerts.html b/templates/cards/table-columns-alerts.html new file mode 100644 index 0000000..3dba2b0 --- /dev/null +++ b/templates/cards/table-columns-alerts.html @@ -0,0 +1,35 @@ +
+
+
Table Columns
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/templates/cards/table-columns-spots.html b/templates/cards/table-columns-spots.html new file mode 100644 index 0000000..1b2f42d --- /dev/null +++ b/templates/cards/table-columns-spots.html @@ -0,0 +1,43 @@ +
+
+
Table Columns
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/templates/cards/time-zone.html b/templates/cards/time-zone.html new file mode 100644 index 0000000..1317dd2 --- /dev/null +++ b/templates/cards/time-zone.html @@ -0,0 +1,11 @@ +
+
+
Time Zone
+

Use + +

+
+
\ No newline at end of file diff --git a/templates/map.html b/templates/map.html index db87dbb..11b7373 100644 --- a/templates/map.html +++ b/templates/map.html @@ -7,151 +7,51 @@

- - + {% module Template("widgets/filters-display-buttons.html", web_ui_options=web_ui_options) %}

-
-
-
- Filters -
-
- -
-
- -
+ {% module Template("widgets/filters-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Bands
-

-
-
+ {% module Template("cards/bands.html", web_ui_options=web_ui_options) %}
-
-
-
SIGs
-

-
-
+ {% module Template("cards/sigs.html", web_ui_options=web_ui_options) %}
-
-
-
Sources
-

-
-
+ {% module Template("cards/sources.html", web_ui_options=web_ui_options) %}
-
-
-
DX Continent
-

-
-
+ {% module Template("cards/dx-continent.html", web_ui_options=web_ui_options) %}
-
-
-
DE Continent
-

-
-
+ {% module Template("cards/de-continent.html", web_ui_options=web_ui_options) %}
-
-
-
Modes
-

-
-
+ {% module Template("cards/modes.html", web_ui_options=web_ui_options) %}
-
-
-
- Display -
-
- -
-
- -
+ {% module Template("widgets/display-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Spot Age
-

Last - - minutes -

-
-
+ {% module Template("cards/spot-age.html", web_ui_options=web_ui_options) %}
-
-
-
Map Features
-
-
- - -
-
-
-
+ {% module Template("cards/map-features.html", web_ui_options=web_ui_options) %}
-
-
-
Theme
-

- - -

-

-
- -

-
-
+ {% module Template("cards/color-scheme-and-band-color-scheme.html", web_ui_options=web_ui_options) %}
diff --git a/templates/spots.html b/templates/spots.html index 49e4065..c4faac9 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -12,223 +12,64 @@

- - - - - - - + {% module Template("widgets/run-pause.html", web_ui_options=web_ui_options) %} {% raw web_ui_options["support-button-html"] %}

- - - - - - + {% module Template("widgets/search.html", web_ui_options=web_ui_options) %} + {% module Template("widgets/filters-display-buttons.html", web_ui_options=web_ui_options) %}

-
-
-
- Filters -
-
- -
-
- -
+ {% module Template("widgets/filters-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Bands
-

-
-
+ {% module Template("cards/bands.html", web_ui_options=web_ui_options) %}
-
-
-
SIGs
-

-
-
+ {% module Template("cards/sigs.html", web_ui_options=web_ui_options) %}
-
-
-
Sources
-

-
-
+ {% module Template("cards/sources.html", web_ui_options=web_ui_options) %}
-
-
-
DX Continent
-

-
-
+ {% module Template("cards/dx-continent.html", web_ui_options=web_ui_options) %}
-
-
-
DE Continent
-

-
-
+ {% module Template("cards/de-continent.html", web_ui_options=web_ui_options) %}
-
-
-
Modes
-

-
-
+ {% module Template("cards/modes.html", web_ui_options=web_ui_options) %}
-
-
-
- Display -
-
- -
-
- -
+ {% module Template("widgets/display-area-header.html", web_ui_options=web_ui_options) %}
-
-
-
Time Zone
-

Use - -

-
-
+ {% module Template("cards/time-zone.html", web_ui_options=web_ui_options) %}
-
-
-
Number of Spots
-

Show up to - - spots -

-
-
+ {% module Template("cards/number-of-spots.html", web_ui_options=web_ui_options) %}
-
-
-
Location
-
- - -
-
-
+ {% module Template("cards/location.html", web_ui_options=web_ui_options) %}
-
-
-
Theme
-

- - -

-

-
- -

-
-
+ {% module Template("cards/color-scheme-and-band-color-scheme.html", web_ui_options=web_ui_options) %}
-
-
-
Table Columns
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
+ {% module Template("cards/table-columns-spots.html", web_ui_options=web_ui_options) %}
diff --git a/templates/widgets/band-color-scheme.html b/templates/widgets/band-color-scheme.html new file mode 100644 index 0000000..6e7f1d9 --- /dev/null +++ b/templates/widgets/band-color-scheme.html @@ -0,0 +1,13 @@ +
+ \ No newline at end of file diff --git a/templates/widgets/color-scheme.html b/templates/widgets/color-scheme.html new file mode 100644 index 0000000..86a817c --- /dev/null +++ b/templates/widgets/color-scheme.html @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/templates/widgets/display-area-header.html b/templates/widgets/display-area-header.html new file mode 100644 index 0000000..34dfd27 --- /dev/null +++ b/templates/widgets/display-area-header.html @@ -0,0 +1,10 @@ +
+
+
+ Display +
+
+ +
+
+
\ No newline at end of file diff --git a/templates/widgets/filters-area-header.html b/templates/widgets/filters-area-header.html new file mode 100644 index 0000000..d97d75e --- /dev/null +++ b/templates/widgets/filters-area-header.html @@ -0,0 +1,10 @@ +
+
+
+ Filters +
+
+ +
+
+
\ No newline at end of file diff --git a/templates/widgets/filters-display-buttons.html b/templates/widgets/filters-display-buttons.html new file mode 100644 index 0000000..6447657 --- /dev/null +++ b/templates/widgets/filters-display-buttons.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/templates/widgets/refresh-timer.html b/templates/widgets/refresh-timer.html new file mode 100644 index 0000000..d7b9525 --- /dev/null +++ b/templates/widgets/refresh-timer.html @@ -0,0 +1 @@ +

Loading...

\ No newline at end of file diff --git a/templates/widgets/run-pause.html b/templates/widgets/run-pause.html new file mode 100644 index 0000000..15dc25b --- /dev/null +++ b/templates/widgets/run-pause.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/templates/widgets/search.html b/templates/widgets/search.html new file mode 100644 index 0000000..81ae607 --- /dev/null +++ b/templates/widgets/search.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file