Unverified Commit 2558df1b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

add a prominent backend selection link

parent fe303734
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -301,6 +301,8 @@ sub startup {

	$r->get('/_autostop')->to('static#geostop');

	$r->get('/_backend')->to('stationboard#backend_list');

	$r->get('/_datenschutz')->to('static#privacy');

	$r->post('/_geolocation')->to('stationboard#stations_by_coordinates');
+29 −0
Original line number Diff line number Diff line
@@ -2141,6 +2141,35 @@ sub stations_by_coordinates {
	)->wait;
}

sub backend_list {
	my ($self) = @_;

	my @backends = (
		{
			name => 'Deutsche Bahn',
			type => 'IRIS-TTS',
		}
	);

	for my $backend ( Travel::Status::DE::HAFAS::get_services() ) {
		push(
			@backends,
			{
				name      => $backend->{name},
				shortname => $backend->{shortname},
				type      => 'HAFAS',
				hafas     => 1,
			}
		);
	}

	$self->render(
		'_backend',
		backends  => \@backends,
		hide_opts => 1
	);
}

sub autocomplete {
	my ($self) = @_;

+4 −0
Original line number Diff line number Diff line
@@ -1010,6 +1010,10 @@ input[type="submit"]:active,
	border-color: $button-hover-border;
}

div.backendlink {
	margin-top: 1ex;
}

div.notes {
	margin-top: 2em;
}
+10 −0
Original line number Diff line number Diff line
<div class="container">
	<p>
		Die folgenden Backends werden derzeit unterstützt:
	</p>
	<p>
		% for my $backend (@{$backends}) {
			<a class="button" href="<%= url_for(q{/})->query({ hafas => $backend->{hafas} ? $backend->{shortname} : q{} }) %>"><%= $backend->{name} %> (<%= $backend->{type} %>)</a>
		% }
	</p>
</div>
+3 −0
Original line number Diff line number Diff line
@@ -141,6 +141,9 @@ Bitte eine Station aus der Liste auswählen</div>
      <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https')->query({hafas => param('hafas')}) %>">Stationen in der Umgebung suchen</a>
    </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>
  </div>
  <div class="break"></div>
  <div class="moresettings-header moresettings-header-collapsed button button-light">Weitere Einstellungen</div>
  <div class="moresettings moresettings-collapsed">