departures: always allow backend switch; prefer name rather than ID

This commit is contained in:
Birte Kristina Friesel 2024-08-21 19:31:47 +02:00
parent e01b8c3c74
commit 4c7b3117cd
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -8,16 +8,16 @@
% }
</div>
<div class="col s4 center-align">
% my $self_link = url_for('sstation', station => param('station'));
% my $self_link = url_for('sstation', station => $station // param('station'));
% if (param('hafas')) {
<span class="btn-small disabled"><i class="material-icons left" aria-hidden="true">directions</i> <%= param('hafas') %></span>
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= param('hafas') %></a>
% }
% else {
% if ($user->{backend_id}) {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %></a>
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">directions</i><%= $user->{backend_name} %></a>
% }
% else {
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small"><i class="material-icons left" aria-hidden="true">train</i>DB</a>
<a href="/account/select_backend?redirect_to=<%= $self_link %>" class="btn-small btn-flat"><i class="material-icons left" aria-hidden="true">train</i>DB</a>
% }
% }
</div>