diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-07 20:20:37 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-07 20:20:37 +0200 |
commit | beb17acb8440bb44f1070c2fb3b2e6cf7521f800 (patch) | |
tree | bbe052f289d841ecb1ca89426cbf39fbdfc2950a /templates/edit_journey.html.ep | |
parent | d4269a8fe4586e08577b66b5068b576e5ab36c7b (diff) |
Prepare forms for manual journey entry and editing
Diffstat (limited to 'templates/edit_journey.html.ep')
-rw-r--r-- | templates/edit_journey.html.ep | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/templates/edit_journey.html.ep b/templates/edit_journey.html.ep new file mode 100644 index 0000000..8fdc5b6 --- /dev/null +++ b/templates/edit_journey.html.ep @@ -0,0 +1,94 @@ +% if ($error and $error eq 'notfound') { + <div class="row"> + <div class="col s12"> + <div class="card red darken-4"> + <div class="card-content white-text"> + <span class="card-title">Fehler</span> + <p>Zugfahrt nicht gefunden.</p> + </div> + </div> + </div> + </div> +% } +% else { + % if ($error) { + <div class="row"> + <div class="col s12"> + <div class="card red darken-4"> + <div class="card-content white-text"> + <span class="card-title">Ungültige Eingabe</span> + <p><%= $error %></p> + </div> + </div> + </div> + </div> + % } + %= form_for '/journey/edit' => (method => 'POST') => begin + %= csrf_field + <div class="row"> + <div class="col s12"> + <p> + Fahrt von + <b><%= $journey->{from_name} %></b> + nach + <b><%= $journey->{to_name} %></b> + am + <b><%= $journey->{sched_departure}->strftime('%d.%m.%Y') %></b> + </p> + <table class="striped"> + <tr> + <th scope="row">Zug</th> + <td> + <%= $journey->{type} %> <%= $journey->{no} %> + % if ($journey->{line}) { + (Linie <%= $journey->{line} %>) + % } + </td> + </tr> + <tr> + <th scope="row">Geplante Abfahrt</th> + <td> + %= text_field 'sched_departure', id => 'sched_departure', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + </td> + </tr> + <tr> + <th scope="row">Tatsächliche Abfahrt</th> + <td> + %= text_field 'rt_departure', id => 'real_departure', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + </td> + </tr> + <tr> + <th scope="row">Geplante Ankunft</th> + <td> + %= text_field 'sched_arrival', id => 'sched_arrival', class => 'validate', required => undef, pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + </td> + </tr> + <tr> + <th scope="row">Tatsächliche Ankunft</th> + <td> + %= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' + </td> + </tr> + <tr> + <th scope="row">Route</th> + <td> + %= text_area 'route', id => 'route', cols => 40, rows => 20 + </td> + </tr> + </table> + </div> + </div> + <div class="row"> + <div class="col s3 m3 l3"> + </div> + <div class="col s6 m6 l6 center-align"> + <button class="btn waves-effect waves-light" type="submit" name="action" value="save"> + Speichern + <i class="material-icons right">send</i> + </button> + </div> + <div class="col s3 m3 l3"> + </div> + </div> + %= end +% } |