summaryrefslogtreecommitdiff
path: root/templates/profile.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/profile.html.ep')
-rw-r--r--templates/profile.html.ep81
1 files changed, 72 insertions, 9 deletions
diff --git a/templates/profile.html.ep b/templates/profile.html.ep
index 6a8d67d..6f78ea0 100644
--- a/templates/profile.html.ep
+++ b/templates/profile.html.ep
@@ -10,20 +10,83 @@
</div>
</div>
% }
-% if ($public_level & 0x02 or ($public_level & 0x01 and is_user_authenticated())) {
- <div class="row">
- <div class="col s12 publicstatuscol" data-user="<%= $name %>">
- %= include '_public_status_card', name => $name, public_level => $public_level, journey => $journey
+<div class="row">
+ <div class="col s12">
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title"><%= $name %>
+ % if ($following and $follows_me) {
+ <i class="material-icons right">group</i>
+ % }
+ % elsif ($follow_reqs_me) {
+ <span class="right">
+ <a href="/account/social/follow-requests-received"><i class="material-icons right">notifications</i></a>
+ </span>
+ % }
+ % elsif ($is_self) {
+ <a href="/account/profile"><i class="material-icons right">edit</i></a>
+ % }
+ </span>
+ % if ($bio) {
+ %== $bio
+ % }
+ % if (@{$metadata // []}) {
+ <table class="striped">
+ % for my $entry (@{$metadata}) {
+ <tr>
+ <th scope="row"><%= $entry->{key} %></th>
+ <td scope="row"><%== $entry->{value}{html} %></td>
+ </tr>
+ % }
+ </table>
+ % }
+ </div>
+ % if ($following or $follow_requested or $can_follow or $can_request_follow) {
+ <div class="card-action <%= ($can_follow or $can_request_follow) ? 'right-align' : q{} %>">
+ %= form_for "/social-action" => (method => 'POST') => begin
+ %= csrf_field
+ %= hidden_field target => $uid
+ %= hidden_field redirect_to => 'profile'
+ % if ($following) {
+ <button class="btn-flat waves-effect waves-light" type="submit" name="action" value="unfollow">
+ Nicht mehr folgen
+ </button>
+ % }
+ % elsif ($follow_requested) {
+ <button class="btn-flat waves-effect waves-light" type="submit" name="action" value="cancel_follow_request">
+ Folge-Anfrage zurücknehmen
+ </button>
+ % }
+ % elsif ($can_follow or $can_request_follow) {
+ <button class="btn-flat waves-effect waves-light" type="submit" name="action" value="follow_or_request">
+ <i class="material-icons left" aria-hidden="true">person_add</i>
+ % if ($follows_me) {
+ Zurückfolgen
+ % }
+ % else {
+ Folgen
+ % }
+ % if ($can_request_follow) {
+ anfragen
+ % }
+ </button>
+ % }
+ %= end
+ </div>
+ % }
</div>
</div>
-% }
-% if ($public_level & 0x20 or ($public_level & 0x10 and is_user_authenticated())) {
+</div>
+<div class="row">
+ <div class="col s12 publicstatuscol" data-user="<%= $name %>" data-profile="1">
+ %= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, from_profile => 1
+ </div>
+</div>
+% if ($journeys and @{$journeys}) {
<div class="row">
<div class="col s12">
- <h2>Letzte Fahrten von <%= $name %></h1>
+ <h2>Vergangene Fahrten</h2>
</div>
</div>
%= include '_history_trains', date_format => '%d.%m.%Y', link_prefix => "/p/${name}/j/", journeys => $journeys;
% }
-
-%= include '_footer', version => stash('version')