diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-18 19:17:10 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-18 19:17:10 +0200 |
commit | 4dda0fd251e6c82c73cf7ae280caf1ae94d3012e (patch) | |
tree | f0301daaac4af07af8e5507d08cce8f1f05c0397 /templates | |
parent | d8ffb5163a0f4bf543e5b026879cfff8ada0ab52 (diff) |
Add preliminary EFA support
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 8 | ||||
-rw-r--r-- | templates/layouts/app.html.ep | 3 | ||||
-rw-r--r-- | templates/select_backend.html.ep | 11 |
3 files changed, 14 insertions, 8 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index a02336b..dab05d0 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -2,8 +2,8 @@ <div> % if ($departure->{train_no} or $departure->{train_line}) { <span class="train-line <%= $linetype %>"><%= $departure->{train_type} %> - - <%= $departure->{train_line} // $departure->{train_no} %></span> + %= $departure->{train_line} // $departure->{train_no} + </span> <span class="train-no"><%= $departure->{train_line} ? $departure->{train_no} : q{} %></span> % } </div> @@ -145,10 +145,10 @@ <div class="verbose"> % if ($departure->{trip_id}) { % if (stash('station_name')) { - <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?from=<%= stash('station_name') %>&hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> + <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?from=<%= stash('station_name') %>&efa=<%= param('efa') // q{} %>&hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> % } % else { - <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> + <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} || 0 %>?efa=<%= param('efa') // q{} %>&hafas=<%= param('hafas') // q{} %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a> % } % } % if ($departure->{wr_link}) { diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep index 685f31a..cc13143 100644 --- a/templates/layouts/app.html.ep +++ b/templates/layouts/app.html.ep @@ -117,6 +117,7 @@ Bitte eine Station aus der Liste auswählen</div> %= form_for _redirect => begin +%= hidden_field efa => param('efa') %= hidden_field hafas => param('hafas') <div> <div class="field"> @@ -142,7 +143,7 @@ Bitte eine Station aus der Liste auswählen</div> </div> % } <div class="backendlink"> - <a class="button button-light" href="<%= url_for('_backend')->query({hafas => param('hafas')}) %>">Backend: <%= param('hafas') ? param('hafas') . ' (HAFAS)' : 'DB (IRIS-TTS)' %></a> + <a class="button button-light" href="<%= url_for('_backend')->query({efa => param('efa'), hafas => param('hafas')}) %>">Backend: <%= param('efa') ? param('efa') . ' (EFA)' : param('hafas') ? param('hafas') . ' (HAFAS)' : 'DB (IRIS-TTS)' %></a> </div> <div class="break"></div> <div class="moresettings-header moresettings-header-collapsed button button-light">Weitere Einstellungen</div> diff --git a/templates/select_backend.html.ep b/templates/select_backend.html.ep index 836e5c7..2603800 100644 --- a/templates/select_backend.html.ep +++ b/templates/select_backend.html.ep @@ -14,17 +14,22 @@ <%= $prev_type %>:<br/> % } % my $class = 'button'; - % if (param('hafas')) { + % if (param('efa')) { + % if ($backend->{efa} and $backend->{shortname} eq param('efa')) { + % $class .= ' button-active'; + % } + % } + % elsif (param('hafas')) { % if ($backend->{hafas} and $backend->{shortname} eq param('hafas')) { % $class .= ' button-active'; % } % } % else { - % if (not $backend->{hafas}) { + % if (not ($backend->{efa} or $backend->{hafas})) { % $class .= ' button-active'; % } % } - <a class="<%= $class %>" href="<%= url_for(q{/})->query({ hafas => $backend->{hafas} ? $backend->{shortname} : q{} }) %>"><%= $backend->{shortname} // 'IRIS-TTS' %> – <%= $backend->{name} %></a> + <a class="<%= $class %>" href="<%= url_for(q{/})->query({ efa => $backend->{efa} ? $backend->{shortname} : q{}, hafas => $backend->{hafas} ? $backend->{shortname} : q{} }) %>"><%= $backend->{shortname} // 'IRIS-TTS' %> – <%= $backend->{name} %></a> % if ($backend->{has_area}) { <a href="/coverage/<%= $backend->{type} %>/<%= $backend->{shortname} %>"><%= join(q{, }, @{$backend->{regions}}) || '[Karte]' %></a> % } |