diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-01-29 17:40:27 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-01-29 17:40:27 +0100 |
commit | 6526ae6a64c14f9d64a791b778b157f502a5aa0a (patch) | |
tree | 1d31b11010b2e3ae8d6f0fdc24315888cefbf692 /templates/app.html.ep | |
parent | a32109701fc567defbd6673e9cdf6bdf10b83ec7 (diff) |
add hafas (bus, ubahn, tram) support
Diffstat (limited to 'templates/app.html.ep')
-rw-r--r-- | templates/app.html.ep | 10 |
1 files changed, 9 insertions, 1 deletions
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}) { |