diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-10-20 18:04:32 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-10-20 18:04:32 +0200 |
commit | 1ba41db376e6875fa54278a41e253c34dc0f5c65 (patch) | |
tree | 4982fafcc95584b92403a15af9bc59ec6e38eb80 | |
parent | eb7000429eb07d564fed492b42f886dab6176264 (diff) |
frontend: add train timestamps to checkin action
(preparations for more flexible checkin time frames)
-rw-r--r-- | public/static/js/travelynx-actions.js | 2 | ||||
-rw-r--r-- | templates/_connections.html.ep | 2 | ||||
-rw-r--r-- | templates/_connections_hafas.html.ep | 2 | ||||
-rw-r--r-- | templates/_departures_hafas.html.ep | 2 | ||||
-rw-r--r-- | templates/_departures_iris.html.ep | 2 |
5 files changed, 6 insertions, 4 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index 437ad60..e4d69dc 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -185,6 +185,7 @@ function tvly_reg_handlers() { station: link.data('station'), train: link.data('train'), dest: link.data('dest'), + ts: link.data('ts'), }; tvly_run(link, req); }); @@ -223,6 +224,7 @@ function tvly_reg_handlers() { var req = { action: 'cancelled_from', station: link.data('station'), + ts: link.data('ts'), train: link.data('train'), }; tvly_run(link, req); diff --git a/templates/_connections.html.ep b/templates/_connections.html.ep index 98be766..cd64150 100644 --- a/templates/_connections.html.ep +++ b/templates/_connections.html.ep @@ -9,7 +9,7 @@ % $link_class = 'action-cancelled-from'; % } % if ($checkin_from) { - <tr class="<%= $link_class %>" data-station="<%= $train->station_uic %>" data-train="<%= $train->train_id %>" data-dest="<%= $via->{name} %>"> + <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} %>"> % } % else { <tr> diff --git a/templates/_connections_hafas.html.ep b/templates/_connections_hafas.html.ep index 9322116..48a5380 100644 --- a/templates/_connections_hafas.html.ep +++ b/templates/_connections_hafas.html.ep @@ -9,7 +9,7 @@ % $link_class = 'action-cancelled-from'; % } % if ($checkin_from) { - <tr class="<%= $link_class %>" data-station="<%= $train->station_eva %>" data-train="<%= $train->id %>" data-dest="<%= $via->{name} %>"> + <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} %>"> % } % else { <tr> diff --git a/templates/_departures_hafas.html.ep b/templates/_departures_hafas.html.ep index ef5585a..6e1641f 100644 --- a/templates/_departures_hafas.html.ep +++ b/templates/_departures_hafas.html.ep @@ -21,7 +21,7 @@ </td> </tr> % } - <tr class="<%= $link_class %>" data-station="<%= $result->station_eva %>" data-train="<%= $result->id %>" data-tr="3"> + <tr class="<%= $link_class %>" data-station="<%= $result->station_eva %>" data-train="<%= $result->id %>" data-ts="<%= ($result->sched_datetime // $result->datetime)->epoch %>" data-tr="3"> <td> <a> <%= $result->line %> diff --git a/templates/_departures_iris.html.ep b/templates/_departures_iris.html.ep index 161d049..cecbc8a 100644 --- a/templates/_departures_iris.html.ep +++ b/templates/_departures_iris.html.ep @@ -21,7 +21,7 @@ </td> </tr> % } - <tr class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>" data-tr="3"> + <tr class="<%= $link_class %>" data-station="<%= $result->station_uic %>" data-train="<%= $result->train_id %>" data-ts="<%= ($result->sched_departure // $result->departure)->epoch %>" data-tr="3"> <td> <a> <%= $result->line %> |