diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 19:11:52 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-12-21 19:11:52 +0100 |
commit | f9d1ea47ff7a444f4468aa4fbfade1120d500066 (patch) | |
tree | 661a76f6af08c97a7b8a23d7391b908064a2287f /templates/_train_details.html.ep | |
parent | 1a6c3ad4ee00a22c684a4142784fc5e2d1a2bc26 (diff) |
keep detailed mode when following links; show train attributes in detailed mode3.8.1
Diffstat (limited to 'templates/_train_details.html.ep')
-rw-r--r-- | templates/_train_details.html.ep | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 4b85845..fc77d27 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -228,7 +228,24 @@ % } </ul> <!-- mroute --> % } -% if ($details and not $departure->{arrival}) { +% if (param('detailed') and $details->{commonAttr}) { +% if ($details->{attrVariants} and (not $details->{commonAttr}{vmax} or not $details->{commonAttr}{brakingPercentage})) { + <div class="db-attr"> + Attribute: + <ul> +% for my $attr (@{$details->{attrVariants} // [] }) { + <li><%= include '_train_attr', attr => $attr, with_station => 1 %></li> +% } + </ul> + </div> +% } +% else { + <div class="db-attr"> +%= include '_train_attr', attr => $details->{commonAttr}, with_station => 0 + </div> +% } +% } +% if (param('detailed') and $details and not $departure->{arrival}) { % if (my $s = $details->{route}{preStart}) { Zug wird voraussichtlich aus <%= $s %> eingesetzt.<br/><br/> % } @@ -237,7 +254,7 @@ <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{from} // [] }) { % my $train = app->train_details_db->{$train_no}; -% my $tt = $train->{type} // $train->{raw} // 'Zug'; +% my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> % if ($train->{route}{start} and $train->{route}{end}) { @@ -248,7 +265,7 @@ </ul> % } % } -% elsif ($details and not $departure->{departure}) { +% elsif (param('detailed') and $details and not $departure->{departure}) { % if (my $e = $details->{route}{postEnd}) { Zug wird voraussichtlich in <%= $e %> abgestellt.<br/><br/> % } @@ -257,7 +274,7 @@ <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{to} // [] }) { % my $train = app->train_details_db->{$train_no}; -% my $tt = $train->{type} // $train->{raw} // 'Zug'; +% my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> % if ($train->{route}{start} and $train->{route}{end}) { |