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">
|
|
|
|
|
% if ($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
|
|
|
|
% }
|
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-03 21:35:20 +00:00
|
|
|
|
<h1>Account</h1>
|
2019-03-18 17:47:52 +00:00
|
|
|
|
% my $acc = current_user();
|
2019-05-10 17:03:18 +00:00
|
|
|
|
% my $hook = get_webhook();
|
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">
|
|
|
|
|
<table class="striped">
|
|
|
|
|
<tr>
|
|
|
|
|
<th scope="row">Name</th>
|
|
|
|
|
<td><%= $acc->{name} %></td>
|
|
|
|
|
</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) {
|
|
|
|
|
Aktueller Status (nur für angemeldete Accounts)
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($acc->{is_public} & 0x02) {
|
2019-05-02 08:05:15 +00:00
|
|
|
|
Aktueller Status
|
2019-04-30 21:23:49 +00:00
|
|
|
|
% }
|
2019-12-08 10:06:17 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x04) {
|
2019-12-06 20:42:26 +00:00
|
|
|
|
mit Kommentar
|
|
|
|
|
% }
|
2020-02-19 19:58:38 +00:00
|
|
|
|
% if ($acc->{is_public} & 0x0f and $acc->{is_public} & 0xf0) {
|
|
|
|
|
<br/>
|
|
|
|
|
% }
|
|
|
|
|
% if ($acc->{is_public} & 0x10) {
|
|
|
|
|
Letzte zehn Fahrten (nur für angemeldete Accounts)
|
|
|
|
|
% }
|
|
|
|
|
% elsif ($acc->{is_public} & 0x20) {
|
|
|
|
|
Letzte zehn Fahrten
|
|
|
|
|
% }
|
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}) {
|
|
|
|
|
Aktiv, fehlerhaft <i class="material-icons">error</i>
|
|
|
|
|
% }
|
|
|
|
|
% else {
|
|
|
|
|
Aktiv
|
|
|
|
|
% }
|
|
|
|
|
</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-05-02 09:29:43 +00:00
|
|
|
|
<h2>API</h2>
|
2019-03-16 12:56:56 +00:00
|
|
|
|
% my $token = get_api_token();
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
|
|
|
|
<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-16 13:17:02 +00:00
|
|
|
|
<h2>Export</h2>
|
2019-03-03 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
|
|
|
|
<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}) {
|
2019-03-16 13:17:02 +00:00
|
|
|
|
<h2>Löschen</h2>
|
2019-03-12 20:49:26 +00:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col s12">
|
|
|
|
|
<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>
|
|
|
|
|
% }
|