From 7bb417f22888bbac2bcb96b75a13cfe64381929a Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 20 May 2013 22:17:42 +0100 Subject: HTML output or forecast stripes/spans are wrong --- forecast.html.tt | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 forecast.html.tt (limited to 'forecast.html.tt') diff --git a/forecast.html.tt b/forecast.html.tt new file mode 100644 index 0000000..57edfb7 --- /dev/null +++ b/forecast.html.tt @@ -0,0 +1,111 @@ +[% + cur = f.currently; today = f.daily.data.0; + MACRO hours_length BLOCK; + span.stop_time.subtract_datetime(span.start_time).in_units('hours'); + END; +-%] + + + Forecast + + + + +
+

Currently

+ [% cur.icon %] +
+
Temperature:
+
[% cur.temperature %]°
+
Summary:
+
[% cur.summary %]
+
+
+
+

Next hour

+ [% f.minutely.icon %] +
+
Summary:
+
[% f.minutely.summary %]
+
+
+
+

Next 24 hours

+ [% f.hourly.icon %] +
+
Summary:
+
[% f.hourly.summary %]
+
+
+
+

Next 7 days

+ [% f.daily.icon %] +
+
Summary:
+
[% f.daily.summary %]
+
+
+
+
+ [% today.icon %] +
+
Summary:
+
[% today.summary %]
+
Min temperature:
+
[% today.temperatureMin %]° [% today.temperatureMinTime.strftime('%H:%M') %]
+
Max temperature:
+
[% today.temperatureMax %]° [% today.temperatureMaxTime.strftime('%H:%M') %]
+
Sunrise:
+
[% today.sunriseTime.strftime('%H:%M') %]
+
Sunset:
+
[% today.sunsetTime.strftime('%H:%M') %]
+
+
+
+ [% left=0 ;FOR span IN f.hourly.spans_by_string('summary'); + width=3*hours_length(span=span) %] + [% span.value %] [% span.start_time %] [% span.stop_time %] + [% left=left+width; END %] +
+
+ [% left=0; FOR span IN [ 0 .. 23 ] %] + [% span %] + [% left=left+3; END %] +
+
+ [% left=0; FOR h IN f.hourly.data %] + [% h.temperature %]° + [% left=left+3; END %] +
+
+
+
+ + -- cgit v1.2.3