diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-27 12:33:48 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-27 12:35:09 +0100 |
commit | b41a3523b369d178d3be23357ae9951e700cd821 (patch) | |
tree | 4e33102797e12fd2ace75ae305c80a7a3388fc65 /lib/DBInfoscreen/Controller/Map.pm | |
parent | 44a48a1b9526197fc0b9c38799a6117aafd5cb3c (diff) |
remove legacy map search / intersection views
Diffstat (limited to 'lib/DBInfoscreen/Controller/Map.pm')
-rw-r--r-- | lib/DBInfoscreen/Controller/Map.pm | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm index 9fb1e0e..e552a18 100644 --- a/lib/DBInfoscreen/Controller/Map.pm +++ b/lib/DBInfoscreen/Controller/Map.pm @@ -509,78 +509,4 @@ sub ajax_route { )->wait; } -sub search { - my ($self) = @_; - - my $t1 = $self->param('train1'); - my $t2 = $self->param('train2'); - - my $t1_data; - my $t2_data; - - my @requests; - - if ( not( $t1 and $t1 =~ m{^\S+\s+\d+$} ) - or ( $t2 and not $t2 =~ m{^\S+\s+\d+$} ) ) - { - $self->render( - 'trainsearch', - title => 'Fahrtverlauf', - hide_opts => 1, - error => $t1 - ? "Züge müssen im Format 'Zugtyp Nummer' angegeben werden, z.B. 'RE 1234'" - : undef, - ); - return; - } - - $self->render_later; - - push( @requests, $self->hafas->trainsearch_p( train_no => $t1 ) ); - - if ($t2) { - push( @requests, $self->hafas->trainsearch_p( train_no => $t2 ) ); - } - - Mojo::Promise->all(@requests)->then( - sub { - my ( $t1_data, $t2_data ) = @_; - - if ($t2_data) { - $self->redirect_to( - sprintf( - "/intersection/%s,0;%s,0", - $t1_data->[0]{trip_id}, - $t2_data->[0]{trip_id}, - ) - ); - } - else { - $self->redirect_to( - sprintf( "/map/%s/0", $t1_data->[0]{trip_id}, ) ); - } - } - )->catch( - sub { - my ($err) = @_; - $self->render( - 'trainsearch', - title => 'Fahrtverlauf', - hide_opts => 1, - error => $err - ); - } - )->wait; -} - -sub search_form { - my ($self) = @_; - - $self->render( - 'trainsearch', - title => 'Fahrtverlauf', - hide_opts => 1, - ); -} - 1; |