diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-02 15:06:57 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-02 15:06:57 +0100 |
commit | ca502c12ffbb63d42f7088be770caae9d3a836d8 (patch) | |
tree | b06e1e95ada6eff4e889e4e848d32168e17a854e /templates | |
parent | 098a8d291b81df649c981b8885bea521ba4ca86f (diff) |
Split up App/Infoscreen into separate templates
They're identical for now.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/app.html.ep (renamed from templates/clean.html.ep) | 0 | ||||
-rw-r--r-- | templates/infoscreen.html.ep | 280 | ||||
-rw-r--r-- | templates/layouts/default.html.ep | 4 |
3 files changed, 282 insertions, 2 deletions
diff --git a/templates/clean.html.ep b/templates/app.html.ep index 3c36965..3c36965 100644 --- a/templates/clean.html.ep +++ b/templates/app.html.ep diff --git a/templates/infoscreen.html.ep b/templates/infoscreen.html.ep new file mode 100644 index 0000000..3c36965 --- /dev/null +++ b/templates/infoscreen.html.ep @@ -0,0 +1,280 @@ +% if (@{$departures}) { + +% if (param('dark')) { +<div class="displayclean displaycleandark"> +% } +% else { +<div class="displayclean displaycleanlight"> +% } +<ul> +% my $i = 0; +% my $dt_now = DateTime->now; +% 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} or $departure->{departure_is_cancelled}) { +% $extraclasses .= ' cancelled'; + <li class="cancelled"> +% } +% else { + <li> +% } +% my $linetype = 'bahn'; +% if ( $departure->{train_type} eq 'S' ) { +% $linetype = 'sbahn'; +% } +% elsif ( $departure->{train_type} eq 'IC' +% or $departure->{train_type} eq 'ICE' +% or $departure->{train_type} eq 'EC' +% or $departure->{train_type} eq 'THA' ) { +% $linetype = 'fern'; +% } + <div class="line <%= $linetype %>"> + % if ($departure->{train_type} and $departure->{train_no}) { +%= $departure->{train_type} +% } +% if ($departure->{train_line} ) { +%= $departure->{train_line} +% } +% elsif ($departure->{train_no}) { + <span class="trainno"><%= $departure->{train_no} %></span> +% } +% else { +%= $departure->{train} +% } +% if ($departure->{train_line} and $departure->{train_no} +% and $departure->{train_line} ne $departure->{train_no} +% and param('detailed')) { + <div class="trainno_sub"><%= $departure->{train_no} %></div> +% } + </div> +% if (@{$departure->{replaced_by}} or @{$departure->{replacement_for}}) { + <div class="lineinfo"> +% if (@{$departure->{replaced_by}}) { + %#<span class="replaced">→ Ersatzzug</span> +% } +% if (@{$departure->{replacement_for}}) { + <span class="replacement">Ersatzzug</span> +% } + </div> +% } + <div class="moreinfo collapsed-moreinfo"> + <div class="mheader"> + <div> +% if ($departure->{train_no} or $departure->{train_line}) { + <span class="train-line <%= $linetype %>"><%= $departure->{train_type} %> + <%= $departure->{train_line} // $departure->{train_no} %></span> +% if ($departure->{train_line}) { + <span class="train-no"><%= $departure->{train_no} %></span> +% } +% } +% else { + <span class="train-line"><%= $departure->{train} // q{???} %></span> +% } + </div> + <div> +% if ($departure->{origin}) { + <span class="train-origin"><%= $departure->{origin} %></span> + → +% } + <span class="train-dest"><%= $departure->{destination} // q{???} %></span> + </div> +% 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} %> +% if ($departure->{departure_is_cancelled}) { + (endet hier) +% } + </div> +% } +% if (@{$departure->{replaced_by}}) { +% for my $replacement (@{$departure->{replaced_by}}) { + <span class="replaced">Ersatzzug: <%= $replacement %></span> +% } +% } +% if (@{$departure->{replacement_for}}) { +% for my $replacement (@{$departure->{replacement_for}}) { + <span class="replacement">Ersatzzug für <%= $replacement %></span> +% } +% } + </div> <!-- mheader --> + <div class="mfooter"> + <div class="platforminfo"> +% if ($departure->{scheduled_platform} or $departure->{platform}) { + Gleis <%= $departure->{scheduled_platform} // $departure->{platform} %> +% } +% if ($departure->{scheduled_platform} and $departure->{platform} +% and $departure->{scheduled_platform} ne $departure->{platform}) { + (heute Gleis <%= $departure->{platform} %>) +% } +% elsif ($departure->{changed_platform}) { + (Gleiswechsel) +% } + </div> <!-- platforminfo --> +% 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/> +% } +% if (not ($departure->{sched_arrival} or $departure->{sched_departure})) { + Abfahrt: <%= $departure->{time} %> +% if ($departure->{delay}) { + (heute +<%= $departure->{delay} %>) +% } +% } + </div> <!-- timeinfo --> +% } +% if ($departure->{route_post_diff} and @{$departure->{route_post_diff}}) { + <div class="mroute"> + Über: +% my $first = 0; +% for my $stop (@{$departure->{route_post_diff} // q{???}}) { +% if ($first++) { + <span class="separator">–</span> +% } +% if ($stop->{isAdditional}) { + <span class="additional-stop"><%= $stop->{name} %></span> +% } +% elsif ($stop->{isCancelled}) { + <span class="cancelled-stop"><%= $stop->{name} %></span> +% } +% elsif ($self->is_important($stop->{name})) { + <span class="important-stop"><%= $stop->{name} %></span> +% } +% else { + <span class="generic-stop"><%= $stop->{name} %></span> +% } +% } + </div> <!-- mroute --> +% } +% if ($departure->{moreinfo} and @{$departure->{moreinfo}}) { + Meldungen: + <ul> +% for my $pair (@{$departure->{moreinfo}}) { + <li> +% if ($pair->[0]->isa('DateTime')) { +% if ($pair->[0]->day != $dt_now->day) { +% $pair->[0]->set_locale('de_DE'); +%= $pair->[0]->strftime('%a %H:%M') +% } +% else { +%= $pair->[0]->strftime('%H:%M') +% } +% } +% else { +%= $pair->[0] +% } + : + <span class="reason"> +%= $pair->[1] + </span> + </li> +% } +% if ($departure->{route_info}) { + <li><%= $departure->{route_info} %></li> +% } + </ul> +% } + </div> <!-- mfooter --> + </div> <!-- moreinfo --> +% 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 <%= $extraclasses %>"> +% 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> +% } +% } +% } +% if (($departure->{scheduled_platform} and $departure->{platform} and +% $departure->{scheduled_platform} ne $departure->{platform}) +% or $departure->{changed_platform}) { + <span class="platform changed-platform"> +% } +% else { + <span class="platform"> +% } +%= $departure->{platform} + </span> + </span> + <span class="time <%= ($show_realtime and $departure->{delay} and not + $departure->{is_cancelled}) ? 'delayed' : q{} %> <%= $extraclasses %>"> +% if (param('detailed')) { +% my $arrow = '→'; +% if (not $departure->{sched_arrival}) { +% $arrow = '↦'; +% } +% elsif (not $departure->{sched_departure}) { +% $arrow = '⇥'; +% } +% if ($show_realtime) { +%= ($departure->{arrival} // q{}) . $arrow . ($departure->{departure} // q{}) +% } +% else { +%= ($departure->{sched_arrival} // q{}) . $arrow . ($departure->{sched_departure} // q{}) +% } +% } +% else { +%= $departure->{time} +% } + </span> + </li> + +% } + + </ul> + </div> <!-- displayclean --> + +% } +% else { + +<div class="container"> +<div class="error"><strong>Keine Abfahrten gefunden.</strong> +Möglicherweise ist der Filter zu restriktiv, oder an dieser Station fahren +momentan keine Züge.</div> +</div> <!-- container --> + +% } diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 1929569..78a962f 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -83,7 +83,7 @@ Bitte eine Station aus der Liste auswählen</div> Frontend </div> <div> - %= select_field mode => [ ['App / Infoscreen' => 'clean'], ['Bahnhofstafel' => 'multi'], ['Gleis' => 'single'] ] + %= select_field mode => [ ['App' => 'app'], ['Infoscreen' => 'infoscreen'], ['Bahnhofstafel' => 'multi'], ['Gleisanzeiger' => 'single'] ] </div> </div> <div class="field"> @@ -191,7 +191,7 @@ Bitte eine Station aus der Liste auswählen</div> <li><a href="/Essen%20Hbf?mode=multi">Essen HBf</a> (IRIS, Bahnhofstafel)</li> <li><a href="/Dortmund%20Hbf/Bochum%7CHamm?mode=multi">Dortmund HBf</a> (IRIS, Bahnhofstafel, nur Züge via Bochum oder Hamm)</li> -<li><a href="/Dortmund%20Universität?mode=clean">Dortmund Universität</a> (IRIS, Mobile/Infoscreen)</li> +<li><a href="/Dortmund%20Universität?mode=infoscreen">Dortmund Universität</a> (IRIS, Infoscreen)</li> <li><a href="/KD?mode=single">Düsseldorf HBf</a> (IRIS, Gleistafel)</li> </ul> </div> |