From 0f9dde3810a3b86e0769e6013a19ccf0faeba0a3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 25 Dec 2020 17:27:57 +0100 Subject: add wagon images for IC and ICE 1/2/4 IC2, ICE 3 and ICE T will follow soon. --- templates/_wagon.html.ep | 11 ++++++++--- templates/layouts/app.html.ep | 2 +- templates/layouts/legacy.html.ep | 2 +- templates/wagen.html.ep | 17 +++++++++++++++++ templates/wagenreihung.html.ep | 2 +- templates/zugbildung_db.html.ep | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 templates/wagen.html.ep (limited to 'templates') diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep index 95b1c2e..a9221bd 100644 --- a/templates/_wagon.html.ep +++ b/templates/_wagon.html.ep @@ -50,9 +50,14 @@
- -%= $wagon->type - +% if (my $img = wagon_image($type, $wagon->type, $wagon->uic_id)) { + <%= $wagon->type %> +% } +% else { + +%= $wagon->type + +% } % my $uic_id = $wagon->uic_id; % if (length($uic_id) != 12) { <%= $uic_id %> diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep index e45a4dd..b776d21 100644 --- a/templates/layouts/app.html.ep +++ b/templates/layouts/app.html.ep @@ -18,7 +18,7 @@ % } - % my $av = 'v42'; # asset version + % my $av = 'v43'; # 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 1ea4b67..a861488 100644 --- a/templates/layouts/legacy.html.ep +++ b/templates/layouts/legacy.html.ep @@ -17,7 +17,7 @@ % } - % my $av = 'v42'; # asset version + % my $av = 'v43'; # asset version %= stylesheet "/static/${av}/css/default.css" %= stylesheet "/static/${av}/css/material-icons.css" %= stylesheet "/static/${av}/css/jquery-ui.min.css" diff --git a/templates/wagen.html.ep b/templates/wagen.html.ep new file mode 100644 index 0000000..49a7274 --- /dev/null +++ b/templates/wagen.html.ep @@ -0,0 +1,17 @@ +
+
+ +
+

+ % if ($wref->{s} and $wref->{p} and $wref->{ws}) { + Position in <%= $wref->{s} %>: Gleis <%= $wref->{p} %> Abschnitt <%= $wref->{ws} %> + % } + % elsif ($wref->{s} and $wref->{p}) { + <%= $wref->{s} %> Gleis <%= $wref->{p} %> + % } +

+ +
diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 512c30c..38987a9 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -60,7 +60,7 @@ % } % } % for my $wagon ($wr->wagons) { -%= include '_wagon', direction => $wr->direction, wagon => $wagon; +%= include '_wagon', direction => $wr->direction, wagon => $wagon, type => $wr->train_subtype // 'IC', wref => $wref; % }