diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 2b34b99e0577887a04f1cc795cb6f96231709c1f..661572e54e65283ec1c1ebd8875b7eb5d96f2d87 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -187,6 +187,9 @@ sub startup { status_intern => 0x01, status_extern => 0x02, status_comment => 0x04, + history_intern => 0x10, + history_latest => 0x20, + history_full => 0x40, }; } ); diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index cef79a5415f947b424f7caa3df66ae981f3ddb54..135c52bf2819cd77d59bbc70875dae9c83ecb2c8 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -236,6 +236,19 @@ sub privacy { else { $public_level &= ~0x04; } + + if ( $self->param('history_level') eq 'intern' ) { + $public_level |= 0x10; + $public_level &= ~0x20; + } + elsif ( $self->param('history_level') eq 'extern' ) { + $public_level |= 0x20; + $public_level &= ~0x10; + } + else { + $public_level &= ~0x30; + } + $self->set_privacy( $user->{id}, $public_level ); $self->flash( success => 'privacy' ); @@ -248,6 +261,11 @@ sub privacy { : 'private' ); $self->param( public_comment => $public_level & 0x04 ? 1 : 0 ); + $self->param( + history_level => $public_level & 0x10 ? 'intern' + : $public_level & 0x20 ? 'extern' + : 'private' + ); $self->render( 'privacy', name => $user->{name} ); } } diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep index 810c4b83bcc02cf3690f7f340d9951303fb7f04a..ced0c6f7eda5d6b08b2d03b6a8fabd1a127b9c7a 100644 --- a/templates/_public_status_card.html.ep +++ b/templates/_public_status_card.html.ep @@ -163,7 +163,14 @@ <%= $name %> ist gerade nicht eingecheckt
% if ($journey->{arr_name}) { - Zuletzt gesehen in <%= $journey->{arr_name} %>. + Zuletzt gesehen + % if ($public_level & 0x30 and $journey->{real_arrival}->epoch) { + %= $journey->{real_arrival}->strftime('am %d.%m.%Y') + % } + in <%= $journey->{arr_name} %> + % if ($public_level & 0x30 and $journey->{real_arrival}->epoch) { + %= $journey->{real_arrival}->strftime('(Ankunft um %H:%M Uhr)') + % } % } % else { Noch keine Zugfahrten geloggt. diff --git a/templates/privacy.html.ep b/templates/privacy.html.ep index e8e645914e78491bdd8788735132a8ab0f92797a..9439f8b593752547d64feed5897992db8f74234a 100644 --- a/templates/privacy.html.ep +++ b/templates/privacy.html.ep @@ -8,8 +8,8 @@ %= form_for '/account/privacy' => (method => 'POST') => begin +%= csrf_field