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.ep211
1 files changed, 154 insertions, 57 deletions
diff --git a/templates/account.html.ep b/templates/account.html.ep
index 5e30c77..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
% }
@@ -19,15 +19,24 @@
% 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>
@@ -35,8 +44,8 @@
% }
% my $acc = current_user();
-% my $hook = get_webhook();
-% my $traewelling = traewelling->get($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">
@@ -67,35 +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 mit Anmeldung)
- % }
- % elsif ($acc->{is_public} & 0x02) {
- Aktueller Status
- % }
- % if ($acc->{is_public} & 0x0f and $acc->{is_public} & 0xf0) {
- <br/>
+ <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>
% }
- % 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)
+ % 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) {
- <br/>
- Kommentare
+ % else {
+ <span style="color: #999999;">Accounts können dir nicht folgen</span>
% }
</td>
</tr>
@@ -117,30 +122,44 @@
% }
</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">Träwelling</th>
+ <th scope="row">Externe Dienste</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>
+ <a href="/account/services"><i class="material-icons">edit</i></a>
+ % if ($acc->{sb_name}) {
+ Abfahrtstafel: <%= $acc->{sb_name} %>
% }
% 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
- % }
+ <span style="color: #999999;">Keine</span>
% }
</td>
</tr>
@@ -162,7 +181,93 @@
</div>
</div>
-% 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>
@@ -170,7 +275,7 @@
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>
@@ -271,14 +376,6 @@
<div class="row">
<div class="col s12">
- <a href="/api">Dokumentation</a>
- </div>
-</div>
-
-
-
-<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>