clacks/lib/clacks_web/templates/frontend/profile.html.eex

34 lines
1.0 KiB
Elixir

<div class="h-card">
<h1 class="p-name"><%= @actor.data["preferredUsername"] %></h1>
<h2>
<a href="<%= @actor.ap_id %>" class="p-nickname u-url">
<%= display_username(@actor) %>
</a>
</h2>
<p><%= raw(@actor.data["summary"]) %></p>
</div>
<div class="actor-actions">
<%= unless @current_user == nil || @current_user.actor.ap_id == @actor.ap_id do %>
<%= case @following_state do %>
<% :not_following -> %>
<%= form_tag Routes.frontend_path(@conn, :follow, @actor.id), method: :post, class: "follow-form" do %>
<%= submit "Follow" %>
<% end %>
<% :following -> %>
<%= form_tag Routes.frontend_path(@conn, :unfollow, @actor.id), method: :post, class: "follow-form" do %>
<%= submit "Unfollow" %>
<% end %>
<% :pending -> %>
<!-- todo: cancel follow request -->
<button type="button">Pending</button>
<% end %>
<% end %>
</div>
<%= render "_timeline.html", conn: @conn, statuses_with_authors: @statuses_with_actor %>