diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-09-02 21:41:33 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-09-02 21:41:33 +0200 |
commit | 21643b053d8d4097f7bb51463a1562738b82892d (patch) | |
tree | 11e14803406243805d27119f32dae596713e0068 /templates/landingpage.html.ep |
Initial commit
Diffstat (limited to 'templates/landingpage.html.ep')
-rw-r--r-- | templates/landingpage.html.ep | 61 |
1 files changed, 61 insertions, 0 deletions
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> |