Files
fizzy/app/views/users/show.html.erb
T
2025-12-06 14:29:49 -03:00

54 lines
2.1 KiB
Plaintext

<% @page_title = @user.name %>
<% me_or_you = Current.user == @user ? "me" : @user.first_name %>
<div class="profile-layout">
<section class="panel shadow txt-align-center" style="--panel-size: 45ch;">
<div class="flex flex-column gap position-relative">
<% if Current.user == @user %>
<%= link_to edit_user_path(@user), class: "user-edit-link btn", data: { controller: "tooltip" } do %>
<%= icon_tag "pencil" %>
<span class="for-screen-reader">Edit profile</span>
<% end %>
<% end %>
<div class="avatar txt-xx-large center fill-white btn--circle hide-focus-ring">
<%= image_tag user_avatar_path(@user), alt: "Profile avatar for #{@user.name}" %>
</div>
<div class="flex flex-column gap-half margin-block-end">
<h1 class="txt-x-large margin-none"><%= @user.name %></h1>
<div class="txt-medium">
<% if @user.active? %>
<%= mail_to @user.identity.email_address %>
<% else %>
<%= @user.name %> is no longer on this account
<% end %>
</div>
</div>
<div class="flex-inline center justify-center flex-wrap gap">
<%= link_to "Which cards are assigned to #{me_or_you}?",
cards_path(assignee_ids: [ @user.id ], sorted_by: "newest"), class: "btn", data: { turbo_frame: "_top" } %>
<%= link_to "Which cards were added by #{me_or_you}?",
cards_path(creator_ids: [ @user.id ], sorted_by: "newest"), class: "btn", data: { turbo_frame: "_top" } %>
</div>
</div>
</section>
<% if Current.user == @user %>
<section class="panel shadow" style="--panel-size: 45ch;">
<%= render "users/transfer", user: @user %>
<%= render "users/theme" %>
<div class="center margin-block-start-double">
<%= button_to session_url(script_name: nil), method: :delete, class: "btn btn--plain txt-link txt-small", data: { turbo: false } do %>
<span>Sign out</span>
<% end %>
</div>
</section>
<% end %>
</div>
<%= turbo_frame_tag "user_events", src: user_events_path(@user) %>