diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-01-09 18:38:50 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-01-09 18:38:50 +0100 |
commit | 0cbfcf55948c1ec953a39942b47a1b60a276d572 (patch) | |
tree | 30f3bcef34246e854630f4f58e06ccd8bb7fb243 /templates | |
parent | d0891186b6e2d5baf7141c2ce0ecdfdc246097b2 (diff) |
Re-add train attributes4.14.7
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_attr.html.ep | 16 | ||||
-rw-r--r-- | templates/_train_details.html.ep | 8 |
2 files changed, 10 insertions, 14 deletions
diff --git a/templates/_train_attr.html.ep b/templates/_train_attr.html.ep index 4f7e9ca..dad21e4 100644 --- a/templates/_train_attr.html.ep +++ b/templates/_train_attr.html.ep @@ -1,19 +1,15 @@ -% if ($attr->{series}) { - <span>BR <%= $attr->{series} %> -% if ($attr->{series2}) { - + <%= $attr->{series2} %> -% } - </span> +% if ($attr->{vmax}) { + <span><%= $attr->{vmax} %> km/h</span> % } % if ($attr->{length}) { <span>⇤ <%= $attr->{length} %>m ⇥</span> % } -% if ($attr->{vmax}) { - <span><%= $attr->{vmax} %> km/h</span> +% if ($attr->{weight}) { + <span><%= $attr->{weight} %>t</span> % } % if ($attr->{brakingPercentage}) { <span>λ=<%= $attr->{brakingPercentage} %></span> % } -% if ($attr->{station} and $with_station) { - <span>ab <%= $attr->{station} %></span> +% if ($with_station and $attr->{range}[0]) { + <span>ab <%= $attr->{range}[0] %></span> % } diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 167068e..0484388 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -324,12 +324,12 @@ <div class="db-attr"><a href="https://lib.finalrewind.org/dbdb/db_umlauf/<%= $departure->{train_no} %>.svg">Umlaufplan</a> (ggf. fehlerhaft)</div> % } -% if ($details->{commonAttr}) { -% if ($details->{attrVariants} and (not $details->{commonAttr}{vmax} or not $details->{commonAttr}{brakingPercentage})) { +% if ($details->{attributes}) { +% if (@{$details->{attributes}} > 1) { <div class="db-attr"> Attribute: <ul> -% for my $attr (@{$details->{attrVariants} // [] }) { +% for my $attr (@{$details->{attributes}}) { <li><%= include '_train_attr', attr => $attr, with_station => 1 %></li> % } </ul> @@ -337,7 +337,7 @@ % } % else { <div class="db-attr"> -%= include '_train_attr', attr => $details->{commonAttr}, with_station => 0 +%= include '_train_attr', attr => $details->{attributes}[0], with_station => 0 </div> % } % } |