summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorCassidy Dingenskirchen <admin@15318.de>2023-10-22 16:24:29 +0200
committerCassidy Dingenskirchen <admin@15318.de>2023-10-22 16:24:29 +0200
commitc22df914908f3f9c7f54e9319dfa41e1ab792b93 (patch)
tree902dc7e68994183df44861213d83c8a43efef252 /templates
parent0504f1adcd12c573ab805894b96a7658e2cd74fa (diff)
connections: new look consistent with departure board
Diffstat (limited to 'templates')
-rw-r--r--templates/_connections.html.ep74
-rw-r--r--templates/_connections_hafas.html.ep59
2 files changed, 58 insertions, 75 deletions
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 @@
-<div><table class="striped"><tbody>
+<ul class="collection departures connections">
% for my $res (@{$connections}) {
% my ($train, $via, $via_arr, $load) = @{$res};
% $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{};
- % my $td_class = '';
+ % my $row_class = '';
% my $link_class = 'action-checkin';
% if ($train->is_cancelled) {
- % $td_class = 'cancelled';
+ % $row_class = 'cancelled';
% $link_class = 'action-cancelled-from';
% }
% if ($checkin_from) {
- <tr class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-ts="<%= ($train->sched_departure // $train->departure)->epoch %>" data-dest="<%= $via->{name} %>">
+ <li class="collection-item <%= $row_class %> <%= $link_class %>"
+ data-station="<%= $train->station_uic %>"
+ data-train="<%= $train->train_id %>"
+ data-ts="<%= ($train->sched_departure // $train->departure)->epoch %>"
+ data-dest="<%= $via->{name} %>">
% }
% else {
- <tr>
+ <li class="collection-item">
% }
- <td class="<%= $td_class %>">
- % if ($train->platform) {
- % if ($checkin_from) {
- <a>Gleis <%= $train->platform %></a>
- % }
- % else {
- Gleis <%= $train->platform %>
- % }
- <br/>
- % }
- % if ($checkin_from) {
- <a><%= $train->line %></a>
+ <a class="dep-time" href="#">
+ % if ($train->departure_is_cancelled) {
+ %= $train->sched_departure->strftime('%H:%M')
% }
% else {
- %= $train->line
+ %= $train->departure->strftime('%H:%M')
+ % }
+ % if ($via_arr) {
+ → <%= $via_arr %>
% }
- </td>
- <td class="<%= $td_class %>">
- % if ($checkin_from) {
- <a><%= $via->{name} %></a>
+ % if ($train->departure_delay) {
+ %= sprintf('(%+d)', $train->departure_delay)
+ % }
+ </a>
+ <span class="connect-platform-wrapper">
+ % if ($train->platform) {
+ <span>Gleis <%= $train->platform %></span>
+ % }
+ <span class="dep-line <%= (split(/ /, $train->line))[0] %>">
+ %= $train->line
+ </span>
+ </span>
+ <span class="dep-dest">
+ % 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}) {
<i class="material-icons tiny" aria-label="Ohne WLAN">portable_wifi_off</i>
% }
- </td>
- <td>
- % 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)
- % }
- </td>
- </tr>
+ </span>
+ </li>
% }
-</tbody></table></div>
+</ul>
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 @@
-<div><table class="striped"><tbody>
+<ul class="collection departures connections">
% for my $res (@{$connections}) {
% my ($train, $via, $via_arr) = @{$res};
% $via_arr = $via_arr ? $via_arr->strftime('%H:%M') : q{};
- % my $td_class = '';
+ % my $row_class = '';
% my $link_class = 'action-checkin';
% if ($train->is_cancelled) {
- % $td_class = 'cancelled';
+ % $row_class = 'cancelled';
% $link_class = 'action-cancelled-from';
% }
% if ($checkin_from) {
- <tr class="<%= $link_class %>" data-station="<%= $train->station_eva %>" data-train="<%= $train->id %>" data-ts="<%= ($train->sched_datetime // $train->datetime)->epoch %>" data-dest="<%= $via->{name} %>">
+ <li class="collection-item <%= $row_class %> <%= $link_class %>"
+ data-station="<%= $train->station_eva %>"
+ data-train="<%= $train->id %>"
+ data-ts="<%= ($train->sched_datetime // $train->datetime)->epoch %>"
+ data-dest="<%= $via->{name} %>">
% }
% else {
- <tr>
+ <li class="collection-item">
% }
- <td class="<%= $td_class %>">
- % if ($train->platform) {
- % if ($checkin_from) {
- <a>Gleis <%= $train->platform %></a>
- % }
- % else {
- Gleis <%= $train->platform %>
- % }
- <br/>
- % }
- % if ($checkin_from) {
- <a><%= $train->line %></a>
- % }
- % else {
- %= $train->line
- % }
- </td>
- <td class="<%= $td_class %>">
- % if ($checkin_from) {
- <a><%= $via->{name} %></a>
- % }
- % else {
- %= $via->{name}
- % }
- </td>
- <td>
+ <a class="dep-time" href="#">
% 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)
% }
- </td>
- </tr>
+ </a>
+ <span class="connect-platform-wrapper">
+ % if ($train->platform) {
+ <span>Gleis <%= $train->platform %></span>
+ % }
+ <span class="dep-line <%= (split(/ /, $train->line))[0] %>">
+ %= $train->line
+ </span>
+ </span>
+ <span class="dep-dest">
+ %= $via->{name}
+ </span>
+ </li>
% }
-</tbody></table></div>
+</ul>