summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-09 11:40:40 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-09 11:40:40 +0200
commitaf105440e5f3582758a4ab3dc5fe21f690e83542 (patch)
treeab07d0bb8dd24bf3bba06f7993a0326c01f320a4
parent8b487d4836ad94b0b6450011f9f1a9634f3c7ab0 (diff)
infoscreen: show all available times in route view
-rw-r--r--public/infoscreen.css14
-rw-r--r--templates/infoscreen.html.ep32
2 files changed, 43 insertions, 3 deletions
diff --git a/public/infoscreen.css b/public/infoscreen.css
index 3c2752a..e7cdac8 100644
--- a/public/infoscreen.css
+++ b/public/infoscreen.css
@@ -159,6 +159,20 @@ div.displayclean li .moreinfo .mheader {
font-size: 120%;
}
+div.displayclean li .moreinfo tr.routepre {
+ background-color: #dddddd;
+}
+div.displayclean li .moreinfo tr.routenow {
+ background-color: #eeeeee;
+}
+div.displayclean li .moreinfo tr.routepost {
+}
+
+div.displayclean li .moreinfo td.time {
+ text-align: center;
+ margin-right: 0.5em;
+}
+
div.displayclean li .moreinfo .mroute {
margin-bottom: 0.6em
}
diff --git a/templates/infoscreen.html.ep b/templates/infoscreen.html.ep
index 5495cc3..851b1d1 100644
--- a/templates/infoscreen.html.ep
+++ b/templates/infoscreen.html.ep
@@ -60,13 +60,39 @@
Fahrplan:
<table class="scheduled">
% for my $stop ($departure->route_pre) {
- <tr><td class="time"><%= $stop->{dep_time} %></td>
+ <tr class="routepre"><td class="time">
+% if (not defined $stop->{arr_time}) {
+ <%= $stop->{dep_time} %>
+% }
+% elsif (not defined $stop->{dep_time}) {
+ <%= $stop->{arr_time} %>
+% }
+% elsif ( $stop->{arr_time} eq $stop->{dep_time} ) {
+ <%= $stop->{dep_time} %>
+% }
+% else {
+ <%= $stop->{arr_time} %> → <%= $stop->{dep_time} %>
+% }
+ </td>
<td class="stop"><%= $stop->{stop} %></td></tr>
% }
- <tr><td class="time"></td>
+ <tr class="routenow"><td class="time"><%= $departure->time %></td>
<td class="stop"><%= $id_name %> <%= $id_stop %></td></tr>
% for my $stop ($departure->route_post) {
- <tr><td class="time"><%= $stop->{arr_time} %></td>
+ <tr class="routepost"><td class="time">
+% if (not defined $stop->{arr_time}) {
+ <%= $stop->{dep_time} %>
+% }
+% elsif (not defined $stop->{dep_time}) {
+ <%= $stop->{arr_time} %>
+% }
+% elsif ( $stop->{arr_time} eq $stop->{dep_time} ) {
+ <%= $stop->{dep_time} %>
+% }
+% else {
+ <%= $stop->{arr_time} %> → <%= $stop->{dep_time} %>
+% }
+ </td>
<td class="stop"><%= $stop->{stop} %></td></tr>
% }
</table>