backend selection: add homepage links
This commit is contained in:
parent
e2b5365810
commit
897b88691c
2 changed files with 13 additions and 10 deletions
|
@ -1008,13 +1008,16 @@ sub backend_form {
|
||||||
for my $backend (@backends) {
|
for my $backend (@backends) {
|
||||||
my $type = 'UNKNOWN';
|
my $type = 'UNKNOWN';
|
||||||
if ( $backend->{iris} ) {
|
if ( $backend->{iris} ) {
|
||||||
$type = 'IRIS-TTS';
|
$type = 'IRIS-TTS';
|
||||||
$backend->{name} = 'DB';
|
$backend->{name} = 'DB';
|
||||||
|
$backend->{longname} = 'Deutsche Bahn';
|
||||||
|
$backend->{homepage} = 'https://www.bahn.de';
|
||||||
}
|
}
|
||||||
elsif ( $backend->{hafas} ) {
|
elsif ( $backend->{hafas} ) {
|
||||||
if ( my $s = $self->hafas->get_service( $backend->{name} ) ) {
|
if ( my $s = $self->hafas->get_service( $backend->{name} ) ) {
|
||||||
$type = 'HAFAS';
|
$type = 'HAFAS';
|
||||||
$backend->{longname} = $s->{name};
|
$backend->{longname} = $s->{name};
|
||||||
|
$backend->{homepage} = $s->{homepage};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$type = undef;
|
$type = undef;
|
||||||
|
|
|
@ -16,19 +16,19 @@
|
||||||
% }
|
% }
|
||||||
% for my $backend (@{ stash('backends') // [] }) {
|
% for my $backend (@{ stash('backends') // [] }) {
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s12 m4 l4 center-align">
|
<div class="col s8 m6 l6 right-align">
|
||||||
<button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" type="submit" name="backend" value="<%= $backend->{id} %>">
|
|
||||||
<%= $backend->{name} %> (<%= $backend->{type} %>)
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="col s12 m8 l8">
|
|
||||||
% if ($backend->{longname}) {
|
% if ($backend->{longname}) {
|
||||||
<%= $backend->{longname} %>
|
<a href="<%= $backend->{homepage} %>"><%= $backend->{longname} %></a>
|
||||||
% }
|
% }
|
||||||
% if ($backend->{id} == $user->{backend_id}) {
|
% if ($backend->{id} == $user->{backend_id}) {
|
||||||
(aktuell ausgewählt)
|
(aktuell ausgewählt)
|
||||||
% }
|
% }
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s4 m6 l6 left-align">
|
||||||
|
<button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" type="submit" name="backend" value="<%= $backend->{id} %>">
|
||||||
|
<%= $backend->{name} %> (<%= $backend->{type} %>)
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
% }
|
% }
|
||||||
%= end
|
%= end
|
||||||
|
|
Loading…
Reference in a new issue