Skip to content

Commit

Permalink
Restructured templates in includes/ folder. Fixes GH-234
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Nov 23, 2024
1 parent f557320 commit 3d82278
Show file tree
Hide file tree
Showing 42 changed files with 150 additions and 150 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,4 +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
- (chore) Remove prettier from *.inc and *html.tmpl files. Restructured templates in `includes/` folder. GH-234
50 changes: 25 additions & 25 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,31 @@ def __init__(self):
"skins/weewx-wdc/dist/assets/IBMPlexSerif-Regular.woff",
"skins/weewx-wdc/favicon.ico",
"skins/weewx-wdc/plotly-custom-build.min.js",
"skins/weewx-wdc/includes/html-head.inc",
"skins/weewx-wdc/includes/section-heading.inc",
"skins/weewx-wdc/includes/almanac-tile.inc",
"skins/weewx-wdc/includes/almanac-tile-simple.inc",
"skins/weewx-wdc/includes/almanac-moon-detail-tile.inc",
"skins/weewx-wdc/includes/almanac-sun-detail-tile.inc",
"skins/weewx-wdc/includes/combined-diagram-tile.inc",
"skins/weewx-wdc/includes/data-table-tile.inc",
"skins/weewx-wdc/includes/diagram-tile.inc",
"skins/weewx-wdc/includes/gauge-tile.inc",
"skins/weewx-wdc/includes/diagram-tile-wind-rose.inc",
"skins/weewx-wdc/includes/dwd-warning.inc",
"skins/weewx-wdc/includes/stat-tile.inc",
"skins/weewx-wdc/includes/stat-tile-xaggs.inc",
"skins/weewx-wdc/includes/stat-tile-modals.inc",
"skins/weewx-wdc/includes/stat-table.inc",
"skins/weewx-wdc/includes/conditions-table.inc",
"skins/weewx-wdc/includes/climatological-days.inc",
"skins/weewx-wdc/includes/ui-shell.inc",
"skins/weewx-wdc/includes/footer.inc",
"skins/weewx-wdc/includes/body-classic.inc",
"skins/weewx-wdc/includes/body-alternative.inc",
"skins/weewx-wdc/includes/forecast.inc",
"skins/weewx-wdc/includes/forecast-table.inc",
"skins/weewx-wdc/includes/year-stats-table.inc",
"skins/weewx-wdc/includes/layout/html-head.inc",
"skins/weewx-wdc/includes/layout/ui-shell.inc",
"skins/weewx-wdc/includes/layout/footer.inc",
"skins/weewx-wdc/includes/layout/body-classic.inc",
"skins/weewx-wdc/includes/layout/body-alternative.inc",
"skins/weewx-wdc/includes/layout/section-heading.inc",
"skins/weewx-wdc/includes/almanac/almanac-tile.inc",
"skins/weewx-wdc/includes/almanac/almanac-tile-simple.inc",
"skins/weewx-wdc/includes/almanac/almanac-moon-detail-tile.inc",
"skins/weewx-wdc/includes/almanac/almanac-sun-detail-tile.inc",
"skins/weewx-wdc/includes/tiles/combined-diagram-tile.inc",
"skins/weewx-wdc/includes/tiles/data-table-tile.inc",
"skins/weewx-wdc/includes/tiles/diagram-tile.inc",
"skins/weewx-wdc/includes/tiles/gauge-tile.inc",
"skins/weewx-wdc/includes/tiles/diagram-tile-wind-rose.inc",
"skins/weewx-wdc/includes/tiles/stat-tile.inc",
"skins/weewx-wdc/includes/tiles/stat-tile-xaggs.inc",
"skins/weewx-wdc/includes/tiles/stat-tile-modals.inc",
"skins/weewx-wdc/includes/tiles/conditions-table.inc",
"skins/weewx-wdc/includes/forecast/dwd-warning.inc",
"skins/weewx-wdc/includes/forecast/forecast.inc",
"skins/weewx-wdc/includes/forecast/forecast-table.inc",
"skins/weewx-wdc/includes/statistics-tables/climatological-days.inc",
"skins/weewx-wdc/includes/statistics-tables/year-stats-table.inc",
"skins/weewx-wdc/includes/statistics-tables/stat-table.inc",
"skins/weewx-wdc/includes/icons/barometer.svg",
"skins/weewx-wdc/includes/pictograms/sun.svg",
"skins/weewx-wdc/includes/pictograms/moon.svg",
Expand Down
6 changes: 3 additions & 3 deletions skins/weewx-wdc/about.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("About")</title>
<script
type="module"
Expand All @@ -25,7 +25,7 @@
</head>

<body class="theme-$DisplayOptions.get('layout', 'alternative')">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<!--@see https://github.com/carbon-design-system/carbon/blob/v10/packages/type/scss/modules/_styles.scss#L628-->
<main class="user-page main bx--content">
Expand Down Expand Up @@ -284,7 +284,7 @@
</section>
</main>

#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
16 changes: 8 additions & 8 deletions skins/weewx-wdc/celestial.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("Almanac")</title>
</head>

<body class="theme-$DisplayOptions.get('layout', 'alternative')">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<main class="main bx--content">
<section>
Expand All @@ -29,24 +29,24 @@
#attr $labels_almanac = ["Sun", "Moon"]
#for $label in $labels_almanac
#set global $label_almanac = $label
#include "includes/almanac-tile.inc"
#include "includes/almanac/almanac-tile.inc"
#end for
</div>
<div class="bx--row">
#attr $labels_almanac2 = ["Venus", "Mars", "Jupiter", "Saturn"]
#for $label in $labels_almanac2
#set global $label_almanac = $label
#include "includes/almanac-tile.inc"
#include "includes/almanac/almanac-tile.inc"
#end for
</div>
<div class="bx--row">
#include "includes/almanac-sun-detail-tile.inc"
#include "includes/almanac-moon-detail-tile.inc"
#include "includes/almanac/almanac-sun-detail-tile.inc"
#include "includes/almanac/almanac-moon-detail-tile.inc"
</div>
#else
<div class="bx--row">
#set global $label_almanac = $gettext("Sun")
#include "includes/almanac-tile-simple.inc"
#include "includes/almanac/almanac-tile-simple.inc"
</div>
<div class="bx--row">
<div class="bx--col">
Expand All @@ -60,7 +60,7 @@
</section>
</main>

#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
22 changes: 11 additions & 11 deletions skins/weewx-wdc/computer-monitor.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#set global $comb_obs = $skin_obs
#set global $combined_diagram = $combined_diagram
#set global $diagram_index = $diagram_index
#include "includes/combined-diagram-tile.inc"
#include "includes/tiles/combined-diagram-tile.inc"
#set $diagram_index = $diagram_index + 1
#break
#end if
Expand All @@ -48,9 +48,9 @@
#set global $partial_obs = $skin_obs
#set global $diagram_index = $diagram_index
#if $skin_obs == 'windRose'
#include "includes/diagram-tile-wind-rose.inc"
#include "includes/tiles/diagram-tile-wind-rose.inc"
#else
#include "includes/diagram-tile.inc"
#include "includes/tiles/diagram-tile.inc"
#end if
#set $diagram_index = $diagram_index + 1
#end if
Expand All @@ -61,12 +61,12 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("Computer Monitor")</title>
</head>

<body class="theme-$layout">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<main>
<section class="main bx--content">
Expand All @@ -85,7 +85,7 @@
>
#set global $context = 'day'
#set global $stat_obs = $computer_monitor_stat_tile_observations
#include 'includes/conditions-table.inc'
#include 'includes/tiles/conditions-table.inc'
</div>

<div class="bx--col-sm-4 bx--col-md-8 bx--col-lg-6 bx--col-xlg-8 bx--col-max-8 layout-col">
Expand All @@ -98,7 +98,7 @@
#if 'computer_monitor_table_observations' in $DisplayOptions
<div class="bx--row">
#set global $table_obs = $DisplayOptions.get('computer_monitor_table_observations')
#include "includes/data-table-tile.inc"
#include "includes/tiles/data-table-tile.inc"
</div>
#end if
</div>
Expand All @@ -112,15 +112,15 @@

#if $getattr($get_time_span_from_context($context, $day($data_binding=$binding), $week($data_binding=$binding), $month($data_binding=$binding), $year($data_binding=$binding), $alltime_tag, $yesterday($data_binding=$binding)), $get_custom_data_binding_obs_key($obs)).has_data
#set global $partial_obs = $obs
#include "includes/stat-tile.inc"
#include "includes/tiles/stat-tile.inc"
#end if
#end for
</div>

#set global $context = $computer_monitor_diagram_period

<div class="bx--row">
#include "includes/section-heading.inc"
#include "includes/layout/section-heading.inc"
</div>

<div class="bx--row">
Expand All @@ -130,14 +130,14 @@
#if 'computer_monitor_table_observations' in $DisplayOptions
<div class="bx--row">
#set global $table_obs = $DisplayOptions.get('computer_monitor_table_observations')
#include "includes/data-table-tile.inc"
#include "includes/tiles/data-table-tile.inc"
</div>
#end if
#end if
</div>
</section>
</main>
#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
12 changes: 6 additions & 6 deletions skins/weewx-wdc/day-archive/day-%Y-%m-%d.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("Archive")</title>
</head>

<body class="theme-$DisplayOptions.get('layout', 'alternative')">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<main class="main bx--content">
<section>
Expand Down Expand Up @@ -45,20 +45,20 @@
#end if

#if $DisplayOptions.get('layout', 'alternative') == 'alternative'
#include 'includes/body-alternative.inc'
#include 'includes/layout/body-alternative.inc'
#else
#include 'includes/body-classic.inc'
#include 'includes/layout/body-classic.inc'
#end if
</div>
</section>
</main>

<!--Stat tile Modals-->
#if $DisplayOptions.get('layout', 'alternative') == 'alternative'
#include "includes/stat-tile-modals.inc"
#include "includes/tiles/stat-tile-modals.inc"
#end if

#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
16 changes: 8 additions & 8 deletions skins/weewx-wdc/dwd.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("Forecast")</title>
<script
type="module"
Expand All @@ -22,7 +22,7 @@
</head>

<body class="theme-$DisplayOptions.get('layout', 'alternative')">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<main class="main bx--content">
<section>
Expand Down Expand Up @@ -91,7 +91,7 @@
#set global $comb_obs = "dwd_meteogram_1"
#set global $combined_diagram = $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_1', {})
#set global $diagram_index = 9999
#include "includes/combined-diagram-tile.inc"
#include "includes/tiles/combined-diagram-tile.inc"
</div>
#end if

Expand All @@ -106,7 +106,7 @@
#set global $comb_obs = "dwd_meteogram_2"
#set global $combined_diagram = $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_2', {})
#set global $diagram_index = 9999
#include "includes/combined-diagram-tile.inc"
#include "includes/tiles/combined-diagram-tile.inc"
</div>
#end if

Expand All @@ -121,7 +121,7 @@
#set global $comb_obs = "dwd_meteogram_3"
#set global $combined_diagram = $DisplayOptions.get("diagrams", {}).get("combined_observations", {}).get('dwd_meteogram_3', {})
#set global $diagram_index = 9999
#include "includes/combined-diagram-tile.inc"
#include "includes/tiles/combined-diagram-tile.inc"
</div>
#end if

Expand Down Expand Up @@ -199,7 +199,7 @@

#set global $region = $region
#set global $region_key = $region_key
#include "includes/dwd-warning.inc"
#include "includes/forecast/dwd-warning.inc"

#end if
#set $warning_index = $warning_index + 1
Expand All @@ -215,7 +215,7 @@

#set global $region = $region
#set global $region_key = $region_key
#include "includes/dwd-warning.inc"
#include "includes/forecast/dwd-warning.inc"

#end if
#set $warning_index = $warning_index + 1
Expand All @@ -227,7 +227,7 @@
</section>
</main>

#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions skins/weewx-wdc/externals.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!DOCTYPE html>
<html lang="$lang">
<head>
#include "includes/html-head.inc"
#include "includes/layout/html-head.inc"
<title>$station.location - $gettext("Webcams/Externals")</title>
<script
type="module"
Expand All @@ -25,7 +25,7 @@
</head>

<body class="theme-$DisplayOptions.get('layout', 'alternative')">
#include "includes/ui-shell.inc"
#include "includes/layout/ui-shell.inc"

<!--@see https://github.com/carbon-design-system/carbon/blob/v10/packages/type/scss/modules/_styles.scss#L628-->
<main class="user-page main bx--content">
Expand Down Expand Up @@ -87,7 +87,7 @@
</section>
</main>

#include "includes/footer.inc"
#include "includes/layout/footer.inc"

<script src="$get_base_path(path='dist/main.js')" defer></script>
</body>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#end if
#if $varExists('forecast') and not $dwd_forecast
<div class="forecast" data-test="forecast-table">
#include "includes/forecast-table.inc"
#include "includes/forecast/forecast-table.inc"
</div>
#end if
#if $dwd_forecast
Expand All @@ -87,7 +87,7 @@
#if $show_warn
#set global $region = $get_dwd_warning_region_name($warn_region_front)
#set global $region_key = $warn_region_front
#include "includes/dwd-warning.inc"
#include "includes/forecast/dwd-warning.inc"
#end if

#if $radar_externals
Expand Down
Loading

0 comments on commit 3d82278

Please sign in to comment.