diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-23 22:44:02 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-23 22:44:02 +0200 |
commit | 520e6456001cf858d7e59606a77b1cf0ab115aa9 (patch) | |
tree | b8fa0927e5ee6e06fc77b791817db89c1ffa8669 /templates | |
parent | 1a185897e271a9c6471071d8b9b70a5fed16e596 (diff) |
Suggest backends based on coverage and latest checkout coordinates
References #156
Diffstat (limited to 'templates')
-rw-r--r-- | templates/select_backend.html.ep | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/templates/select_backend.html.ep b/templates/select_backend.html.ep index d5bc9d5..55182f9 100644 --- a/templates/select_backend.html.ep +++ b/templates/select_backend.html.ep @@ -14,6 +14,45 @@ % if (stash('redirect_to')) { %= hidden_field 'redirect_to' => stash('redirect_to') % } + % if (@{stash('suggestions') // []}) { + <div class="row"> + <div class="col s12"> + <h3>Vorschläge</h3> + </div> + </div> + % for my $backend (@{ stash('suggestions') // [] }) { + <div class="row"> + <div class="col s8 m6 l6 right-align"> + %= $backend->{longname} + % if ($backend->{id} == $user->{backend_id}) { + (aktuell ausgewählt) + % } + % if ($backend->{has_area}) { + <br/> + <a href="https://dbf.finalrewind.org/coverage/HAFAS/<%= $backend->{name} %>"><%= join(q{, }, @{$backend->{regions} // []}) || '[Karte]' %></a> + % } + % elsif ($backend->{regions}) { + <br/> + %= join(q{, }, @{$backend->{regions} // []}) + % } + % if ($backend->{homepage}) { + <br/> + <a href="<%= $backend->{homepage} %>"><%= $backend->{homepage} =~ s{ ^ http s? :// (?: www[.] )? (.*?) (?: / )? $ }{$1}xr %></a> + % } + </div> + <div class="col s4 m6 l6 left-align"> + <button class="btn waves-effect waves-light <%= $backend->{id} == $user->{backend_id} ? 'disabled' : q{} %>" style="min-width: 6em;" type="submit" name="backend" value="<%= $backend->{id} %>"> + <%= $backend->{name} %> + </button> + </div> + </div> + % } + % } + <div class="row"> + <div class="col s12"> + <h3>Alle Backends</h3> + </div> + </div> % for my $backend (@{ stash('backends') // [] }) { <div class="row"> <div class="col s8 m6 l6 right-align"> |