diff options
Diffstat (limited to 'templates/commute.html.ep')
-rw-r--r-- | templates/commute.html.ep | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/templates/commute.html.ep b/templates/commute.html.ep new file mode 100644 index 0000000..26b2fbc --- /dev/null +++ b/templates/commute.html.ep @@ -0,0 +1,91 @@ +<div class="row"> + <div class="col s12"> + <p> + Hier werden nur Fahrten angezeigt, deren Start- oder Zielstation + den angegebenen Kriterien entpricht. 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', autocomplete => 'off' + <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 + +<h1><%= param('year') %></h1> +<div class="row"> + <div class="col s12 m12 l12"> + <p> + An <b><%= $total_journeys %></b> Tagen im Jahr wurde mindestens + eine Fahrt 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><%= $count_by_month->{$i+1} // 0 %></td> + </tr> + % } + </tbody> + </table> + </div> +</div> + +% for my $i (0 .. $#{$months}) { + <h2><%= $months->[$i] %></h2> + %= include '_history_trains', date_format => '%a %d.%m.', journeys => $journeys_by_month->{$i+1} // [] +% } |