summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-05 16:33:59 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-05 16:33:59 +0200
commitd75351b30c38dc22e0071e18dc68be551eb628a7 (patch)
tree42cf1576b093977f8c0a95cdd49931ec0ad7a8ae /templates
parent3198689286984a47d0250712d9928c7a9ff2f7b9 (diff)
Use POST requests to modify data
Diffstat (limited to 'templates')
-rw-r--r--templates/checkin.html.ep54
-rw-r--r--templates/checkout.html.ep31
-rw-r--r--templates/departures.html.ep8
-rw-r--r--templates/landingpage.html.ep2
-rw-r--r--templates/layouts/default.html.ep1
5 files changed, 7 insertions, 89 deletions
diff --git a/templates/checkin.html.ep b/templates/checkin.html.ep
deleted file mode 100644
index 7e68a0b..0000000
--- a/templates/checkin.html.ep
+++ /dev/null
@@ -1,54 +0,0 @@
-% if ($error) {
- <div class="row">
- <div class="col s12 m6">
- <div class="card red darken-4">
- <div class="card-content white-text">
- <span class="card-title">I am Error</span>
- <p><%= $error %></p>
- </div>
- <div class="card-action">
- % if (param('station')) {
- <a href="/<%= param('station') %>">Zurück zu den Abfahrten</a>
- % }
- % else {
- <a href="/">Zur Hauptseite</a>
- % }
- </div>
- </div>
- </div>
-% }
-% else {
- <div class="row">
- <div class="col s12">
- <div class="card green darken-4">
- <div class="card-content white-text">
- <span class="card-title">Eingecheckt in <%= $train->line %></span>
- <p>Abfahrt um <%= $train->sched_departure->strftime('%H:%M') %>
- % if ($train->departure_delay) {
- +<%= $train->departure_delay %>
- % }
- </p>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col s12">
- Weitere Route:
- </div>
- </div>
- <div class="row">
- <div class="col s12">
- <table>
- <tbody>
- % for my $station ($train->route_post) {
- <tr>
- <td><%= $station %></td>
- <td><a href="/a/checkout?station=<%= $station %>">hier auschecken</a></td>
- </tr>
- % }
- </tbody>
- </table>
- </div>
- </div>
-% }
diff --git a/templates/checkout.html.ep b/templates/checkout.html.ep
deleted file mode 100644
index 1b5a4f2..0000000
--- a/templates/checkout.html.ep
+++ /dev/null
@@ -1,31 +0,0 @@
-% if ($error) {
- <div class="row">
- <div class="col s12 m6">
- <div class="card red darken-4">
- <div class="card-content white-text">
- <span class="card-title">I am Error</span>
- <p><%= $error %></p>
- </div>
- <div class="card-action">
- <a href="/a/checkout?station=<%= param('station') %>&amp;force=1">Ohne Echtzeitdaten auschecken</a>
- % if (param('station')) {
- <a href="/<%= param('station') %>">Zurück zu den Abfahrten</a>
- % }
- % else {
- <a href="/">Zur Hauptseite</a>
- % }
- </div>
- </div>
- </div>
-% }
-% else {
- <div class="row">
- <div class="col s12">
- <div class="card green darken-4">
- <div class="card-content white-text">
- <span class="card-title">Erfolgreich ausgecheckt</span>
- </div>
- </div>
- </div>
- </div>
-% }
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index bbe0149..bd11d15 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -9,7 +9,9 @@
ab <%= $status->{station_name} %></p>
</div>
<div class="card-action">
- <a href="/a/checkout?station=<%= $ds100 %>">Hier auschecken</a>
+ <a class="action-checkout" data-station="<%= $ds100 %>">
+ Hier auschecken
+ </a>
</div>
</div>
% }
@@ -28,12 +30,12 @@
% for my $result (@{$results}) {
<tr>
<td>
- <a href="/a/checkin?station=<%= $ds100 %>&amp;train=<%= $result->train_id %>" title="Check In">
+ <a class="action-checkin" data-station="<%= $ds100 %>" data-train="<%= $result->train_id %>">
<%= $result->line %>
</a>
</td>
<td>
- <a href="/a/checkin?station=<%= $ds100 %>&amp;train=<%= $result->train_id %>" title="Check In">
+ <a class="action-checkin" data-station="<%= $ds100 %>" data-train="<%= $result->train_id %>">
<%= $result->destination %>
</a>
</td>
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep
index 0207118..a33d83a 100644
--- a/templates/landingpage.html.ep
+++ b/templates/landingpage.html.ep
@@ -13,7 +13,7 @@
<tbody>
% my $is_after = 0;
% for my $station (@{$status->{route_after}}) {
- <tr><td><a href="/a/checkout?station=<%= $station %>"><%= $station %></a></td></tr>
+ <tr><td><a class="action-checkout" data-station="<%= $station %>"><%= $station %></a></td></tr>
% }
</tbody>
</table>
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 5e0091c..d11bd2a 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -9,6 +9,7 @@
%= stylesheet '/static/css/local.css'
%= javascript '/static/js/jquery-2.2.4.min.js'
%= javascript '/static/js/materialize.min.js'
+ %= javascript '/static/js/travelynx-actions.js'
</head>
<body>