summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-09-02 21:41:33 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-09-02 21:41:33 +0200
commit21643b053d8d4097f7bb51463a1562738b82892d (patch)
tree11e14803406243805d27119f32dae596713e0068 /templates
Initial commit
Diffstat (limited to 'templates')
-rw-r--r--templates/checkin.html.ep47
-rw-r--r--templates/checkout.html.ep31
-rw-r--r--templates/departures.html.ep49
-rw-r--r--templates/landingpage.html.ep61
-rw-r--r--templates/layouts/default.html.ep29
5 files changed, 217 insertions, 0 deletions
diff --git a/templates/checkin.html.ep b/templates/checkin.html.ep
new file mode 100644
index 0000000..96cd80f
--- /dev/null
+++ b/templates/checkin.html.ep
@@ -0,0 +1,47 @@
+% 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:
+ <ul>
+ % for my $station ($train->route_post) {
+ <li><%= $station %>
+ (<a href="/a/checkout?station=<%= $station %>">hier auschecken</a>)
+ </li>
+ % }
+ </ul>
+ </div>
+ </div>
+% }
diff --git a/templates/checkout.html.ep b/templates/checkout.html.ep
new file mode 100644
index 0000000..1b5a4f2
--- /dev/null
+++ b/templates/checkout.html.ep
@@ -0,0 +1,31 @@
+% 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
new file mode 100644
index 0000000..bbe0149
--- /dev/null
+++ b/templates/departures.html.ep
@@ -0,0 +1,49 @@
+<div class="row">
+ <div class="col s12">
+ % my $status = $self->get_user_status;
+ % if ($status->{checked_in}) {
+ <div class="card grey darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Aktuell eingecheckt</span>
+ <p>In <%= $status->{train_type} %> <%= $status->{train_no} %>
+ ab <%= $status->{station_name} %></p>
+ </div>
+ <div class="card-action">
+ <a href="/a/checkout?station=<%= $ds100 %>">Hier auschecken</a>
+ </div>
+ </div>
+ % }
+ </div>
+</div>
+<div class="row">
+ <table class="striped">
+ <thead>
+ <tr>
+ <th>Zug</th>
+ <th></th>
+ <th>Abfahrt</th>
+ </tr>
+ </thead>
+ <tbody>
+ % for my $result (@{$results}) {
+ <tr>
+ <td>
+ <a href="/a/checkin?station=<%= $ds100 %>&amp;train=<%= $result->train_id %>" title="Check In">
+ <%= $result->line %>
+ </a>
+ </td>
+ <td>
+ <a href="/a/checkin?station=<%= $ds100 %>&amp;train=<%= $result->train_id %>" title="Check In">
+ <%= $result->destination %>
+ </a>
+ </td>
+ <td><%= $result->departure->strftime('%H:%M') %>
+ % if ($result->departure_delay) {
+ (+<%= $result->departure_delay %>)
+ % }
+ </td>
+ </tr>
+ % }
+ </tbody>
+ </table>
+</div>
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep
new file mode 100644
index 0000000..2190862
--- /dev/null
+++ b/templates/landingpage.html.ep
@@ -0,0 +1,61 @@
+<div class="row">
+ <div class="col s12">
+ % my $status = $self->get_user_status;
+ % if ($status->{checked_in}) {
+ <div class="card green darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Hallo, <%= $self->get_user_name %>!</span>
+ <p>Du bist gerade eingecheckt in
+ <%= $status->{train_type} %> <%= $status->{train_no} %>
+ ab <%= $status->{station_name} %>.</p>
+ <p>Auschecken?
+ <ul>
+ % my $is_after = 0;
+ % for my $station (@{$status->{route_after}}) {
+ <li><a href="/a/checkout?station=<%= $station %>"><%= $station %></a></li>
+ % }
+ </ul>
+ </p>
+ </div>
+ </div>
+ % }
+ % else {
+ <div class="card grey darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Hallo, <%= $self->get_user_name %>!</span>
+ <p>Du bist gerade nicht eingecheckt.</p>
+ </div>
+ </div>
+ % }
+ </div>
+</div>
+<h1>Bisherige Fahrten</h1>
+<div class="row">
+ <table class="striped">
+ <thead>
+ <tr>
+ <th>Datum</th>
+ <th>Zug</th>
+ <th>Strecke</th>
+ <th>Dauer</th>
+ </tr>
+ </thead>
+ <tbody>
+ % for my $travel (get_user_travels()) {
+ % if ($travel->{completed}) {
+ <tr>
+ <td><%= $travel->{sched_departure}->strftime('%d.%m.%Y') %></td>
+ <td><%= $travel->{type} %> <%= $travel->{line} // $travel->{no} %></td>
+ <td><%= $travel->{from_name} %> → <%= $travel->{to_name} %></td>
+ % if ($travel->{rt_arrival} and $travel->{rt_departure}) {
+ <td><%= ($travel->{rt_arrival}->epoch - $travel->{rt_departure}->epoch) / 60 %> min</td>
+ % }
+ % else {
+ <td>?</td>
+ % }
+ </tr>
+ % }
+ % }
+ </tbody>
+ </tabel>
+</div>
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
new file mode 100644
index 0000000..5e0091c
--- /dev/null
+++ b/templates/layouts/default.html.ep
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="de">
+<head>
+ <title><%= stash('title') // 'travelynx' %></title>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ %= stylesheet '/static/css/materialize.min.css'
+ %= stylesheet '/static/css/material-icons.css'
+ %= stylesheet '/static/css/local.css'
+ %= javascript '/static/js/jquery-2.2.4.min.js'
+ %= javascript '/static/js/materialize.min.js'
+</head>
+<body>
+
+<nav class="blue">
+ <div class="nav-wrapper container">
+ <a href="/" class="brand-logo left">travelynx</a>
+ <ul id="nav-mobile" class="right">
+ <li class="<%= navbar_class('/') %>"><a href='/' title="Einchecken"><i class="material-icons">Check In</i></a></li>
+ </ul>
+ </div>
+</nav>
+
+<div class="container">
+ %= content
+</div>
+
+</body>
+</html>