summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-02-20 21:45:51 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-02-20 21:45:51 +0100
commit01aec7e9770d99565c06f673268ba587007c2b1f (patch)
tree96b54a54ddbbc930890cdb75415153f7e3430c4b /lib/Travelynx/Controller
parent209e2918217aef8d900a194309160f7119a205bc (diff)
fix ajax refresh of public status card (trim .html suffix)1.22.1
Diffstat (limited to 'lib/Travelynx/Controller')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index ffc4211..9f8a193 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -58,9 +58,10 @@ sub user_status {
$ts
and ( not $status->{checked_in}
or $status->{sched_departure}->epoch != $ts )
- and ( $user->{public_level} & 0x20
- or
- ( $user->{public_level} & 0x10 and $self->is_user_authenticated ) )
+ and (
+ $user->{public_level} & 0x20
+ or ( $user->{public_level} & 0x10 and $self->is_user_authenticated )
+ )
)
{
for my $candidate (
@@ -173,9 +174,10 @@ sub public_profile {
if (
$user
- and ( $user->{public_level} & 0x22
- or
- ( $user->{public_level} & 0x11 and $self->is_user_authenticated ) )
+ and (
+ $user->{public_level} & 0x22
+ or ( $user->{public_level} & 0x11 and $self->is_user_authenticated )
+ )
)
{
my $status = $self->get_user_status( $user->{id} );
@@ -233,9 +235,10 @@ sub public_journey_details {
if (
$user
- and ( $user->{public_level} & 0x20
- or
- ( $user->{public_level} & 0x10 and $self->is_user_authenticated ) )
+ and (
+ $user->{public_level} & 0x20
+ or ( $user->{public_level} & 0x10 and $self->is_user_authenticated )
+ )
)
{
my $journey = $self->journeys->get_single(
@@ -312,15 +315,17 @@ sub public_status_card {
my ($self) = @_;
my $name = $self->stash('name');
+ $name =~ s{[.]html$}{};
my $user = $self->users->get_privacy_by_name( name => $name );
delete $self->stash->{layout};
if (
$user
- and ( $user->{public_level} & 0x02
- or
- ( $user->{public_level} & 0x01 and $self->is_user_authenticated ) )
+ and (
+ $user->{public_level} & 0x02
+ or ( $user->{public_level} & 0x01 and $self->is_user_authenticated )
+ )
)
{
my $status = $self->get_user_status( $user->{id} );
@@ -1293,7 +1298,7 @@ sub add_journey_form {
$self->render(
'add_journey',
with_autocomplete => 1,
- error =>
+ error =>
'Zug muss als „Typ Nummer“ oder „Typ Linie Nummer“ eingegeben werden.'
);
return;