summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-01-29 17:40:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-01-29 17:40:27 +0100
commit6526ae6a64c14f9d64a791b778b157f502a5aa0a (patch)
tree1d31b11010b2e3ae8d6f0fdc24315888cefbf692 /templates
parenta32109701fc567defbd6673e9cdf6bdf10b83ec7 (diff)
add hafas (bus, ubahn, tram) support
Diffstat (limited to 'templates')
-rw-r--r--templates/_train_details.html.ep8
-rw-r--r--templates/app.html.ep10
-rw-r--r--templates/layouts/app.html.ep8
3 files changed, 21 insertions, 5 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index ab6ea45..0240a18 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -210,7 +210,7 @@
<ul class="mroute">
% for my $stop (@{$departure->{route_pre_diff}}) {
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
- <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
+ <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }
@@ -265,7 +265,7 @@
% }
% for my $stop (@{$departure->{route_post_diff}}) {
<li class="<%= $stop->{isPast} ? 'past-stop' : 'future-stop' %>">
- <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
+ <a href="<%= url_for('station', station => $stop->{eva} // $stop->{name})->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>#<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>" class="
% if ($stop->{isAdditional}) {
additional-stop
% }
@@ -352,7 +352,7 @@
% my $tt = $train->{type} // $train->{rawType} // 'Zug';
% $tt =~ s{ .*|[0-9]}{};
% if ($tt ne 'Zug') {
- <li><a href="<%= url_for('train', train => "$tt $train_no")->query({detailed => param('detailed'), past => param('past'), rt => param('rt')}) %>"><%= $tt %> <%= $train_no %></a>
+ <li><a href="<%= url_for('train', train => "$tt $train_no")->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>"><%= $tt %> <%= $train_no %></a>
% }
% else {
<li><%= $tt %> <%= $train_no %>
@@ -377,7 +377,7 @@
% my $tt = $train->{type} // $train->{rawType} // 'Zug';
% $tt =~ s{ .*|[0-9]}{};
% if ($tt ne 'Zug') {
- <li><a href="<%= url_for('train', train => "$tt $train_no")->query({detailed => param('detailed'), past => param('past'), rt => param('rt')}) %>"><%= $tt %> <%= $train_no %></a>
+ <li><a href="<%= url_for('train', train => "$tt $train_no")->query({detailed => param('detailed'), past => param('past'), rt => param('rt'), hafas => param('hafas')}) %>"><%= $tt %> <%= $train_no %></a>
% }
% else {
<li><%= $tt %> <%= $train_no %>
diff --git a/templates/app.html.ep b/templates/app.html.ep
index 6062905..360a2f0 100644
--- a/templates/app.html.ep
+++ b/templates/app.html.ep
@@ -30,6 +30,9 @@
% $route_str .= $stop . ($via_cur < $via_max ? ' - ' : q{});
% }
<li
+% if (param('hafas')) {
+ data-jid="<%= $departure->{journey_id} %>"
+% }
data-train="<%= ($departure->{train_type} // q{}) %> <%= ($departure->{train_no} // $departure->{train} // q{}) %>"
data-line="<%= $departure->{train_type} %> <%= $departure->{train_line} // $departure->{train_no} %>"
data-no="<%= $departure->{train_line} ? $departure->{train_no} : q{} %>"
@@ -49,7 +52,12 @@
% else {
>
% }
- <a href="/z/<%= Mojo::Util::url_escape(($departure->{train_type} // q{}) . ' ' . ($departure->{train_no} // $departure->{train} // q{}) . '/' . ($departure->{station} // $station)) %>">
+% if (param('hafas')) {
+ <a href="/z/<%= Mojo::Util::url_escape($departure->{journey_id}) . '?hafas=1&highlight=' . Mojo::Util::url_escape($departure->{station} // $station) %>">
+% }
+% else {
+ <a href="/z/<%= Mojo::Util::url_escape(($departure->{train_type} // q{}) . ' ' . ($departure->{train_no} // $departure->{train} // q{})) . '/' . Mojo::Util::url_escape($departure->{station} // $station) %>">
+% }
<div class="anchor" id="<%= ($departure->{train_type} // q{x}) . ($departure->{train_no} // q{x}) %>"></div>
<div class="line <%= $departure->{linetype} %>">
% if ($departure->{train_type} and $departure->{train_no}) {
diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep
index 8d4b2df..4ed395c 100644
--- a/templates/layouts/app.html.ep
+++ b/templates/layouts/app.html.ep
@@ -193,6 +193,14 @@ Bitte eine Station aus der Liste auswählen</div>
</div>
<div class="field">
<div class="desc">
+ %= check_box 'hafas' => 1, id => 'id_hafas'
+ <label for="id_hafas">
+ Bus, Stadtbahn und weiteren Nahverkehr anzeigen (via DB HAFAS mgate)
+ </label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="desc">
Nur Züge über
</div>
<div>