summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-15 19:20:37 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-15 19:20:37 +0200
commit1cca278baac0f50012e524eac7c441c998f4d8c3 (patch)
treeae292c5aef5c86e92d255e97010507c67daa02c6 /templates
parentbee67f096a5732fed5cb9c3e716012b536950022 (diff)
add timeline / current checkins
Diffstat (limited to 'templates')
-rw-r--r--templates/_checked_in.html.ep3
-rw-r--r--templates/_public_status_card.html.ep5
-rw-r--r--templates/_timeline-checked-in.html.ep7
-rw-r--r--templates/_timeline_link.html.ep16
-rw-r--r--templates/landingpage.html.ep6
-rw-r--r--templates/timeline-checked-in.html.ep3
6 files changed, 39 insertions, 1 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index df5472b..2382ac4 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -1,4 +1,7 @@
% my $user = current_user();
+% if (@{stash('timeline') // []}) {
+ %= include '_timeline_link', timeline => stash('timeline')
+% }
<div class="autorefresh">
<div class="card">
<div class="card-content">
diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep
index acbae0d..cbdc878 100644
--- a/templates/_public_status_card.html.ep
+++ b/templates/_public_status_card.html.ep
@@ -7,6 +7,9 @@
% if (stash('from_profile')) {
Unterwegs mit <%= include '_format_train', journey => $journey %>
% }
+ % elsif (stash('from_timeline')) {
+ <a href="/p/<%= $name %>"><%= $name %></a>: <%= include '_format_train', journey => $journey %>
+ % }
% else {
<a href="/p/<%= $name %>"><%= $name %></a> ist unterwegs
% }
@@ -16,7 +19,7 @@
<p>„<%= $journey->{comment} %>“</p>
% }
<p>
- % if (not stash('from_profile')) {
+ % if (not stash('from_profile') and not stash('from_timeline')) {
<div class="center-align">
%= include '_format_train', journey => $journey
</div>
diff --git a/templates/_timeline-checked-in.html.ep b/templates/_timeline-checked-in.html.ep
new file mode 100644
index 0000000..b1d37ce
--- /dev/null
+++ b/templates/_timeline-checked-in.html.ep
@@ -0,0 +1,7 @@
+% for my $journey (@{$journeys}) {
+ <div class="row">
+ <div class="col s12 autorefresh">
+ %= include '_public_status_card', name => $journey->{followee_name}, privacy => {}, journey => $journey, from_timeline => 1
+ </div>
+ </div>
+% }
diff --git a/templates/_timeline_link.html.ep b/templates/_timeline_link.html.ep
new file mode 100644
index 0000000..782906e
--- /dev/null
+++ b/templates/_timeline_link.html.ep
@@ -0,0 +1,16 @@
+<div>
+ <a href="/timeline/in-transit">
+ % if (@{$timeline} <= 2) {
+ <strong><%= $timeline->[0]->{followee_name} %></strong>
+ % }
+ % if (@{$timeline} == 1) {
+ ist gerade unterwegs
+ % }
+ % elsif (@{$timeline} == 2) {
+ und <strong><%= $timeline->[1]->{followee_name} %></strong> sind gerade unterwegs
+ % }
+ % else {
+ <strong><%= scalar @{$timeline} %></strong> Accounts sind gerade unterwegs
+ % }
+ </a>
+</div>
diff --git a/templates/landingpage.html.ep b/templates/landingpage.html.ep
index b91cd89..d3b514f 100644
--- a/templates/landingpage.html.ep
+++ b/templates/landingpage.html.ep
@@ -18,6 +18,9 @@
%= include '_checked_in', journey => $status, journey_visibility => stash('journey_visibility');
% }
% elsif ($status->{cancelled}) {
+ % if ( @{stash('timeline') // [] } ) {
+ %= include '_timeline_link', timeline => stash('timeline')
+ % }
<div class="card info-color">
<div class="card-content">
<span class="card-title">Zugausfall dokumentieren</span>
@@ -45,6 +48,9 @@
</div>
% }
% else {
+ % if ( @{stash('timeline') // [] } ) {
+ %= include '_timeline_link', timeline => stash('timeline')
+ % }
<div class="card">
<div class="card-content">
<span class="card-title">Hallo, <%= current_user->{name} %>!</span>
diff --git a/templates/timeline-checked-in.html.ep b/templates/timeline-checked-in.html.ep
new file mode 100644
index 0000000..0ed492e
--- /dev/null
+++ b/templates/timeline-checked-in.html.ep
@@ -0,0 +1,3 @@
+<div class="timeline-in-transit">
+ %= include '_timeline-checked-in', journeys => $journeys
+</div>