summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/clean.html.ep298
1 files changed, 145 insertions, 153 deletions
diff --git a/templates/clean.html.ep b/templates/clean.html.ep
index bc1fc7c..9fcb3e7 100644
--- a/templates/clean.html.ep
+++ b/templates/clean.html.ep
@@ -4,162 +4,154 @@
<ul>
% my $i = 0;
% for my $departure (@{$departures}) {
-% $i++;
-% my $route_str = q{};
-% my $via_max = @{$departure->{via}};
-% my $via_cur = 0;
-% for my $stop (@{$departure->{via}}) {
-% $via_cur++;
-% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{});
-% }
-% my $extraclasses = q{};
-% if ($departure->{is_cancelled}) {
-% $extraclasses .= ' cancelled';
-% }
-
-<li>
-% my $linetype = q{};
-% if ( $departure->{train} =~ m{ ^ S \s? \d{1,2} $ }x ) {
-% $linetype = 'sbahn';
-% }
-<span class="line <%= $linetype %> <%= $extraclasses %>">
-%= $departure->{train}
-</span>
-% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) {
-<span class="lineinfo">
-% for my $replacement (@{$departure->{replaced_by}}) {
-<span class="replaced">→ <%= $replacement %></span>
-% }
-% for my $replacement (@{$departure->{replacement_for}}) {
-<span class="replacement">↑ <%= $replacement %></span>
-% }
-</span>
-% }
-<span class="moreinfo">
-<div class="mheader">
-<span class="train-line"><%= $departure->{train_type} // q{???} %></span><!--
---><span class="train-line"><%= $departure->{train_line} // q{} %></span>
-% if ($departure->{train_line}) {
-<span class="train-no"><%= $departure->{train_no} // q{???} %></span>
-% }
-% else {
-<span class="train-line"><%= $departure->{train_no} // q{???} %></span>
-% }
-% if ($departure->{origin}) {
-:
-<span class="train-origin"><%= $departure->{origin} %></span>
-% }
-→
-<span class="train-dest"><%= $departure->{destination} // q{???} %></span>
-% if ($departure->{is_cancelled}) {
-<div class="minfo">Fahrt fällt aus</div>
-% }
-% elsif (defined $departure->{delay} and $departure->{delay} > 0) {
-<div class="minfo">+<%= $departure->{delay} %></div>
-% }
-</div>
-% if (not $departure->{is_cancelled}) {
-<div class="timeinfo">
-% if ($departure->{sched_arrival}) {
-Ankunft: <%= $departure->{sched_arrival} %>
-% if ($departure->{arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
-(heute: <%= $departure->{arrival} %>)
-% }
-<br/>
-% }
-% if ($departure->{sched_departure}) {
-Abfahrt: <%= $departure->{sched_departure} %>
-% if ($departure->{departure} and $departure->{departure} ne $departure->{sched_departure}) {
-(heute: <%= $departure->{departure} %>)
-% }
-<br/>
-% }
-</div> <!-- timeinfo -->
-% }
-% if ($departure->{route_post} and @{$departure->{route_post}}) {
-<div class="mroute">
-Über: <%= join(' – ', @{$departure->{route_post} // q{???}}) %>
-</div> <!-- mroute -->
-% }
-% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
-Meldungen:
-<ul>
-% for my $pair (@{$departure->{moreinfo}}) {
-<li>
-% if ($pair->[0]->isa('DateTime')) {
-%= $pair->[0]->strftime('%H:%M')
-% }
-% else {
-%= $pair->[0]
-% }
-:
-<span class="reason">
-%= $pair->[1]
-</span>
-</li>
-% }
-</ul>
-% }
-</span>
-% if ($departure->{info} and length $departure->{info}) {
-<span class="info">
-%= $departure->{info}
-</span>
-% }
-% else {
-<span class="route">
-%= $route_str
-</span>
-% }
-<span class="dest <%= $extraclasses %>">
-%= $departure->{destination}
-</span>
-<span class="countdown">
-% if ($departure->{delay} and not $departure->{is_cancelled}) {
-% if ($show_realtime) {
-% if ($departure->{delay} > 0) {
-<span class="delaynorm">(+<%= $departure->{delay} %>)</span>
-% }
-% else {
-<span class="undelaynorm">(<%= $departure->{delay} %>)</span>
-% }
-% }
-% else {
-% if ($departure->{delay} > 0) {
-<span class="delay">(+<%= $departure->{delay} %>)</span>
-% }
-% else {
-<span class="undelay">(<%= $departure->{delay} %>)</span>
-% }
-% }
-% }
-<span class="platform <%= $extraclasses %>">
-%= $departure->{platform}
-</span>
-</span>
-<span class="time <%= ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) ? 'delayed' : q{} %> <%= $extraclasses %>">
-% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
-<span class="delayed">
-% }
-%= $departure->{time}
-</span>
-% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
-</span>
-% }
-</li>
-
-<!--
-% if ($departure->{info}) {
-<div class="info">
-%= $departure->{info}
-</div>
-% }
--->
+% $i++;
+% my $route_str = q{};
+% my $via_max = @{$departure->{via}};
+% my $via_cur = 0;
+% for my $stop (@{$departure->{via}}) {
+% $via_cur++;
+% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{});
+% }
+% my $extraclasses = q{};
+% if ($departure->{is_cancelled}) {
+% $extraclasses .= ' cancelled';
+% }
+ <li>
+% my $linetype = q{};
+% if ( $departure->{train} =~ m{ ^ S \s? \d{1,2} $ }x ) {
+% $linetype = 'sbahn';
+% }
+ <span class="line <%= $linetype %> <%= $extraclasses %>">
+%= $departure->{train}
+ </span>
+% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) {
+ <span class="lineinfo">
+% for my $replacement (@{$departure->{replaced_by}}) {
+ <span class="replaced">→ <%= $replacement %></span>
+% }
+% for my $replacement (@{$departure->{replacement_for}}) {
+ <span class="replacement">↑ <%= $replacement %></span>
+% }
+ </span>
+% }
+ <span class="moreinfo">
+ <div class="mheader">
+ <span class="train-line"><%= $departure->{train_type} // q{???} %></span><!--
+ --><span class="train-line"><%= $departure->{train_line} // q{} %></span>
+% if ($departure->{train_line}) {
+ <span class="train-no"><%= $departure->{train_no} // q{???} %></span>
+% }
+% else {
+ <span class="train-line"><%= $departure->{train_no} // q{???} %></span>
+% }
+% if ($departure->{origin}) {
+ :
+ <span class="train-origin"><%= $departure->{origin} %></span>
+% }
+ →
+ <span class="train-dest"><%= $departure->{destination} // q{???} %></span>
+% if ($departure->{is_cancelled}) {
+ <div class="minfo">Fahrt fällt aus</div>
+% }
+% elsif (defined $departure->{delay} and $departure->{delay} > 0) {
+ <div class="minfo">+<%= $departure->{delay} %></div>
+% }
+ </div>
+% if (not $departure->{is_cancelled}) {
+ <div class="timeinfo">
+% if ($departure->{sched_arrival}) {
+ Ankunft: <%= $departure->{sched_arrival} %>
+% if ($departure->{arrival} and $departure->{arrival} ne $departure->{sched_arrival}) {
+ (heute: <%= $departure->{arrival} %>)
+% }
+ <br/>
+% }
+% if ($departure->{sched_departure}) {
+ Abfahrt: <%= $departure->{sched_departure} %>
+% if ($departure->{departure} and $departure->{departure} ne $departure->{sched_departure}) {
+ (heute: <%= $departure->{departure} %>)
+% }
+ <br/>
+% }
+ </div> <!-- timeinfo -->
+% }
+% if ($departure->{route_post} and @{$departure->{route_post}}) {
+ <div class="mroute">
+ Über: <%= join(' – ', @{$departure->{route_post} // q{???}}) %>
+ </div> <!-- mroute -->
+% }
+% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) {
+ Meldungen:
+ <ul>
+% for my $pair (@{$departure->{moreinfo}}) {
+ <li>
+% if ($pair->[0]->isa('DateTime')) {
+%= $pair->[0]->strftime('%H:%M')
+% }
+% else {
+%= $pair->[0]
+% }
+ :
+ <span class="reason">
+%= $pair->[1]
+ </span>
+ </li>
+% }
+ </ul>
+% }
+ </span>
+% if ($departure->{info} and length $departure->{info}) {
+ <span class="info">
+%= $departure->{info}
+ </span>
+% }
+% else {
+ <span class="route">
+%= $route_str
+ </span>
+% }
+ <span class="dest <%= $extraclasses %>">
+%= $departure->{destination}
+ </span>
+ <span class="countdown">
+% if ($departure->{delay} and not $departure->{is_cancelled}) {
+% if ($show_realtime) {
+% if ($departure->{delay} > 0) {
+ <span class="delaynorm">(+<%= $departure->{delay} %>)</span>
+% }
+% else {
+ <span class="undelaynorm">(<%= $departure->{delay} %>)</span>
+% }
+% }
+% else {
+% if ($departure->{delay} > 0) {
+ <span class="delay">(+<%= $departure->{delay} %>)</span>
+% }
+% else {
+ <span class="undelay">(<%= $departure->{delay} %>)</span>
+% }
+% }
+% }
+ <span class="platform <%= $extraclasses %>">
+%= $departure->{platform}
+ </span>
+ </span>
+ <span class="time <%= ($show_realtime and $departure->{delay} and not
+ $departure->{is_cancelled}) ? 'delayed' : q{} %> <%= $extraclasses %>">
+% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
+ <span class="delayed">
+% }
+%= $departure->{time}
+ </span>
+% if ($show_realtime and $departure->{delay} and not $departure->{is_cancelled}) {
+ </span>
+% }
+ </li>
% }
-</ul>
-</div> <!-- displayclean -->
+ </ul>
+ </div> <!-- displayclean -->
% }
% else {