added possibility to configure station info items

This commit is contained in:
Michi
2023-07-21 17:51:35 +02:00
parent f1c859b6a7
commit 46611f9676
8 changed files with 42 additions and 34 deletions

View File

@@ -2,7 +2,7 @@ Installation
============
Before we begin...
1) This release (v4.0) has been tested on Weewx version 4.10.2 and Python 3.9.2
1) This release (v4.1) has been tested on Weewx version 4.10.2 and Python 3.9.2
Versions of Weewx before v3 will not work.
2) This has been tested on sqlite databases. Mysql and any other Weewx supported databases should work too.

View File

@@ -59,6 +59,7 @@ class MyXSearch(SearchList):
# Make some config available to templates
self.add_to_extension_list('Navigation', generator.skin_dict)
self.add_to_extension_list('StationInfo', generator.skin_dict)
self.add_to_extension_list('TranslationLinks', generator.skin_dict)
self.add_to_extension_list('HistoryReport', generator.skin_dict)
self.add_to_extension_list('ImageGenerator', generator.skin_dict)

View File

@@ -23,38 +23,9 @@
<div class="row stationInfo">
<table class="table table-hover">
<tbody>
<tr>
<td>$gettext("Latitude")</td>
<td>$station.latitude[0]&deg; $station.latitude[1]' $station.latitude[2]</td>
</tr>
<tr>
<td>$gettext("Longitude")</td>
<td>$station.longitude[0]&deg; $station.longitude[1]' $station.longitude[2]</td>
</tr>
<tr>
<td>$gettext("Altitude")</td>
<td>$station.altitude</td>
</tr>
<tr>
<td>$gettext("Sunrise")</td>
<td>$almanac.sunrise</td>
</tr>
<tr>
<td>$gettext("Sunset")</td>
<td>$almanac.sunset</td>
</tr>
<tr>
<td>$gettext("Moon Phase")</td>
<td>$almanac.moon_phase ($almanac.moon_fullness%)</td>
</tr>
<tr>
<td>$gettext("Station Uptime")</td>
<td>$station.uptime.long_form</td>
</tr>
<tr>
<td>$gettext("Server Uptime")</td>
<td>$station.os_uptime.long_form</td>
</tr>
#for $station_info_item in $StationInfo['station_info_items']
#include $station_info_item + ".html.inc"
#end for
</tbody>
</table>
</div>

View File

@@ -0,0 +1,12 @@
<tr>
<td>$gettext("Latitude")</td>
<td>$station.latitude[0]&deg; $station.latitude[1]' $station.latitude[2]</td>
</tr>
<tr>
<td>$gettext("Longitude")</td>
<td>$station.longitude[0]&deg; $station.longitude[1]' $station.longitude[2]</td>
</tr>
<tr>
<td>$gettext("Altitude")</td>
<td>$station.altitude</td>
</tr>

View File

@@ -0,0 +1,4 @@
<tr>
<td>$gettext("Moon Phase")</td>
<td>$almanac.moon_phase ($almanac.moon_fullness%)</td>
</tr>

View File

@@ -15,7 +15,6 @@
#
#
############################################################################################
[Extras]
#
@@ -114,6 +113,11 @@
# copy_always =
############################################################################################
[StationInfo]
# This list determines which station info items will appear in the station info section, as well as in which order.
# You can define a custom part, to do so, create a template called "customStationInfo.html.inc" and include it in the list
station_info_items = location, sunRiseSet, moonphase, uptime #, customStationInfo
[Navigation]
#this section lets you define Elements for the navbar
# This list determines which navigation items will appear in the navbar, as well as in which order.

View File

@@ -0,0 +1,8 @@
<tr>
<td>$gettext("Sunrise")</td>
<td>$almanac.sunrise</td>
</tr>
<tr>
<td>$gettext("Sunset")</td>
<td>$almanac.sunset</td>
</tr>

View File

@@ -0,0 +1,8 @@
<tr>
<td>$gettext("Station Uptime")</td>
<td>$station.uptime.long_form</td>
</tr>
<tr>
<td>$gettext("Server Uptime")</td>
<td>$station.os_uptime.long_form</td>
</tr>