summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-07-25 18:08:26 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-07-25 18:08:26 +0200
commitf12d8515e95f4ecee0f3b8586f64b8fd997a4bd9 (patch)
tree735343c9918e23985b35c2cd9b542e31afe42945
parentb06177261061ab3e716743b5d5b57f6a6d8cc977 (diff)
backend selection: -v; mark active backend
-rw-r--r--sass/app.scss4
-rw-r--r--templates/_backend.html.ep22
2 files changed, 24 insertions, 2 deletions
diff --git a/sass/app.scss b/sass/app.scss
index f92d5dc..3009ac7 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -995,6 +995,10 @@ input[type="submit"]:active,
box-shadow: inset 0 3px 5px rgba(0,0,0,.125);
}
+.button-active {
+ font-weight: bold;
+}
+
.button-light {
color: $fg1;
background-color: $bg;
diff --git a/templates/_backend.html.ep b/templates/_backend.html.ep
index 159d325..2534e81 100644
--- a/templates/_backend.html.ep
+++ b/templates/_backend.html.ep
@@ -1,10 +1,28 @@
<div class="container">
<p>
- Die folgenden Backends werden derzeit unterstützt:
+ Das Backend bestimmt die Datenquelle für Stations- und Zuginformationen.
+ Innerhalb Deutschlands ist <strong>Deutsche Bahn</strong> meist eine gute Wahl: IRIS-TTS kennt ausschließlich Schienenverkehr im Bahnnetz, während HAFAS auch Nahverkehr unterstützt.
+ Die anderen Backends bieten sich für Fahrten im Ausland oder im zugehörigen Verkehrsverbund an und sind werden teils nicht perfekt unterstützt.
</p>
<p>
+ % my $prev_type = 'IRIS-TTS';
% for my $backend (@{$backends}) {
- <a class="button" href="<%= url_for(q{/})->query({ hafas => $backend->{hafas} ? $backend->{shortname} : q{} }) %>"><%= $backend->{name} %> (<%= $backend->{type} %>)</a>
+ % if ($backend->{type} ne $prev_type) {
+ % $prev_type = $backend->{type};
+ </p><p>
+ % }
+ % my $class = 'button';
+ % if (param('hafas')) {
+ % if ($backend->{hafas} and $backend->{shortname} eq param('hafas')) {
+ % $class .= ' button-active';
+ % }
+ % }
+ % else {
+ % if (not $backend->{hafas}) {
+ % $class .= ' button-active';
+ % }
+ % }
+ <a class="<%= $class %>" href="<%= url_for(q{/})->query({ hafas => $backend->{hafas} ? $backend->{shortname} : q{} }) %>"><%= $backend->{name} %> (<%= $backend->{type} %>)</a>
% }
</p>
</div>