2019-03-18 17:55:39 +00:00
|
|
|
|
% if (my $invalid = stash('invalid')) {
|
2019-04-30 08:46:46 +00:00
|
|
|
|
%= include '_invalid_input', invalid => $invalid
|
2019-03-18 17:55:39 +00:00
|
|
|
|
% }
|
|
|
|
|
|
2019-04-30 10:08:51 +00:00
|
|
|
|
% if (my $success = flash('success')) {
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2019-05-16 14:10:53 +00:00
|
|
|
|
<div class="card success-color">
|
2019-04-30 10:08:51 +00:00
|
|
|
|
<div class="card-content white-text">
|
2021-06-12 17:00:42 +00:00
|
|
|
|
% if ($success eq 'name') {
|
|
|
|
|
<span class="card-title">Name geändert</span>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($success eq 'mail') {
|
2019-05-10 17:03:18 +00:00
|
|
|
|
<span class="card-title">Mail-Adresse geändert</span>
|
2019-04-30 10:08:51 +00:00
|
|
|
|
% }
|
|
|
|
|
% elsif ($success eq 'password') {
|
2019-05-10 17:03:18 +00:00
|
|
|
|
<span class="card-title">Passwort geändert</span>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($success eq 'privacy') {
|
2019-12-08 09:32:07 +00:00
|
|
|
|
<span class="card-title">Einstellungen zu öffentlichen Account-Daten geändert</span>
|
2019-05-10 17:03:18 +00:00
|
|
|
|
% }
|
2020-09-30 17:12:29 +00:00
|
|
|
|
% elsif ($success eq 'traewelling') {
|
2020-10-04 08:38:09 +00:00
|
|
|
|
<span class="card-title">Träwelling-Verknüpfung aktualisiert</span>
|
2020-09-30 17:12:29 +00:00
|
|
|
|
% }
|
2019-05-20 17:15:21 +00:00
|
|
|
|
% elsif ($success eq 'use_history') {
|
|
|
|
|
<span class="card-title">Einstellungen zu vorgeschlagenen Verbindungen geändert</span>
|
|
|
|
|
% }
|
2019-05-10 17:03:18 +00:00
|
|
|
|
% elsif ($success eq 'webhook') {
|
|
|
|
|
<span class="card-title">Web Hook aktualisiert</span>
|
2019-04-30 10:08:51 +00:00
|
|
|
|
% }
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
% }
|
|
|
|
|
|
2019-03-18 17:47:52 +00:00
|
|
|
|
% my $acc = current_user();
|
2019-05-10 17:03:18 +00:00
|
|
|
|
% my $hook = get_webhook();
|
2022-02-16 19:39:49 +00:00
|
|
|
|
% my $traewelling = traewelling->get(uid => $acc->{id});
|
2020-07-27 16:53:22 +00:00
|
|
|
|
% my $use_history = users->use_history(uid => $acc->{id});
|
2019-03-03 21:35:20 +00:00
|
|
|
|
<div class="row">
|
2019-03-08 16:59:48 +00:00
|
|
|
|
<div class="col s12">
|
2020-11-21 14:33:43 +00:00
|
|
|
|
<h2>Account</h2>
|
2019-03-08 16:59:48 +00:00
|
|
|
|
<table class="striped">
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Name</th>
|
2021-06-12 17:00:42 +00:00
|
|
|
|
<td><a href="/account/name"><i class="material-icons">edit</i></a><%= $acc->{name} %></td>
|
2019-03-08 16:59:48 +00:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Mail</th>
|
2019-05-03 16:57:24 +00:00
|
|
|
|
<td><a href="/account/mail"><i class="material-icons">edit</i></a><%= $acc->{email} %></td>
|
2019-03-08 16:59:48 +00:00
|
|
|
|
</tr>
|
2019-04-06 09:20:10 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Passwort</th>
|
2019-05-03 16:57:24 +00:00
|
|
|
|
<td><a href="/account/password"><i class="material-icons">edit</i></a></td>
|
2019-04-06 09:20:10 +00:00
|
|
|
|
</tr>
|
2019-05-20 17:15:21 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Verbindungen</th>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="/account/insight"><i class="material-icons">edit</i></a>
|
|
|
|
|
% if ($use_history & 0x03) {
|
|
|
|
|
Vorschläge aktiv
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
<span style="color: #999999;">Vorschläge deaktiviert</span>
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-04-30 21:23:49 +00:00
|
|
|
|
<tr>
|
2019-05-02 08:05:15 +00:00
|
|
|
|
<th scope="row">Öffentliche Daten</th>
|
2019-04-30 21:23:49 +00:00
|
|
|
|
<td>
|
2019-05-02 07:12:32 +00:00
|
|
|
|
<a href="/account/privacy"><i class="material-icons">edit</i></a>
|
2019-04-30 21:23:49 +00:00
|
|
|
|
% if ($acc->{is_public} == 0) {
|
2019-05-10 17:03:18 +00:00
|
|
|
|
<span style="color: #999999;">Keine</span>
|
2019-04-30 21:23:49 +00:00
|
|
|
|
% }
|
2019-12-08 10:06:17 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x01) {
|
2020-09-03 20:27:50 +00:00
|
|
|
|
Aktueller Status (nur mit Anmeldung)
|
2019-12-08 10:06:17 +00:00
|
|
|
|
% }
|
|
|
|
|
% elsif ($acc->{is_public} & 0x02) {
|
2019-05-02 08:05:15 +00:00
|
|
|
|
Aktueller Status
|
2019-04-30 21:23:49 +00:00
|
|
|
|
% }
|
2020-02-19 19:58:38 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x0f and $acc->{is_public} & 0xf0) {
|
|
|
|
|
<br/>
|
|
|
|
|
% }
|
2020-09-04 16:38:35 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x30) {
|
|
|
|
|
% if ($acc->{is_public} & 0x40) {
|
|
|
|
|
Vergangene Fahrten
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
Fahrten der letzten vier Wochen
|
|
|
|
|
% }
|
|
|
|
|
% if ($acc->{is_public} & 0x10) {
|
|
|
|
|
(nur mit Anmeldung)
|
|
|
|
|
% }
|
2020-02-19 19:58:38 +00:00
|
|
|
|
% }
|
2020-09-04 16:38:35 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x04) {
|
|
|
|
|
<br/>
|
|
|
|
|
Kommentare
|
2020-02-19 19:58:38 +00:00
|
|
|
|
% }
|
2019-05-02 07:12:32 +00:00
|
|
|
|
</td>
|
2019-04-30 21:23:49 +00:00
|
|
|
|
</tr>
|
2019-05-10 17:03:18 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Web Hook</th>
|
|
|
|
|
<td>
|
|
|
|
|
<a href="/account/hooks"><i class="material-icons">edit</i></a>
|
2019-05-10 23:42:14 +00:00
|
|
|
|
% if (not $hook->{enabled}) {
|
2019-05-10 17:03:18 +00:00
|
|
|
|
<span style="color: #999999;">Nicht eingerichtet</span>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($hook->{latest_run}->epoch == 0) {
|
|
|
|
|
Aktiv, noch nicht ausgeführt
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($hook->{errored}) {
|
2020-10-04 10:50:41 +00:00
|
|
|
|
Aktiv, fehlerhaft <i class="material-icons" aria-hidden="true">error</i>
|
2019-05-10 17:03:18 +00:00
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
Aktiv
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2020-09-30 17:12:29 +00:00
|
|
|
|
<tr>
|
2020-09-30 17:46:54 +00:00
|
|
|
|
<th scope="row">Träwelling</th>
|
2020-09-30 17:12:29 +00:00
|
|
|
|
<td>
|
|
|
|
|
<a href="/account/traewelling"><i class="material-icons">edit</i></a>
|
|
|
|
|
% if (not ($traewelling->{token})) {
|
|
|
|
|
<span style="color: #999999;">Nicht verknüpft</span>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($traewelling->{errored}) {
|
2020-10-04 08:38:09 +00:00
|
|
|
|
Fehlerhaft <i class="material-icons" aria-hidden="true">error</i>
|
2020-09-30 17:12:29 +00:00
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
Verknüpft mit <%= $traewelling->{data}{user_name} // $traewelling->{email} %>
|
2020-10-04 08:38:09 +00:00
|
|
|
|
% if ($traewelling->{expired}) {
|
|
|
|
|
– Login-Token abgelaufen <i class="material-icons" aria-hidden="true">error</i>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($traewelling->{expiring}) {
|
|
|
|
|
– Login-Token läuft bald ab <i class="material-icons" aria-hidden="true">warning</i>
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($traewelling->{pull_sync}) {
|
2020-09-30 17:46:54 +00:00
|
|
|
|
– Checkins in Träwelling werden von travelynx übernommen
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($traewelling->{push_sync}) {
|
|
|
|
|
– Checkins in travelynx werden zu Träwelling weitergereicht
|
|
|
|
|
% }
|
2020-09-30 17:12:29 +00:00
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-03-08 16:59:48 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Registriert am</th>
|
|
|
|
|
<td><%= $acc->{registered_at}->strftime('%d.%m.%Y %H:%M') %></td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
2019-04-06 09:20:10 +00:00
|
|
|
|
<div class="col s12 m12 l12 center-align">
|
2019-03-08 16:59:48 +00:00
|
|
|
|
%= form_for 'logout' => begin
|
|
|
|
|
%= csrf_field
|
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="logout">
|
|
|
|
|
Abmelden
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</div>
|
2019-03-03 21:35:20 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2019-03-16 12:56:56 +00:00
|
|
|
|
% my $token = get_api_token();
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2020-11-21 14:33:43 +00:00
|
|
|
|
<h2>API</h2>
|
2019-03-16 12:56:56 +00:00
|
|
|
|
<p>
|
|
|
|
|
Die folgenden API-Token erlauben den passwortlosen automatisierten Zugriff auf
|
|
|
|
|
API-Endpunkte. Bitte umsichtig behandeln – sobald ein Token gesetzt
|
2019-03-16 13:17:02 +00:00
|
|
|
|
ist, können damit ohne Logindaten alle zugehörigen API-Aktionen
|
|
|
|
|
ausgeführt werden.
|
2019-03-16 12:56:56 +00:00
|
|
|
|
</p>
|
|
|
|
|
<table class="striped">
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Status</th>
|
|
|
|
|
<td>
|
|
|
|
|
% if ($token->{status}) {
|
|
|
|
|
%= $acc->{id} . '-' . $token->{status}
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
—
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
%= form_for 'set_token' => begin
|
|
|
|
|
%= csrf_field
|
|
|
|
|
%= hidden_field 'token' => 'status'
|
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="generate">
|
|
|
|
|
Generieren
|
|
|
|
|
</button>
|
2019-05-16 13:02:17 +00:00
|
|
|
|
<button class="btn waves-effect waves-light caution-color" type="submit" name="action" value="delete">
|
2019-03-16 12:56:56 +00:00
|
|
|
|
Löschen
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</td>
|
2019-04-06 11:58:10 +00:00
|
|
|
|
</tr><!--
|
2019-03-16 12:56:56 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">History</th>
|
|
|
|
|
<td>
|
|
|
|
|
% if ($token->{history}) {
|
|
|
|
|
%= $acc->{id} . '-' . $token->{history}
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
—
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
%= form_for 'set_token' => begin
|
|
|
|
|
%= csrf_field
|
|
|
|
|
%= hidden_field 'token' => 'history'
|
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="generate">
|
|
|
|
|
Generieren
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn waves-effect waves-light red" type="submit" name="action" value="delete">
|
|
|
|
|
Löschen
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</td>
|
2019-12-14 19:46:02 +00:00
|
|
|
|
</tr>-->
|
2019-03-16 12:56:56 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Travel</th>
|
|
|
|
|
<td>
|
2019-12-20 15:23:05 +00:00
|
|
|
|
% if ($token->{travel}) {
|
|
|
|
|
%= $acc->{id} . '-' . $token->{travel}
|
2019-03-16 12:56:56 +00:00
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
—
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
%= form_for 'set_token' => begin
|
|
|
|
|
%= csrf_field
|
2019-12-14 20:53:23 +00:00
|
|
|
|
%= hidden_field 'token' => 'travel'
|
2019-03-16 12:56:56 +00:00
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="generate">
|
|
|
|
|
Generieren
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn waves-effect waves-light red" type="submit" name="action" value="delete">
|
|
|
|
|
Löschen
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</td>
|
2019-12-14 19:46:02 +00:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Import</th>
|
|
|
|
|
<td>
|
|
|
|
|
% if ($token->{import}) {
|
|
|
|
|
%= $acc->{id} . '-' . $token->{import}
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
—
|
|
|
|
|
% }
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
%= form_for 'set_token' => begin
|
|
|
|
|
%= csrf_field
|
|
|
|
|
%= hidden_field 'token' => 'import'
|
|
|
|
|
<button class="btn waves-effect waves-light" type="submit" name="action" value="generate">
|
|
|
|
|
Generieren
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn waves-effect waves-light red" type="submit" name="action" value="delete">
|
|
|
|
|
Löschen
|
|
|
|
|
</button>
|
|
|
|
|
%= end
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2019-03-16 12:56:56 +00:00
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2019-05-02 09:29:43 +00:00
|
|
|
|
<a href="/api">Dokumentation</a>
|
2019-03-16 13:17:02 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2019-05-02 09:29:43 +00:00
|
|
|
|
|
2019-03-03 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2020-11-21 14:33:43 +00:00
|
|
|
|
<h2>Export</h2>
|
2019-03-03 21:35:20 +00:00
|
|
|
|
<ul>
|
2019-03-07 17:36:11 +00:00
|
|
|
|
<li><a href="/export.json">Rohdaten</a> (Kein API-Ersatz, das Format kann sich jederzeit ändern)</li>
|
2019-03-03 21:35:20 +00:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-03-12 20:49:26 +00:00
|
|
|
|
|
|
|
|
|
% if (not $acc->{deletion_requested}) {
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
2020-11-21 14:33:43 +00:00
|
|
|
|
<h2>Löschen</h2>
|
2019-03-12 20:49:26 +00:00
|
|
|
|
<p>
|
2019-03-16 13:17:02 +00:00
|
|
|
|
Der Löschauftrag wird vorgemerkt und erst nach drei Tagen
|
|
|
|
|
umgesetzt, bis dahin kann er jederzeit zurückgenommen werden. Nach
|
|
|
|
|
Ablauf der drei Tage wird der Account mit allen zugehörigen
|
|
|
|
|
Reisedaten ohne weitere Rückfragen entfernt.
|
2019-03-12 20:49:26 +00:00
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
2019-03-18 17:55:39 +00:00
|
|
|
|
%= form_for 'delete' => begin
|
|
|
|
|
<div class="input-field col s12 m12 l8">
|
|
|
|
|
<i class="material-icons prefix">lock</i>
|
|
|
|
|
%= password_field 'password', id => 'password', class => 'validate', required => undef, autocomplete => 'current-password'
|
|
|
|
|
<label for="password">Passwort</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-field col s12 m12 l4 center-align">
|
2019-03-12 20:49:26 +00:00
|
|
|
|
%= csrf_field
|
2019-05-16 13:02:17 +00:00
|
|
|
|
<button class="btn waves-effect waves-light caution-color" type="submit" name="action" value="delete">
|
2019-03-12 20:49:26 +00:00
|
|
|
|
Account löschen
|
|
|
|
|
</button>
|
2019-03-18 17:55:39 +00:00
|
|
|
|
</div>
|
|
|
|
|
%= end
|
2019-03-12 20:49:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
% }
|