summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Traveling.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-30 23:23:49 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-30 23:23:49 +0200
commitf0d61a4083d677e115040357f4ee6eb40fb817f9 (patch)
tree560d072ebb8ff3e2bb2150b31f8a23ae28f469e9 /lib/Travelynx/Controller/Traveling.pm
parentddea9abc6e91d820668825e779faef3efb024665 (diff)
Prepare settings and templates for opt-in public travel status
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 81b3a70..cf704ec 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -25,6 +25,44 @@ sub homepage {
}
}
+sub user_status {
+ my ($self) = @_;
+
+ my $name = $self->stash('name');
+ my $user = $self->get_privacy_by_name($name);
+
+ if ( $user and ( $user->{public_level} & 0x02 ) ) {
+ my $status = $self->get_user_status( $user->{id} );
+ $self->render(
+ 'user_status',
+ name => $name,
+ journey => $status
+ );
+ }
+ else {
+ $self->render('not_found');
+ }
+}
+
+sub public_status_card {
+ my ($self) = @_;
+
+ my $name = $self->stash('name');
+ my $user = $self->get_privacy_by_name($name);
+
+ if ( $user and ( $user->{public_level} & 0x02 ) ) {
+ my $status = $self->get_user_status( $user->{id} );
+ $self->render(
+ '_public_status_card',
+ name => $name,
+ journey => $status
+ );
+ }
+ else {
+ $self->render('not_found');
+ }
+}
+
sub status_card {
my ($self) = @_;
my $status = $self->get_user_status;