From 1cca278baac0f50012e524eac7c441c998f4d8c3 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 15 Jul 2023 19:20:37 +0200 Subject: add timeline / current checkins --- templates/_checked_in.html.ep | 3 +++ templates/_public_status_card.html.ep | 5 ++++- templates/_timeline-checked-in.html.ep | 7 +++++++ templates/_timeline_link.html.ep | 16 ++++++++++++++++ templates/landingpage.html.ep | 6 ++++++ templates/timeline-checked-in.html.ep | 3 +++ 6 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 templates/_timeline-checked-in.html.ep create mode 100644 templates/_timeline_link.html.ep create mode 100644 templates/timeline-checked-in.html.ep (limited to 'templates') 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') +% }
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')) { + <%= $name %>: <%= include '_format_train', journey => $journey %> + % } % else { <%= $name %> ist unterwegs % } @@ -16,7 +19,7 @@

„<%= $journey->{comment} %>“

% }

- % if (not stash('from_profile')) { + % if (not stash('from_profile') and not stash('from_timeline')) {

%= include '_format_train', journey => $journey
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}) { +
+
+ %= include '_public_status_card', name => $journey->{followee_name}, privacy => {}, journey => $journey, from_timeline => 1 +
+
+% } 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 @@ +
+ + % if (@{$timeline} <= 2) { + <%= $timeline->[0]->{followee_name} %> + % } + % if (@{$timeline} == 1) { + ist gerade unterwegs + % } + % elsif (@{$timeline} == 2) { + und <%= $timeline->[1]->{followee_name} %> sind gerade unterwegs + % } + % else { + <%= scalar @{$timeline} %> Accounts sind gerade unterwegs + % } + +
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') + % }
Zugausfall dokumentieren @@ -45,6 +48,9 @@
% } % else { + % if ( @{stash('timeline') // [] } ) { + %= include '_timeline_link', timeline => stash('timeline') + % }
Hallo, <%= current_user->{name} %>! 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 @@ +
+ %= include '_timeline-checked-in', journeys => $journeys +
-- cgit v1.2.3