summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-29 13:38:53 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-29 13:38:53 +0100
commit2e7a6265a666b7e61ff21f5d8a05f54cf2ecefe3 (patch)
tree53465d4475ec0b5a74ac60b7bfe68d55931ae97f
parentee760551ec9bde73e0355cab6cb2d6a2b21a1758 (diff)
wagon order: indicate closed wagons
-rw-r--r--cpanfile2
-rw-r--r--sass/app.scss3
-rw-r--r--sass/dark.scss1
-rw-r--r--sass/light.scss1
-rw-r--r--templates/_train_details.html.ep7
-rw-r--r--templates/_wagon.html.ep6
6 files changed, 18 insertions, 2 deletions
diff --git a/cpanfile b/cpanfile
index 127bda2..06418d5 100644
--- a/cpanfile
+++ b/cpanfile
@@ -10,7 +10,7 @@ requires 'List::UtilsBy';
requires 'LWP::UserAgent';
requires 'LWP::Protocol::https';
requires 'Mojolicious';
-requires 'Travel::Status::DE::DBWagenreihung', '0.06';
+requires 'Travel::Status::DE::DBWagenreihung', '0.12';
requires 'Travel::Status::DE::HAFAS', '>= 5.06';
requires 'Travel::Status::DE::IRIS';
requires 'XML::LibXML';
diff --git a/sass/app.scss b/sass/app.scss
index f72203e..d8052f1 100644
--- a/sass/app.scss
+++ b/sass/app.scss
@@ -143,6 +143,9 @@ div.content {
background-color: $powercar-wagon-color;
}
+ .closed {
+ background-color: $closed-wagon-color;
+ }
.nondestwagon {
border-style: dashed;
diff --git a/sass/dark.scss b/sass/dark.scss
index 72a6927..83cb520 100644
--- a/sass/dark.scss
+++ b/sass/dark.scss
@@ -44,6 +44,7 @@ $past-bg-color: $bg05;
$firstclass-wagon-color: #333300;
$powercar-wagon-color: #222222;
+$closed-wagon-color: #222222;
$button-hover: #111111;
$button-hover-border: #333333;
diff --git a/sass/light.scss b/sass/light.scss
index 809c8ce..d8f53cb 100644
--- a/sass/light.scss
+++ b/sass/light.scss
@@ -44,6 +44,7 @@ $past-bg-color: $bg05;
$firstclass-wagon-color: #ffff99;
$powercar-wagon-color: #cccccc;
+$closed-wagon-color: #dddddd;
$button-hover: #e6e6e6;
$button-hover-border: #adadad;
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep
index 24d2d55..d5325c5 100644
--- a/templates/_train_details.html.ep
+++ b/templates/_train_details.html.ep
@@ -128,7 +128,12 @@
% if (defined $gi and $gi != $wagon->group_index) {
% }
-%= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : '?' )
+% if ($wagon->is_closed) {
+ X
+% }
+% else {
+%= $wagon->number || ($wagon->type =~ m{AB} ? '½' : $wagon->type =~ m{A} ? '1.' : $wagon->type =~ m{B} ? '2.' : $wagon->type )
+% }
% }
% $gi = $wagon->group_index;
% }
diff --git a/templates/_wagon.html.ep b/templates/_wagon.html.ep
index 94ef56a..2f5a0df 100644
--- a/templates/_wagon.html.ep
+++ b/templates/_wagon.html.ep
@@ -6,6 +6,9 @@
% if ($wagon->is_locomotive or $wagon->is_powercar) {
% $extra_class .= ' powercar';
% }
+% if ($wagon->is_closed) {
+% $extra_class .= ' closed';
+% }
% if ($wagon->train_no ne $train_no) {
% $extra_class .= ' nondestwagon';
% }
@@ -13,6 +16,9 @@
top: <%= $wagon->{position}{start_percent} %>%; bottom: <%= 100 - $wagon->{position}{end_percent} %>%; <%= $bg %>">
% if ($wagon->is_locomotive or $wagon->is_powercar) {
% }
+% elsif ($wagon->is_closed) {
+ X
+% }
% else {
%= $wagon->number // '?'
% if ($wagon->has_accessibility) {