diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 3840518f5ae5fa14b413d2715acf00481807154a..001a762187739762fd53083bd5b90e8b70f9c4e4 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1045,7 +1045,7 @@ sub startup { $self->pg->db->update( 'webhooks', { - errored => !$success, + errored => $success ? 0 : 1, latest_run => DateTime->now( time_zone => 'Europe/Berlin' ), output => $text, }, diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index c02fb1a5669a4f93768099d01da51024d2574605..e272eb1c24b932d5bda5441c47a246e8f2a80d95 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -222,6 +222,8 @@ sub privacy { $public_level &= ~0x02; } $self->set_privacy( $user->{id}, $public_level ); + + $self->flash( success => 'privacy' ); $self->redirect_to('account'); } else { @@ -244,8 +246,9 @@ sub webhook { token => $hook->{token}, enabled => $hook->{enabled} ); + $self->flash( success => 'webhook' ); + $self->redirect_to('account'); $self->run_hook( $self->current_user->{id}, 'ping' ); - $hook = $self->get_webhook; } else { $self->param( url => $hook->{url} ); diff --git a/templates/account.html.ep b/templates/account.html.ep index 7baacbe57e10ae90c73155a3bb73ac06ef69cd73..05e0447441e74dc0fcd6ea1b54e3b413f2f56f1f 100644 --- a/templates/account.html.ep +++ b/templates/account.html.ep @@ -8,10 +8,16 @@
% if ($success eq 'mail') { - Mail-Adresse erfolgreich geändert + Mail-Adresse geändert % } % elsif ($success eq 'password') { - Passwort erfolgreich geändert + Passwort geändert + % } + % elsif ($success eq 'privacy') { + Einstellungen zu öffentliche Account-Daten geändert + % } + % elsif ($success eq 'webhook') { + Web Hook aktualisiert % }
@@ -21,6 +27,7 @@

Account

% my $acc = current_user(); +% my $hook = get_webhook();
@@ -41,13 +48,31 @@ + + + +
edit % if ($acc->{is_public} == 0) { - Keine + Keine % } % if ($acc->{is_public} & 0x02) { Aktueller Status % }
Web Hook + edit + % if ($hook->{enabled} == 0) { + Nicht eingerichtet + % } + % elsif ($hook->{latest_run}->epoch == 0) { + Aktiv, noch nicht ausgeführt + % } + % elsif ($hook->{errored}) { + Aktiv, fehlerhaft error + % } + % else { + Aktiv + % } +
Registriert am <%= $acc->{registered_at}->strftime('%d.%m.%Y %H:%M') %>