diff options
| -rw-r--r-- | lib/DBInfoscreen/Controller/Wagenreihung.pm | 20 | ||||
| -rw-r--r-- | templates/_train_details.html.ep | 2 | ||||
| -rw-r--r-- | templates/wagen.html.ep | 14 | 
3 files changed, 32 insertions, 4 deletions
| diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index daa2cda..c2d7f7e 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -82,6 +82,7 @@ sub wagenreihung {  	my ($self)    = @_;  	my $train     = $self->stash('train');  	my $departure = $self->stash('departure'); +	my $exit_side = $self->param('e');  	$self->render_later; @@ -119,6 +120,7 @@ sub wagenreihung {  			my $wref = {  				d  => $wr->direction, +				e  => $exit_side ? substr( $exit_side, 0, 1 ) : '',  				tt => $wr->train_type,  				tn => $train,  				s  => $wr->station_name, @@ -193,6 +195,24 @@ sub wagen {  		}  	} +	if ( defined $wref->{d} and $wref->{e} ) { +		if ( $wref->{d} == 0 and $wref->{e} eq 'l' ) { +			$wref->{e} = 'u'; +		} +		elsif ( $wref->{d} == 0 and $wref->{e} eq 'r' ) { +			$wref->{e} = 'd'; +		} +		elsif ( $wref->{d} == 100 and $wref->{e} eq 'l' ) { +			$wref->{e} = 'd'; +		} +		elsif ( $wref->{d} == 100 and $wref->{e} eq 'r' ) { +			$wref->{e} = 'u'; +		} +	} +	else { +		$wref->{e} = ''; +	} +  	$self->render(  		'wagen',  		title      => $title, diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 138c877..77a61ba 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -113,7 +113,7 @@          <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= $station_name %>"><i class="material-icons" aria-hidden="true">map</i> Karte</a>  %     }  %     if ($departure->{wr_link}) { -        <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>"><i class="material-icons" aria-hidden="true">train</i> Wagenreihung +        <a class="smallbutton" href="/_wr/<%= $departure->{train_no} %>/<%= $departure->{wr_link} %>?e=<%= $departure->{direction} // '' %>"><i class="material-icons" aria-hidden="true">train</i> Wagenreihung          </a>  %     }  %     elsif ($icetype and $icetype->[2] and ($linetype eq 'fern' or $departure->{train_type} =~ m{NJ})) { diff --git a/templates/wagen.html.ep b/templates/wagen.html.ep index 68cf221..9cf4793 100644 --- a/templates/wagen.html.ep +++ b/templates/wagen.html.ep @@ -6,7 +6,7 @@  	% }  	% if (defined $wref->{d}) {  		<div style="text-align: center;"> -			% if ($wref->{d} == 100) { +			% if ($wref->{d} == 0) {  				<i class="material-icons">arrow_back</i>  			% }  			% else { @@ -14,12 +14,20 @@  			% }  		</div>  	% } -	<div> +	% if ($wref->{e} eq 'u') { +		<div style="float: left;"><i class="material-icons">arrow_upward</i></div> +		<div style="float: right;"><i class="material-icons">arrow_upward</i></div> +	% } +	<div style="clear: both;">  		<a href="<%= $wagon_file %>"><img src="<%= $wagon_file %>" style="width: 100%;"></a>  	</div> +	% if ($wref->{e} eq 'd') { +		<div style="float: left;"><i class="material-icons">arrow_downward</i></div> +		<div style="float: right;"><i class="material-icons">arrow_downward</i></div> +	% }  	% if (defined $wref->{d}) {  		<div style="text-align: center;"> -			% if ($wref->{d} == 100) { +			% if ($wref->{d} == 0) {  				<i class="material-icons">arrow_back</i>  			% }  			% else { | 
