From c74e15f497004124fefda68aa54dfaa61e5da2da Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Sun, 29 Jan 2017 09:53:47 -0500 Subject: [PATCH] split celestial details into separate page. include fonts in setup.py. split title to separate include. --- setup.py | 13 +++-- skins/Standard/celestial.html.tmpl | 36 ++++++++++++ skins/Standard/celestial.inc | 69 +---------------------- skins/Standard/hilo.inc | 4 +- skins/Standard/index.html.tmpl | 4 +- skins/Standard/sensors.inc | 4 +- skins/Standard/skin.conf | 3 + skins/Standard/standard.css | 15 +++-- skins/Standard/standard.js | 6 -- skins/Standard/statistics.inc | 4 +- skins/Standard/sunmoon.inc | 90 ++++++++++++++++++++++++++++++ 11 files changed, 159 insertions(+), 89 deletions(-) create mode 100644 skins/Standard/celestial.html.tmpl create mode 100644 skins/Standard/sunmoon.inc diff --git a/setup.py b/setup.py index 3a83b16f..6e59a677 100755 --- a/setup.py +++ b/setup.py @@ -546,6 +546,7 @@ if __name__ == "__main__": ('skins/Standard', ['skins/Standard/about.inc', 'skins/Standard/analytics.inc', + 'skins/Standard/celestial.html.tmpl', 'skins/Standard/celestial.inc', 'skins/Standard/current.inc', 'skins/Standard/favicon.ico', @@ -554,18 +555,22 @@ if __name__ == "__main__": 'skins/Standard/radar.inc', 'skins/Standard/rss.xml.tmpl', 'skins/Standard/satellite.inc', - 'skins/Standard/skin.conf', 'skins/Standard/sensors.inc', + 'skins/Standard/skin.conf', 'skins/Standard/standard.css', 'skins/Standard/standard.js', 'skins/Standard/statistics.html.tmpl', - 'skins/Standard/statistics.inc']), + 'skins/Standard/statistics.inc', + 'skins/Standard/sunmoon.inc', + 'skins/Standard/titlebar.inc']), ('skins/Standard/NOAA', ['skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl', 'skins/Standard/NOAA/NOAA-YYYY.txt.tmpl']), ('skins/Standard/font', - ['skins/Standard/font/NotoSans-Bold.ttf', - 'skins/Standard/font/NotoSans-Regular.ttf']), + ['skins/Standard/font/OpenSans-Bold.ttf', + 'skins/Standard/font/OpenSans-Regular.ttf', + 'skins/Standard/font/OpenSans.woff', + 'skins/Standard/font/OpenSans.woff2']), ('skins/Mobile', ['skins/Mobile/favicon.ico', 'skins/Mobile/index.html.tmpl', diff --git a/skins/Standard/celestial.html.tmpl b/skins/Standard/celestial.html.tmpl new file mode 100644 index 00000000..7047ebe2 --- /dev/null +++ b/skins/Standard/celestial.html.tmpl @@ -0,0 +1,36 @@ +## Copyright 2017 Tom Keffer, Matthew Wall +## Distributed under terms of GPLv3. See LICENSE.txt for your rights. +#errorCatcher Echo +#encoding UTF-8 + + + + + $station.location Celestial Details + + + + + + + + #include "titlebar.inc" + +
+

❰ Current Conditions

+ +
+ #include "celestial.inc" +
+
+ + + diff --git a/skins/Standard/celestial.inc b/skins/Standard/celestial.inc index 675c36e1..4ab7c626 100644 --- a/skins/Standard/celestial.inc +++ b/skins/Standard/celestial.inc @@ -26,75 +26,10 @@
Celestial - #if $almanac.hasExtras - :   - Summary - Details - #end if -
-
- #if $almanac.hasExtras -
- - - - - - - - - - - - - - -
Sun
Rise$almanac.sun.rise.string($sun_None)
Set$almanac.sun.set.string($sun_None)
Daylight$daylight_str
-
-
- - - - - - - - - - - - - - -
Moon
Rise$almanac.moon.rise
Set$almanac.moon.set
$almanac.moon_phase
- $almanac.moon_fullness% full
-
- #else - ## No extended almanac information available. Fall back to a simple table. - - - - - - - - - - - - - -
Sunrise$almanac.sunrise
Sunset$almanac.sunset
Moon Phase$almanac.moon_phase
- $almanac.moon_fullness% full
- #end if -
#if $almanac.hasExtras -
diff --git a/skins/Standard/hilo.inc b/skins/Standard/hilo.inc index 2d7f917e..a3cf43ca 100644 --- a/skins/Standard/hilo.inc +++ b/skins/Standard/hilo.inc @@ -15,12 +15,12 @@ - + - + diff --git a/skins/Standard/index.html.tmpl b/skins/Standard/index.html.tmpl index bfefbad3..9e19c203 100644 --- a/skins/Standard/index.html.tmpl +++ b/skins/Standard/index.html.tmpl @@ -15,13 +15,13 @@ - + #include "titlebar.inc"
#include "current.inc" - #include "celestial.inc" + #include "sunmoon.inc" #include "hilo.inc" #include "sensors.inc" #include "about.inc" diff --git a/skins/Standard/sensors.inc b/skins/Standard/sensors.inc index 32885929..d84bff0d 100644 --- a/skins/Standard/sensors.inc +++ b/skins/Standard/sensors.inc @@ -8,9 +8,9 @@ #def get_battery_status($x) #if $x == 0 -OK +OK #else -LOW +LOW #end if #end def diff --git a/skins/Standard/skin.conf b/skins/Standard/skin.conf index d52a2d59..f0ad1198 100644 --- a/skins/Standard/skin.conf +++ b/skins/Standard/skin.conf @@ -249,6 +249,9 @@ template = index.html.tmpl [[[statistics]]] template = statistics.html.tmpl + [[[celestial]]] + template = celestial.html.tmpl + stale_age = 3600 # generate celestial page only every hour [[[RSS]]] template = rss.xml.tmpl diff --git a/skins/Standard/standard.css b/skins/Standard/standard.css index 6ed1a694..947771db 100644 --- a/skins/Standard/standard.css +++ b/skins/Standard/standard.css @@ -162,6 +162,14 @@ a:hover { color: #4444aa; } +.status_ok { + color: #448844; +} + +.status_low { + color: #884444; +} + .button { cursor: pointer; padding-left: 10px; @@ -217,16 +225,16 @@ a:hover { float: left; } -#celestial_widget table th { +.widget table th { font-weight: normal; text-align: right; border-bottom: 1px solid #dddddd; } #hilo_widget table th { - font-weight: normal; font-size: 80%; text-align: right; + border-bottom: none; } #hilo_widget .data { @@ -237,10 +245,7 @@ a:hover { } #sensors_widget table th { - font-weight: normal; - text-align: right; padding-top: 10px; - border-bottom: 1px solid #dddddd; } #history_widget img { diff --git a/skins/Standard/standard.js b/skins/Standard/standard.js index f9a54558..321ad404 100644 --- a/skins/Standard/standard.js +++ b/skins/Standard/standard.js @@ -5,8 +5,6 @@ var cookie_prefix = "weewx.standard."; function setup(widgets) { var id = get_cookie('history', 'day'); choose_history(id); - id = get_cookie('celestial', 'summary'); - choose_celestial(id); if(widgets) { for(var i=0; i
- - + + diff --git a/skins/Standard/sunmoon.inc b/skins/Standard/sunmoon.inc new file mode 100644 index 00000000..24214fc9 --- /dev/null +++ b/skins/Standard/sunmoon.inc @@ -0,0 +1,90 @@ +## sun/moon rise/set module for standard skin +## Copyright Tom Keffer, Matthew Wall +## See LICENSE.txt for your rights + +## If extended almanac information is available, do extra calculations. +#if $almanac.hasExtras +#set $sun_altitude = $almanac.sun.alt +#if $sun_altitude < 0 +#set $sun_None="(Always down)" +#set $daylight_str = "00:00" +#else +#set $sun_None="(Always up)" +#set $daylight_str = "24:00" +#end if + +#set $sunrise_ts = $almanac.sun.rise.raw +#set $sunset_ts = $almanac.sun.set.raw +#if $sunrise_ts and $sunset_ts +#set $daylight_s = $sunset_ts - $sunrise_ts +#set $daylight_hours = int($daylight_s / 3600) +#set $daylight_minutes = int(($daylight_s % 3600) / 60) +#set $daylight_str = "%02d:%02d" % ($daylight_hours, $daylight_minutes) +#end if +#end if + +
+
+ Celestial + +
+
+
+ #if $almanac.hasExtras +
+
Today Week Month Year
$obs.label.outTemp
Today Week Month
+ + + + + + + + + + + + + +
Sun
Rise$almanac.sun.rise.string($sun_None)
Set$almanac.sun.set.string($sun_None)
Daylight$daylight_str
+
+
+ + + + + + + + + + + + + + +
Moon
Rise$almanac.moon.rise
Set$almanac.moon.set
$almanac.moon_phase
+ $almanac.moon_fullness% full
+
+ #else + ## No extended almanac information available. Fall back to basic info. + + + + + + + + + + + + + +
Sunrise$almanac.sunrise
Sunset$almanac.sunset
Moon Phase$almanac.moon_phase
+ $almanac.moon_fullness% full
+ #end if + + +