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 | |
parent | 1a6c3ad4ee00a22c684a4142784fc5e2d1a2bc26 (diff) |
keep detailed mode when following links; show train attributes in detailed mode3.8.1
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 25 | ||||
-rw-r--r-- | templates/layouts/app.html.ep | 2 | ||||
-rw-r--r-- | templates/layouts/legacy.html.ep | 2 |
3 files changed, 23 insertions, 6 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}) { diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep index e7106dc..4069432 100644 --- a/templates/layouts/app.html.ep +++ b/templates/layouts/app.html.ep @@ -18,7 +18,7 @@ <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> % } - % my $av = 'v41'; # asset version + % my $av = 'v42'; # asset version % if (session('theme') and session('theme') eq 'dark' or param('dark')) { %= stylesheet "/static/${av}/css/dark.min.css", id => 'theme' % } diff --git a/templates/layouts/legacy.html.ep b/templates/layouts/legacy.html.ep index ab63e80..1ea4b67 100644 --- a/templates/layouts/legacy.html.ep +++ b/templates/layouts/legacy.html.ep @@ -17,7 +17,7 @@ <meta http-equiv="refresh" content="<%= $self->stash('refresh_interval') %>"/> % } - % my $av = 'v41'; # asset version + % my $av = 'v42'; # asset version %= stylesheet "/static/${av}/css/default.css" %= stylesheet "/static/${av}/css/material-icons.css" %= stylesheet "/static/${av}/css/jquery-ui.min.css" |