From a578f8f66613a9428617338f8270b9be21c7816b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Dec 2019 23:06:12 +0100 Subject: use CSS classes for wagonorder template (1/2) --- public/static/css/app.css | 65 ++++++++++++++++++++++++++++++++++++++++++ templates/wagenreihung.html.ep | 25 +++++++--------- 2 files changed, 76 insertions(+), 14 deletions(-) diff --git a/public/static/css/app.css b/public/static/css/app.css index 1565202..3e4b3bd 100644 --- a/public/static/css/app.css +++ b/public/static/css/app.css @@ -29,6 +29,71 @@ div.content { margin: 0; } +.wagonorder { + position: relative; + width: 100%; + height: 100ex; +} + +.wagonorder .section { + position: absolute; + left: 1em; + width: 2em; + text-align: center; +} + +.wagonorder .direction { + position: absolute; + left: 10em; +} + +.wagonorder .wagon { + position: absolute; + left: 3em; + min-width: 6em; + border: 1px solid #999999; + padding-left: 0.2em; + padding-right: 0.2em; +} + +.wagonorder .wagon ~ .wagon { + border-top: none; +} + +.wagonorder .details { + position: absolute; + left: 11em; + right: 0em; +} + +.wagonorder .details .firstclass { + display: inline-block; + width: 0.8em; + text-align: center; + color: #ffffff; + background-color: #666666; + border: 1px solid #666666; +} + +.wagonorder .details .secondclass { + display: inline-block; + width: 0.8em; + text-align: center; + color: #666666; + border: 1px solid #666666; +} + +.wagonorder .details .noclass { + display: inline-block; + width: 0.8em; +} + +.wagonorder .details .type { + display: inline-block; + width: 5em; + color: #666666; +} + div.app { border-width:1px 2px; width:100%; diff --git a/templates/wagenreihung.html.ep b/templates/wagenreihung.html.ep index 3b403cb..b14c2dc 100644 --- a/templates/wagenreihung.html.ep +++ b/templates/wagenreihung.html.ep @@ -20,11 +20,11 @@
-
+
% if (not $wr->has_bad_wagons) { % for my $section ($wr->sections) { -
+
%= $section->{name}
% } @@ -37,7 +37,7 @@ % if ($wagon->is_locomotive or $wagon->is_powercar) { % $bg = 'background-color: #cccccc;'; % } -
% if ($wr->has_bad_wagons) { % } @@ -48,12 +48,9 @@ ↑ % }
-
+
% if ($wagon->is_locomotive or $wagon->is_powercar) { - LOK % } % else { %= $wagon->number // '?' @@ -80,18 +77,18 @@ % } % }
-
% if ($wagon->is_first_class) { - 1 + 1 % } % elsif ($wagon->is_second_class) { - 2 + 2 % } % else { - + % } - + %= $wagon->type % my $uic_id = $wagon->uic_id; -- cgit v1.2.3