summaryrefslogtreecommitdiff
path: root/templates/account.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/account.html.ep')
-rw-r--r--templates/account.html.ep208
1 files changed, 176 insertions, 32 deletions
diff --git a/templates/account.html.ep b/templates/account.html.ep
index e6a4576..7f689c2 100644
--- a/templates/account.html.ep
+++ b/templates/account.html.ep
@@ -1,4 +1,4 @@
-% if (my $invalid = stash('invalid')) {
+% if (my $invalid = flash('invalid')) {
%= include '_invalid_input', invalid => $invalid
% }
@@ -7,7 +7,10 @@
<div class="col s12">
<div class="card success-color">
<div class="card-content white-text">
- % if ($success eq 'mail') {
+ % if ($success eq 'name') {
+ <span class="card-title">Name geändert</span>
+ % }
+ % elsif ($success eq 'mail') {
<span class="card-title">Mail-Adresse geändert</span>
% }
% elsif ($success eq 'password') {
@@ -16,28 +19,41 @@
% elsif ($success eq 'privacy') {
<span class="card-title">Einstellungen zu öffentlichen Account-Daten geändert</span>
% }
+ % elsif ($success eq 'social') {
+ <span class="card-title">Einstellungen zur Interaktionen mit anderen Accounts geändert</span>
+ % }
+ % elsif ($success eq 'traewelling') {
+ <span class="card-title">Träwelling-Verknüpfung aktualisiert</span>
+ % }
% elsif ($success eq 'use_history') {
<span class="card-title">Einstellungen zu vorgeschlagenen Verbindungen geändert</span>
% }
+ % elsif ($success eq 'external') {
+ <span class="card-title">Einstellungen zu externen Diensten geändert</span>
+ % }
% elsif ($success eq 'webhook') {
<span class="card-title">Web Hook aktualisiert</span>
% }
+ % elsif ($success eq 'clear_notifications') {
+ <span class="card-title">Benachrichtigungen gelesen</span>
+ % }
</div>
</div>
</div>
</div>
% }
-<h1>Account</h1>
% my $acc = current_user();
-% my $hook = get_webhook();
-% my $use_history = account_use_history($acc->{id});
+% my $hook = users->get_webhook(uid => $acc->{id});
+% my $traewelling = traewelling->get(uid => $acc->{id});
+% my $use_history = users->use_history(uid => $acc->{id});
<div class="row">
<div class="col s12">
+ <h2>Account</h2>
<table class="striped">
<tr>
<th scope="row">Name</th>
- <td><%= $acc->{name} %></td>
+ <td><a href="/account/name"><i class="material-icons">edit</i></a><%= $acc->{name} %></td>
</tr>
<tr>
<th scope="row">Mail</th>
@@ -60,20 +76,31 @@
</td>
</tr>
<tr>
- <th scope="row">Öffentliche Daten</th>
+ <th scope="row">Sichtbarkeit</th>
<td>
<a href="/account/privacy"><i class="material-icons">edit</i></a>
- % if ($acc->{is_public} == 0) {
- <span style="color: #999999;">Keine</span>
- % }
- % if ($acc->{is_public} & 0x01) {
- Aktueller Status (nur für angemeldete Accounts)
+ <i class="material-icons">check</i><i class="material-icons"><%= visibility_icon($acc->{default_visibility_str}) %></i>
+ • <i class="material-icons">history</i><i class="material-icons"><%= visibility_icon($acc->{past_visibility_str}) %></i>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row">Interaktion</th>
+ <td>
+ <a href="/account/social"><i class="material-icons">edit</i></a>
+ % if ($acc->{accept_follows}) {
+ <span>Accounts können dir direkt folgen</span>
% }
- % elsif ($acc->{is_public} & 0x02) {
- Aktueller Status
+ % elsif ($acc->{accept_follow_requests}) {
+ <span>Accounts können dir auf Anfrage folgen
+ % if ($num_rx_follow_requests == 1) {
+ – <a href="/account/social/follow-requests-received"><strong>eine</strong> offene Anfrage</a>
+ % } elsif ($num_rx_follow_requests) {
+ – <a href="/account/social/follow-requests-received"><strong><%= $num_rx_follow_requests %></strong> offene Anfragen</a>
+ % }
+ </span>
% }
- % if ($acc->{is_public} & 0x04) {
- mit Kommentar
+ % else {
+ <span style="color: #999999;">Accounts können dir nicht folgen</span>
% }
</td>
</tr>
@@ -88,13 +115,54 @@
Aktiv, noch nicht ausgeführt
% }
% elsif ($hook->{errored}) {
- Aktiv, fehlerhaft <i class="material-icons">error</i>
+ Aktiv, fehlerhaft <i class="material-icons" aria-hidden="true">error</i>
% }
% else {
Aktiv
% }
</td>
</tr>
+ % if (config->{traewelling}{oauth}) {
+ <tr>
+ <th scope="row">Träwelling</th>
+ <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}) {
+ Fehlerhaft <i class="material-icons" aria-hidden="true">error</i>
+ % }
+ % else {
+ Verknüpft mit <%= $traewelling->{data}{user_name} // $traewelling->{email} %>
+ % 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}) {
+ – Checkins in Träwelling werden von travelynx übernommen
+ % }
+ % elsif ($traewelling->{push_sync}) {
+ – Checkins in travelynx werden zu Träwelling weitergereicht
+ % }
+ % }
+ </td>
+ </tr>
+ % }
+ <tr>
+ <th scope="row">Externe Dienste</th>
+ <td>
+ <a href="/account/services"><i class="material-icons">edit</i></a>
+ % if ($acc->{sb_name}) {
+ Abfahrtstafel: <%= $acc->{sb_name} %>
+ % }
+ % else {
+ <span style="color: #999999;">Keine</span>
+ % }
+ </td>
+ </tr>
<tr>
<th scope="row">Registriert am</th>
<td><%= $acc->{registered_at}->strftime('%d.%m.%Y %H:%M') %></td>
@@ -113,15 +181,101 @@
</div>
</div>
-<h2>API</h2>
-% my $token = get_api_token();
+% if ($num_rx_follow_requests or $num_tx_follow_requests or $num_followers or $num_following or $num_blocked) {
+ <div class="row">
+ <div class="col s12">
+ <h2>Interaktion</h2>
+ <p>
+ <a href="/p/<%= $acc->{name} %>">Öffentliches Profil</a>
+ </p>
+ <table class="striped">
+ <tr>
+ <th scope="row">Anfragen</th>
+ <td>
+ % if ($num_rx_follow_requests == 0) {
+ <span style="color: #999999;">keine eingehend</span>
+ % }
+ % elsif ($num_rx_follow_requests == 1) {
+ <a href="/account/social/follow-requests-received"><strong>eine</strong> eingehend</a>
+ % }
+ % else {
+ <a href="/account/social/follow-requests-received"><strong><%= $num_rx_follow_requests %></strong> eingehend</a>
+ % }
+ <br/>
+ % if ($num_tx_follow_requests == 0) {
+ <span style="color: #999999;">keine ausgehend</span>
+ % }
+ % elsif ($num_tx_follow_requests == 1) {
+ <a href="/account/social/follow-requests-sent"><strong>eine</strong> ausgehend</a>
+ % }
+ % else {
+ <a href="/account/social/follow-requests-sent"><strong><%= $num_tx_follow_requests %></strong> ausgehend</a>
+ % }
+ </td>
+ </tr>
+ <tr>
+ <th scope="row">Dir folg<%= $num_followers == 1 ? 't' : 'en' %></th>
+ <td>
+ % if ($num_followers == 0) {
+ <span style="color: #999999;">keine Accounts</span>
+ % }
+ % elsif ($num_followers == 1) {
+ <a href="/account/social/followers"><strong>ein</strong> Account</a>
+ % }
+ % else {
+ <a href="/account/social/followers"><strong><%= $num_followers %></strong> Accounts</a>
+ % }
+ </td>
+ </tr>
+ <tr>
+ <th scope="row">Du folgst</th>
+ <td>
+ % if ($num_following == 0) {
+ <span style="color: #999999;">keinen Accounts</span>
+ % }
+ % elsif ($num_following == 1) {
+ <a href="/account/social/follows"><strong>einem</strong> Account</a>
+ % }
+ % else {
+ <a href="/account/social/follows"><strong><%= $num_following %></strong> Accounts</a>
+ % }
+ </td>
+ </tr>
+ <tr>
+ <th scope="row">Blockiert</th>
+ <td>
+ % if ($num_blocked == 0) {
+ <span style="color: #999999;">keine Accounts</span>
+ % }
+ % elsif ($num_blocked == 1) {
+ <a href="/account/social/blocks"><strong>ein</strong> Account</a>
+ % }
+ % else {
+ <a href="/account/social/blocks"><strong><%= $num_blocked %></strong> Accounts</a>
+ % }
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+% }
+% else {
+ <div class="row">
+ <div class="col s12">
+ <a href="/p/<%= $acc->{name} %>">Öffentliches Profil</a>
+ </div>
+ </div>
+% }
+
+% my $token = stash('api_token') // {};
<div class="row">
<div class="col s12">
+ <h2>API</h2>
<p>
Die folgenden API-Token erlauben den passwortlosen automatisierten Zugriff auf
API-Endpunkte. Bitte umsichtig behandeln – sobald ein Token gesetzt
ist, können damit ohne Logindaten alle zugehörigen API-Aktionen
- ausgeführt werden.
+ ausgeführt werden. <a href="/api">Dokumentation</a>.
</p>
<table class="striped">
<tr>
@@ -170,7 +324,6 @@
%= end
</td>
</tr>-->
- % if (app->mode eq 'development') {
<tr>
<th scope="row">Travel</th>
<td>
@@ -217,22 +370,13 @@
%= end
</td>
</tr>
- % }
</table>
</div>
</div>
<div class="row">
<div class="col s12">
- <a href="/api">Dokumentation</a>
- </div>
-</div>
-
-
-<h2>Export</h2>
-
-<div class="row">
- <div class="col s12">
+ <h2>Export</h2>
<ul>
<li><a href="/export.json">Rohdaten</a> (Kein API-Ersatz, das Format kann sich jederzeit ändern)</li>
</ul>
@@ -240,9 +384,9 @@
</div>
% if (not $acc->{deletion_requested}) {
- <h2>Löschen</h2>
<div class="row">
<div class="col s12">
+ <h2>Löschen</h2>
<p>
Der Löschauftrag wird vorgemerkt und erst nach drei Tagen
umgesetzt, bis dahin kann er jederzeit zurückgenommen werden. Nach