summaryrefslogtreecommitdiff
path: root/templates/history.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-26 19:53:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-26 19:53:01 +0200
commite07063c52c51569b5f252a202f5d71b5f70a73e7 (patch)
tree301f64f3fe95038a2551a81c927ff0206df93243 /templates/history.html.ep
parent2cae5a51d2f2a8002864860f452fa9474dc2ecb3 (diff)
Add manual journey entry
Closes #3
Diffstat (limited to 'templates/history.html.ep')
-rw-r--r--templates/history.html.ep34
1 files changed, 27 insertions, 7 deletions
diff --git a/templates/history.html.ep b/templates/history.html.ep
index 05f4777..246d6af 100644
--- a/templates/history.html.ep
+++ b/templates/history.html.ep
@@ -8,24 +8,44 @@
</div>
<div class="row">
- <div class="col s12 m12 l4 center-align">
+ <div class="col s12 m12 l3 center-align">
<a href="/cancelled" class="waves-effect waves-light btn"><i class="material-icons left">cancel</i> Zugausfälle</a>
</div>
- <div class="col s12 m12 l4">
- &nbsp;
- </div>
+ <div class="col s12 m12 l1">&nbsp;</div>
<div class="col s12 m12 l4 center-align">
+ <a href="/journey/add" class="waves-effect waves-light btn"><i class="material-icons left">add</i> Neue Fahrt</a>
+ </div>
+ <div class="col s12 m12 l1">&nbsp;</div>
+ <div class="col s12 m12 l3 center-align">
<a href="/history.json" class="waves-effect waves-light btn"><i class="material-icons left">cloud</i> JSON-Export</a>
</div>
</div>
<h2>Nach Jahr</h2>
-% my $since = get_user_data()->{registered_at};
+% my $since = get_oldest_journey_ts();
% my $now = DateTime->now(time_zone => 'Europe/Berlin');
-%= include '_history_years', current => '', since => $since->clone, now => $now;
+% if ($since) {
+ %= include '_history_years', current => '', since => $since->clone, now => $now;
+% }
+% else {
+ <div class="row">
+ <div class="col s12">
+ Noch keine Fahrten.
+ </div>
+ </div>
+% }
<h2>Nach Monat</h2>
-%= include '_history_months', current => '', since => $since->clone, now => $now;
+% if ($since) {
+ %= include '_history_months', current => '', since => $since->clone, now => $now;
+% }
+% else {
+ <div class="row">
+ <div class="col s12">
+ Noch keine Fahrten.
+ </div>
+ </div>
+% }
% if (stash('statistics')) {
%= include '_history_stats', stats => stash('statistics');