From f5573205e8402f35ce7ff9ff53dac96d1a17abad Mon Sep 17 00:00:00 2001 From: David Baetge Date: Sat, 23 Nov 2024 17:13:02 +0100 Subject: [PATCH] (chore) Removed prettier from page tamplates. GH-234 --- changelog.md | 1 + skins/weewx-wdc/about.html.tmpl | 4 -- skins/weewx-wdc/celestial.html.tmpl | 6 -- skins/weewx-wdc/computer-monitor.html.tmpl | 1 - .../day-archive/day-%Y-%m-%d.html.tmpl | 4 -- skins/weewx-wdc/dwd.html.tmpl | 20 ------ skins/weewx-wdc/externals.html.tmpl | 5 -- .../includes/icons/wind-direction.inc | 1 - skins/weewx-wdc/month-%Y-%m.html.tmpl | 3 - skins/weewx-wdc/month.html.tmpl | 3 - skins/weewx-wdc/offline.html.tmpl | 1 - skins/weewx-wdc/sensor-status.html.tmpl | 63 ++++++------------- skins/weewx-wdc/statistics.html.tmpl | 6 -- skins/weewx-wdc/week.html.tmpl | 3 - skins/weewx-wdc/year-%Y.html.tmpl | 4 -- skins/weewx-wdc/year.html.tmpl | 3 - skins/weewx-wdc/yesterday.html.tmpl | 2 - 17 files changed, 21 insertions(+), 109 deletions(-) diff --git a/changelog.md b/changelog.md index e9be30c7..eef4e226 100644 --- a/changelog.md +++ b/changelog.md @@ -942,3 +942,4 @@ index 465d4ad..aa8bad6 100644 - Add Moon phases and planet name translations GH-264 - Added option to only color the text in the colored temperatur stat tile GH-243 - Simplified adding of user defined modals GH-255 +- (chore) Remove prettier from *.inc and *html.tmpl files GH-234 diff --git a/skins/weewx-wdc/about.html.tmpl b/skins/weewx-wdc/about.html.tmpl index 78e97fbb..2cf2f0a6 100644 --- a/skins/weewx-wdc/about.html.tmpl +++ b/skins/weewx-wdc/about.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 @@ -169,7 +168,6 @@ aria-labelledby="tab-code" hidden > - <h4 class="bx--type-productive-heading-03">
Heading
</h4>
<h5 class="bx--type-productive-heading-02">
Subheading
</h5>
<p class="bx--type-body-long-02">
Paragraph text
</p>
<p class="bx--type-helper-text-01">
Some helper text
</p>
@@ -236,7 +234,6 @@ By default, this page is disabled in the skin.conf, simply uncomment if you want to enable it:

- # Static pages, add as many as you want. [[Static]] [[[about]]] @@ -246,7 +243,6 @@

You can add an unlimited amount of pages:

- # Static pages, add as many as you want. [[Static]] [[[about]]] diff --git a/skins/weewx-wdc/celestial.html.tmpl b/skins/weewx-wdc/celestial.html.tmpl index 4166c327..0f27a9a2 100644 --- a/skins/weewx-wdc/celestial.html.tmpl +++ b/skins/weewx-wdc/celestial.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from datetime import datetime @@ -25,10 +24,8 @@

$now

- #if $almanac.hasExtras
- #attr $labels_almanac = ["Sun", "Moon"] #for $label in $labels_almanac #set global $label_almanac = $label @@ -36,7 +33,6 @@ #end for
- #attr $labels_almanac2 = ["Venus", "Mars", "Jupiter", "Saturn"] #for $label in $labels_almanac2 #set global $label_almanac = $label @@ -44,13 +40,11 @@ #end for
- #include "includes/almanac-sun-detail-tile.inc" #include "includes/almanac-moon-detail-tile.inc"
#else
- #set global $label_almanac = $gettext("Sun") #include "includes/almanac-tile-simple.inc"
diff --git a/skins/weewx-wdc/computer-monitor.html.tmpl b/skins/weewx-wdc/computer-monitor.html.tmpl index 830b5a02..f01ac951 100644 --- a/skins/weewx-wdc/computer-monitor.html.tmpl +++ b/skins/weewx-wdc/computer-monitor.html.tmpl @@ -106,7 +106,6 @@ #set global $context = 'day'
- #for $obs in $computer_monitor_stat_tile_observations #set $binding = $get_data_binding($obs) #set $alltime_tag = $alltime($data_binding=$binding) if $context == 'alltime' else None diff --git a/skins/weewx-wdc/day-archive/day-%Y-%m-%d.html.tmpl b/skins/weewx-wdc/day-archive/day-%Y-%m-%d.html.tmpl index 5f5bd064..e2737e4c 100644 --- a/skins/weewx-wdc/day-archive/day-%Y-%m-%d.html.tmpl +++ b/skins/weewx-wdc/day-archive/day-%Y-%m-%d.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #import datetime @@ -29,9 +28,7 @@
- #if $get_day_archive_enabled() -
#set $archive_days = $get_archive_days_array($alltime.dateTime.raw, $latest.dateTime.raw, $get_time_format_dict['daily_archive']) @@ -47,7 +44,6 @@
#end if - #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/dwd.html.tmpl b/skins/weewx-wdc/dwd.html.tmpl index 45155ff6..3664918d 100644 --- a/skins/weewx-wdc/dwd.html.tmpl +++ b/skins/weewx-wdc/dwd.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #import datetime @@ -34,13 +33,11 @@
- #if $to_bool($Extras['weewx-DWD']['show_text_forecast']) #set $VHDL = $Extras['weewx-DWD']['text_forecast_VHDL'] #set $dwd_link = $Extras['weewx-DWD']['dwd_link']
-
#set $today = datetime.date.today() #set $headings = {54: $pgettext("DWD", "Current Weather Conditions"), 50: $pgettext("DWD", "Today"), 51: $pgettext("DWD", "Tomorrow"), 52: $pgettext("DWD", ($today + datetime.timedelta(days=2)).strftime("%A")), 53: $pgettext("DWD", ($today + datetime.timedelta(days=3)).strftime("%A"))} @@ -69,7 +66,6 @@
#end if - #if $to_bool($Extras['weewx-DWD']['show_forecast']) and os.path.exists("dwd/forecast-" + $Extras['weewx-DWD']['mosmix_id'] + ".json")
@@ -84,10 +80,8 @@
#end if - #if $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_1', None) is not None
- #attr $context = 'custom' #set global $context_start_ts = $time.time() #set $end_dt = $datetime.date.today() + $datetime.timedelta(days=14) @@ -101,10 +95,8 @@
#end if - #if $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_2', None) is not None
- #attr $context = 'custom' #set global $context_start_ts = $time.time() #set $end_dt = $datetime.date.today() + $datetime.timedelta(days=14) @@ -118,10 +110,8 @@
#end if - #if $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_3', None) is not None
- #attr $context = 'custom' #set global $context_start_ts = $time.time() #set $end_dt = $datetime.date.today() + $datetime.timedelta(days=14) @@ -135,7 +125,6 @@
#end if - #if $to_bool($Extras['weewx-DWD']['show_pressure_map']) or $to_bool($Extras['weewx-DWD']['show_warning_map'])
$gettext("Aktuelle Bodendruck- und Warnkarte")
- #if $to_bool($Extras['weewx-DWD']['show_pressure_map'])
#end if - #if $to_bool($Extras['weewx-DWD']['show_warning_map'])
#end if - #if $to_bool($Extras['weewx-DWD']['show_text_warnings'])
#set $warning_index = 0 -
#for $region, $region_key in $get_dwd_warnings.items() #if os.path.exists("dwd/warn-" + $region_key + ".json") and ($warning_index % 2) == 0 - #set global $region = $region #set global $region_key = $region_key #include "includes/dwd-warning.inc" - #end if #set $warning_index = $warning_index + 1 #end for
#set $warning_index = 0 -
#for $region, $region_key in $get_dwd_warnings.items() #if os.path.exists("dwd/warn-" + $region_key + ".json") and ($warning_index % 2) != 0 - #set global $region = $region #set global $region_key = $region_key #include "includes/dwd-warning.inc" - #end if #set $warning_index = $warning_index + 1 #end for diff --git a/skins/weewx-wdc/externals.html.tmpl b/skins/weewx-wdc/externals.html.tmpl index 771a5cce..36650421 100644 --- a/skins/weewx-wdc/externals.html.tmpl +++ b/skins/weewx-wdc/externals.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 @@ -48,11 +47,8 @@
#end if - #if 'externals' in $Extras -
- #for $external in $Extras['externals'] #if $external == 'description' #continue @@ -62,7 +58,6 @@ class="bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6" style="margin-bottom: 1.25rem" > -
#if 'title_long' in $Extras['externals'][$external] diff --git a/skins/weewx-wdc/includes/icons/wind-direction.inc b/skins/weewx-wdc/includes/icons/wind-direction.inc index 0f18336c..6a82bef8 100644 --- a/skins/weewx-wdc/includes/icons/wind-direction.inc +++ b/skins/weewx-wdc/includes/icons/wind-direction.inc @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 diff --git a/skins/weewx-wdc/month-%Y-%m.html.tmpl b/skins/weewx-wdc/month-%Y-%m.html.tmpl index 1020095b..44bfa13f 100644 --- a/skins/weewx-wdc/month-%Y-%m.html.tmpl +++ b/skins/weewx-wdc/month-%Y-%m.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from time import strftime, localtime @@ -23,7 +22,6 @@
- #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/month.html.tmpl b/skins/weewx-wdc/month.html.tmpl index 923d498f..a6f7315e 100644 --- a/skins/weewx-wdc/month.html.tmpl +++ b/skins/weewx-wdc/month.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from datetime import datetime, timedelta @@ -24,13 +23,11 @@
- #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/offline.html.tmpl b/skins/weewx-wdc/offline.html.tmpl index 00ae0b04..be97d852 100644 --- a/skins/weewx-wdc/offline.html.tmpl +++ b/skins/weewx-wdc/offline.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 diff --git a/skins/weewx-wdc/sensor-status.html.tmpl b/skins/weewx-wdc/sensor-status.html.tmpl index de698951..1bb1e895 100644 --- a/skins/weewx-wdc/sensor-status.html.tmpl +++ b/skins/weewx-wdc/sensor-status.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from datetime import datetime, timedelta @@ -16,7 +15,6 @@ #set $sensor_batteries = $to_list($DisplayOptions.get('sensor_battery_status', ['outTempBatteryStatus', 'inTempBatteryStatus', 'rainBatteryStatus', 'windBatteryStatus', 'uvBatteryStatus', 'txBatteryStatus'])) #set $sensor_diagram_period = $DisplayOptions.get('sensor_diagram_period', 'month') - #def diagrams($context, $diagrams_config, $diagram_obs) #set $diagram_index = 0 #if "combined_observations" in $diagrams_config @@ -61,7 +59,6 @@ #end for #end def - #def get_battery_binary($battery_raw, $battery) #if $battery_raw == 1 - #end if #end def - #def get_battery_multi($battery_raw, $battery) #if $battery_raw <= 1 - #end if #end def - #def batteries($sensor_batteries, $layout) -## Some Ecowitt sensors emit a battery state other than 1 or 2 (https://github.com/gjr80/weewx-gw1000/wiki/Sensor-battery-states). -#set $batteries_multi = ['wh41_ch1_batt', 'wh41_ch2_batt', 'wh41_ch3_batt', 'wh41_ch4_batt', 'wh45_batt', 'wh55_ch1_batt', 'wh55_ch2_batt', 'wh55_ch3_batt', 'wh55_ch4_batt', 'wh57_batt'] -#if $layout == 'alternative' - #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6 bx--col-max-4" -#else - #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-12 bx--col-max-6" -#end if - - - -#for $battery in $sensor_batteries - #if $getattr($current, $battery).has_data - -
- #set $battery_raw = $getVar('current.%s.raw' % $battery) + ## Some Ecowitt sensors emit a battery state other than 1 or 2 (https://github.com/gjr80/weewx-gw1000/wiki/Sensor-battery-states). + #set $batteries_multi = ['wh41_ch1_batt', 'wh41_ch2_batt', 'wh41_ch3_batt', 'wh41_ch4_batt', 'wh45_batt', 'wh55_ch1_batt', 'wh55_ch2_batt', 'wh55_ch3_batt', 'wh55_ch4_batt', 'wh57_batt'] + #if $layout == 'alternative' + #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6 bx--col-max-4" + #else + #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-12 bx--col-max-6" + #end if - #if $battery in $batteries_multi - $get_battery_multi($battery_raw, $battery) - #else - $get_battery_binary($battery_raw, $battery) + + #for $battery in $sensor_batteries + #if $getattr($current, $battery).has_data +
+ #set $battery_raw = $getVar('current.%s.raw' % $battery) + + #if $battery in $batteries_multi + $get_battery_multi($battery_raw, $battery) + #else + $get_battery_binary($battery_raw, $battery) + #end if +
#end if -
- -#end if -#end for + #end for #end def @@ -176,9 +166,7 @@
- #if $layout == 'classic' -
$batteries($sensor_batteries, $layout)
@@ -201,17 +188,14 @@
- #if 'sensor_table_observations' in $DisplayOptions
- #set global $table_obs = $DisplayOptions.get('sensor_table_observations') #include "includes/data-table-tile.inc"
#end if
#else - #set global $context = 'day'
@@ -219,7 +203,6 @@
- #for $obs in $sensor_stat_tile_observations #set $binding = $get_data_binding($obs) #set $alltime_tag = $alltime($data_binding=$binding) if $context == 'alltime' else None @@ -231,27 +214,21 @@ #end for
- #set global $context = $sensor_diagram_period -
#include "includes/section-heading.inc"
-
$diagrams($context, $diagrams_config, $sensor_diagram_observations)
- #if 'sensor_table_observations' in $DisplayOptions
- #set global $table_obs = $DisplayOptions.get('sensor_table_observations') #include "includes/data-table-tile.inc"
- #end if #end if
diff --git a/skins/weewx-wdc/statistics.html.tmpl b/skins/weewx-wdc/statistics.html.tmpl index b92569a0..7af6554d 100644 --- a/skins/weewx-wdc/statistics.html.tmpl +++ b/skins/weewx-wdc/statistics.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #import datetime @@ -26,9 +25,7 @@
- #if $get_day_archive_enabled() -
#set $archive_days = $get_archive_days_array($alltime.dateTime.raw, $current.dateTime.raw, $get_time_format_dict['daily_archive']) @@ -44,17 +41,14 @@
#end if - #if len($DisplayOptions.get('climatological_days', [])) > 0
- #include "includes/climatological-days.inc"
#end if - #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/week.html.tmpl b/skins/weewx-wdc/week.html.tmpl index 7211a961..fc48fd76 100644 --- a/skins/weewx-wdc/week.html.tmpl +++ b/skins/weewx-wdc/week.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from datetime import datetime, timedelta @@ -24,13 +23,11 @@
- #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/year-%Y.html.tmpl b/skins/weewx-wdc/year-%Y.html.tmpl index fd2b63e7..ca6a305e 100644 --- a/skins/weewx-wdc/year-%Y.html.tmpl +++ b/skins/weewx-wdc/year-%Y.html.tmpl @@ -1,6 +1,5 @@ #errorCatcher Echo - #encoding UTF-8 #attr $context = 'year' #attr $use_parameter_year = True @@ -36,17 +35,14 @@
- #if len($DisplayOptions.get('climatological_days', [])) > 0
- #include "includes/climatological-days.inc"
#end if - #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/year.html.tmpl b/skins/weewx-wdc/year.html.tmpl index 33bb1dd2..b3849bd2 100644 --- a/skins/weewx-wdc/year.html.tmpl +++ b/skins/weewx-wdc/year.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #from datetime import datetime, timedelta @@ -24,13 +23,11 @@
- #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else diff --git a/skins/weewx-wdc/yesterday.html.tmpl b/skins/weewx-wdc/yesterday.html.tmpl index 0f821b73..1eb68a8f 100644 --- a/skins/weewx-wdc/yesterday.html.tmpl +++ b/skins/weewx-wdc/yesterday.html.tmpl @@ -1,4 +1,3 @@ - #errorCatcher Echo #encoding UTF-8 #attr $context = 'yesterday' @@ -27,7 +26,6 @@
- #if $DisplayOptions.get('layout', 'alternative') == 'alternative' #include 'includes/body-alternative.inc' #else