mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-28 18:22:05 +00:00
Replace pages' use of the options call with directly building the HTML components using templates, as the syntax is much nicer. Use a common set of data provided to all modules via pagetemplate.py instead of passing things like web_ui_options around. Closes #153
This commit is contained in:
+24
-18
@@ -6,44 +6,46 @@
|
||||
<div class="col-auto me-auto pt-3"></div>
|
||||
<div class="col-auto">
|
||||
<div class="d-inline-flex gap-1">
|
||||
{% module Template("widgets/filters_display_data_buttons.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("widgets/filters_display_data_buttons.html") %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="filters-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/filters_area_header.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("widgets/filters_area_header.html") %}
|
||||
<div class="card-body">
|
||||
<div class="row row-cols-1 g-4 mb-4 row-cols-md-3">
|
||||
<div class="col">
|
||||
{% module Template("cards/bands.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/bands.html") %}
|
||||
<div class="mt-4"></div>
|
||||
{% module Template("cards/dx_continent.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/dx_continent.html") %}
|
||||
<div class="mt-4"></div>
|
||||
{% module Template("cards/de_continent.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/de_continent.html") %}
|
||||
</div>
|
||||
<div class="col">
|
||||
{% module Template("cards/activities.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/activities.html",
|
||||
activities=options["activities"], include_general_dx=True) %}
|
||||
</div>
|
||||
<div class="col">
|
||||
{% module Template("cards/sources.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/sources.html",
|
||||
sources=options["spot_providers"],
|
||||
sources_enabled_by_default=options["spot_providers_enabled_by_default"]) %}
|
||||
<div class="mt-4"></div>
|
||||
{% module Template("cards/modes.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/modes.html") %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="display-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/display_area_header.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("widgets/display_area_header.html") %}
|
||||
<div class="card-body">
|
||||
<div id="display-container" class="row row-cols-1 row-cols-md-4 g-4">
|
||||
<div class="col">
|
||||
{% module Template("cards/spot_age.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/spot_age.html") %}
|
||||
</div>
|
||||
<div class="col">
|
||||
{% module Template("cards/color_scheme_and_band_color_scheme.html", web_ui_options=web_ui_options)
|
||||
%}
|
||||
{% module Template("cards/color_scheme_and_band_color_scheme.html") %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,21 +53,21 @@
|
||||
|
||||
{% if web_ui_options["qrz_enabled"] or web_ui_options["hamqth_enabled"] %}
|
||||
<div id="data-area" class="appearing-panel card mb-3">
|
||||
{% module Template("widgets/your_data_area_header.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("widgets/your_data_area_header.html") %}
|
||||
<div class="card-body">
|
||||
<div class="row row-cols-1 row-cols-md-4 g-4">
|
||||
{% if web_ui_options["qrz_enabled"] %}
|
||||
<div class="col">
|
||||
{% module Template("cards/qrz.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/qrz.html") %}
|
||||
</div>
|
||||
{% end %}
|
||||
{% if web_ui_options["hamqth_enabled"] %}
|
||||
<div class="col">
|
||||
{% module Template("cards/hamqth.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/hamqth.html") %}
|
||||
</div>
|
||||
{% end %}
|
||||
<div class="col">
|
||||
{% module Template("cards/wanted_calls.html", web_ui_options=web_ui_options) %}
|
||||
{% module Template("cards/wanted_calls.html") %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,8 +78,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1790344336"></script>
|
||||
<script src="/static/js/bands.js?v=1790344336"></script>
|
||||
<script>
|
||||
const BANDS = {% raw safe_json_dumps(options["bands"]) %};
|
||||
</script>
|
||||
|
||||
<script src="/static/js/spotsbandsandmap.js?v=1790367752"></script>
|
||||
<script src="/static/js/bands.js?v=1790367752"></script>
|
||||
<script>$(document).ready(function () {
|
||||
$("#nav-link-bands").addClass("active");
|
||||
}); <!-- highlight active page in nav --></script>
|
||||
|
||||
Reference in New Issue
Block a user