summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-04-19 16:49:31 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-04-19 16:49:31 +0200
commit94932c410290081461eecb2819bc187335452672 (patch)
treec73dd31b3e8b20ef0ff035aa5a2fa44d69090f71 /templates
parent50d8256f6f0bb05416d67c4910d014eb1d91677f (diff)
add commute stats. not linked from nav yet.
Diffstat (limited to 'templates')
-rw-r--r--templates/commute.html.ep89
1 files changed, 89 insertions, 0 deletions
diff --git a/templates/commute.html.ep b/templates/commute.html.ep
new file mode 100644
index 0000000..ef1c7ab
--- /dev/null
+++ b/templates/commute.html.ep
@@ -0,0 +1,89 @@
+<h1>Pendel-Statistiken</h1>
+
+<div class="row">
+ <div class="col s12">
+ <p>Diese Daten können zum Beispiel für die Angaben zur Pendlerpauschale
+ bei der Steuererklärung genutzt werden.</p>
+ </div>
+</div>
+
+%= form_for '/history/commute' => begin
+ <div class="row">
+ <div class="input-field col s12 m12 l12">
+ %= text_field 'year', id => 'year', class => 'validate', pattern => '[0-9][0-9][0-9][0-9]'
+ <label for="year">Jahr</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12 m12 l6">
+ <div>
+ <label>
+ %= radio_button filter_type => 'exact'
+ <span>Name der Station ist:</span>
+ </label>
+ </div>
+ <div>
+ <label>
+ %= radio_button filter_type => 'substring'
+ <span>Name der Station enthält:</span>
+ </label>
+ </div>
+ <div>
+ <label>
+ %= radio_button filter_type => 'regex'
+ <span>Name der Station erfüllt den regulären Ausdruck:</span>
+ </label>
+ </div>
+ </div>
+ <div class="input-field col s12 m12 l6">
+ %= text_field 'station', id => 'station', required => undef, class => 'autocomplete contrast-color-text'
+ <label for="station">Fahrtziel</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12 m12 l12 center-align">
+ <button class="btn waves-effect waves-light" type="submit" name="action" value="show">
+ <i class="material-icons left" aria-hidden="true">send</i>
+ Anzeigen
+ </button>
+ </div>
+ </div>
+%= end
+
+<h2><%= param('year') %></h2>
+<div class="row">
+ <div class="col s12 m12 l12 center-align">
+ <p>
+ An <b><%= $total_journeys %></b> Tagen im Jahr wurde mindestens
+ eine Zugfahrt von oder zu
+ % if (param('filter_type') eq 'exact') {
+ der ausgewählten Station
+ % }
+ % else {
+ den ausgewählten Stationen
+ % }
+ eingetragen.
+ </p>
+ <table class="striped">
+ <thead>
+ <tr>
+ <th>Monat</th>
+ <th>Tage mit Fahrten</th>
+ </tr>
+ </thead>
+ <tbody>
+ % for my $i (0 .. $#{$months}) {
+ <tr>
+ <td><%= $months->[$i] %></td>
+ <td><%= scalar @{$journeys_by_month->{$i+1} // []} %></td>
+ </tr>
+ % }
+ </tbody>
+ </table>
+ </div>
+</div>
+
+% for my $i (0 .. $#{$months}) {
+ <h2><%= $months->[$i] %></h2>
+ %= include '_history_trains', date_format => '%d.%m.', journeys => $journeys_by_month->{$i+1} // []
+% }