From c22df914908f3f9c7f54e9319dfa41e1ab792b93 Mon Sep 17 00:00:00 2001 From: Cassidy Dingenskirchen Date: Sun, 22 Oct 2023 16:24:29 +0200 Subject: connections: new look consistent with departure board --- sass/src/common/local.scss | 20 +++++++++- templates/_connections.html.ep | 74 +++++++++++++++++------------------- templates/_connections_hafas.html.ep | 59 ++++++++++++---------------- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/sass/src/common/local.scss b/sass/src/common/local.scss index 3008c54..d5e4598 100644 --- a/sass/src/common/local.scss +++ b/sass/src/common/local.scss @@ -86,12 +86,23 @@ ul.suggestions { } .dep-time::after { content: " ⊖"; + font-style: normal; } } } + +.departures.connections { + li { + grid-template-columns: 15ch 10ch 1fr; + } + .connect-platform-wrapper { + text-align: center; + span { + display: block; } } } + .followee-checkin { font-size: 0.9rem; display: block; @@ -182,10 +193,9 @@ ul.suggestions { @media screen and (max-width: 600px) { .departures li { - .dep-line, .dep-time { grid-template-columns: 10ch 1fr; + .dep-line, .dep-time, .connect-platform-wrapper { grid-column: 1; - margin-right: 0.8rem; text-align: center; } .dep-dest { @@ -193,4 +203,10 @@ ul.suggestions { grid-row: 1 / span 2; } } + .departures.connections li { + grid-template-columns: 15ch 1fr; + .connect-platform-wrapper span { + display: inline; + } + } } diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index cd64150..2a89d9b 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -1,39 +1,48 @@ -
+ + +
  • % } -
  • - - - + + % } -
    - % if ($train->platform) { - % if ($checkin_from) { - Gleis <%= $train->platform %> - % } - % else { - Gleis <%= $train->platform %> - % } -
    - % } - % if ($checkin_from) { - <%= $train->line %> + + % if ($train->departure_is_cancelled) { + %= $train->sched_departure->strftime('%H:%M') % } % else { - %= $train->line + %= $train->departure->strftime('%H:%M') + % } + % if ($via_arr) { + → <%= $via_arr %> % } -
    - % if ($checkin_from) { - <%= $via->{name} %> + % if ($train->departure_delay) { + %= sprintf('(%+d)', $train->departure_delay) + % } + + + % if ($train->platform) { + Gleis <%= $train->platform %> + % } + + %= $train->line + + + + % if ($train->is_cancelled) { + Fahrt nach <%= $via->{name} %> entfällt % } % else { %= $via->{name} @@ -61,22 +70,7 @@ % if ($train->{message_id}{70} or $train->{message_id}{71}) { portable_wifi_off % } - - % if ($train->departure_is_cancelled) { - %= $train->sched_departure->strftime('%H:%M') - ⊖ - % } - % else { - %= $train->departure->strftime('%H:%M') - % } - % if ($via_arr) { - → <%= $via_arr %> - % } - % if ($train->departure_delay) { - %= sprintf('(%+d)', $train->departure_delay) - % } -
    + diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index 48a5380..7a7b656 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -1,48 +1,26 @@ -
    + + +
  • % } -
  • - - - + + + % if ($train->platform) { + Gleis <%= $train->platform %> + % } + + %= $train->line + + + + %= $via->{name} + + % } -
    - % if ($train->platform) { - % if ($checkin_from) { - Gleis <%= $train->platform %> - % } - % else { - Gleis <%= $train->platform %> - % } -
    - % } - % if ($checkin_from) { - <%= $train->line %> - % } - % else { - %= $train->line - % } -
    - % if ($checkin_from) { - <%= $via->{name} %> - % } - % else { - %= $via->{name} - % } - + % if ($train->is_cancelled) { %= $train->sched_datetime->strftime('%H:%M') - ⊖ % } % else { %= $train->datetime->strftime('%H:%M') @@ -53,7 +31,18 @@ % if ($train->delay) { %= sprintf('(%+d)', $train->delay) % } -
    + -- cgit v1.2.3