summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-06 21:40:51 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-06 21:40:51 +0100
commit094c536eb475b02a26f65769d6ff460d270ef454 (patch)
treedb36d0265b764825775d23c5edf591ec07252739 /templates
parent119f0a6b7d92db63c4dbab3e65dda34285c007e0 (diff)
Allow comments to be entered while still in transit
Diffstat (limited to 'templates')
-rw-r--r--templates/_checked_in.html.ep21
-rw-r--r--templates/edit_comment.html.ep59
2 files changed, 77 insertions, 3 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index a493384..5631e12 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -3,6 +3,9 @@
<div class="card-content">
<i class="material-icons small right sync-failed-marker grey-text" style="display: none;">sync_problem</i>
<span class="card-title">Eingecheckt in <%= $journey->{train_type} %> <%= $journey->{train_no} %></span>
+ % if ($journey->{comment}) {
+ <p><%= $journey->{comment} %>.</p>
+ % }
<p>
<div class="center-align countdown"
data-journey="<%= $journey->{real_departure}->epoch %>;<%= <%= $journey->{real_arrival}->epoch %>"
@@ -216,9 +219,16 @@
% }
</div>
<div class="card-action">
- <a class="action-undo blue-text" data-id="in_transit" style="margin-right: 0;">
- <i class="material-icons left">undo</i> Rückgängig
- </a>
+ % if ($journey->{arr_name}) {
+ <a style="margin-right: 0;" href="/journey/comment">
+ <i class="material-icons left">comment</i> Kommentar
+ </a>
+ % }
+ % else {
+ <a class="action-undo blue-text" data-id="in_transit" style="margin-right: 0;">
+ <i class="material-icons left">undo</i> Checkin Rückgängig
+ </a>
+ % }
% if (defined $journey->{arrival_countdown} and $journey->{arrival_countdown} <= 0) {
<a
class="action-checkout right"
@@ -276,6 +286,11 @@
auschecken</a>.
</p>
</div>
+ <div class="card-action">
+ <a class="action-undo blue-text" data-id="in_transit" style="margin-right: 0;">
+ <i class="material-icons left">undo</i> Checkin Rückgängig
+ </a>
+ </div>
</div>
% }
</div>
diff --git a/templates/edit_comment.html.ep b/templates/edit_comment.html.ep
new file mode 100644
index 0000000..81353a2
--- /dev/null
+++ b/templates/edit_comment.html.ep
@@ -0,0 +1,59 @@
+<h1>Zugfahrt kommentieren</h1>
+% if ($error or not $journey->{checked_in}) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card caution-color">
+ <div class="card-content white-text">
+ <span class="card-title">Fehler</span>
+ <p>Du bist gerade nicht eingecheckt. Vergangene Zugfahrten
+ kannst du über die Editierfunktion in der History
+ kommentieren.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+% else {
+ %= form_for '/journey/comment' => (method => 'POST') => begin
+ %= csrf_field
+ %= hidden_field 'dep_ts' => param('dep_ts')
+ <div class="row">
+ <div class="col s12">
+ <p>
+ Eintrag zu
+ <b><%= $journey->{train_type} %> <%= $journey->{train_no} %></b>
+ von
+ <b><%= $journey->{dep_name} %></b>
+ nach
+ <b><%= $journey->{arr_name} // 'irgendwo' %></b>
+ am
+ <b><%= $journey->{sched_departure}->strftime('%d.%m.%Y') %></b>
+ </p>
+ % if (current_user()->{is_public} & 0x04) {
+ <p>
+ Der hier eingetragene Text ist als Teil deines Nutzerstatus
+ öffentlich sichtbar.
+ </p>
+ % }
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12">
+ %= text_field 'comment'
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s6 m6 l6 center-align">
+ <a href="/" class="waves-effect waves-light btn">
+ Abbrechen
+ </a>
+ </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>
+ %= end
+% }