Files
fizzy/app/views/users/edit.html.erb
T
Andy Smith fdbb9c185e Merge branch 'main' into collection-nav
* main: (203 commits)
  Re-write help content, try a modal-like display
  Move to internal registry
  Show date instead of time for notifications older than 1 day
  Ensure checks are visible for tags and assignments
  Adjust padding so card number isn't cut off
  Don't color the collection header in considering
  Golden cards bubble to the top of Considering, too
  Adjust card collection header when colored golden
  Allow cards in Considering to gilded
  Hide focus ring on new card titles and step inputs
  Add hover effect for comment edit button
  Add hover effect to overflow button
  Improve multi-account behavior of the PWA
  Remove unneeded *
  Rename test
  Review the code to move cards
  Update editor
  Generalize and delete mentions too
  Remove unused code
  Make sure we don't remove accesses if collection is accessible
  ...
2025-07-08 15:34:01 -05:00

62 lines
3.0 KiB
Plaintext

<% @page_title = "Edit your profile" %>
<% content_for :header do %>
<nav class="header">
<div class="header__actions header__actions--start">
<%= link_to_back fallback_path: user_path(@user) %>
</div>
<div class="header__actions header__actions--end"></div>
</nav>
<% end %>
<div class="panel shadow center">
<div class="flex flex-column gap txt-medium">
<%= form_with model: @user, method: :patch, class: "flex flex-column gap", data: { controller: "form upload-preview" } do |form| %>
<div class="align-center center avatar__form gap">
<span class="btn btn--placeholder txt-small"></span>
<label class="avatar btn btn--circle input--file txt-xx-large center fill-white">
<%= image_tag user_avatar_path(@user), aria: { hidden: "true" }, class: "avatar", size: 128, data: { upload_preview_target: "image" } %>
<%= form.file_field :avatar, id: "file", class: "input", accept: "image/*",
data: { upload_preview_target: "input", action: "upload-preview#previewImage" } %>
<span class="for-screen-reader">Profile avatar for <%= @user.name %></span>
</label>
<% if @user.avatar.attached? %>
<%= tag.button type: :submit, form: "avatar-delete-form", class: "btn btn--negative txt-small", data: { turbo_confirm: "Are you sure you want to remove your avatar? This can't be undone." } do %>
<%= icon_tag "minus" %>
<span class="for-screen-reader">Delete avatar</span>
<% end %>
<% end %>
</div>
<div class="flex align-center gap">
<label class="flex align-center gap input input--actor">
<%= form.text_field :name, class: "input full-width", autocomplete: "name", placeholder: "Name", autofocus: true, required: true, data: { "1p-ignore": true, action: "keydown.esc@document->form#cancel" } %>
<%= icon_tag "person", class: "txt-large" %>
</label>
</div>
<div class="flex align-center gap">
<label class="flex align-center gap input input--actor">
<%= form.email_field :email_address, class: "input full-width", autocomplete: "username", placeholder: "Email address", required: true %>
<%= icon_tag "email", class: "txt-large" %>
</label>
</div>
<div class="flex align-center gap">
<label class="flex align-center gap input input--actor">
<%= form.password_field :password, class: "input full-width", autocomplete: "new-password", placeholder: "Password", required: false, maxlength: 72 %>
<%= icon_tag "password", class: "txt-large" %>
</label>
</div>
<button type="submit" id="log_in" class="btn btn--reversed center">
<%= icon_tag "check" %>
<span>Save changes</span>
</button>
<%= link_to "Cancel and go back", user_path(@user), data: { form_target: "cancel", turbo_frame: "_top" }, hidden: true %>
<% end %>
<%= form_with url: user_avatar_url(@user), method: :delete, id: "avatar-delete-form" %>
</div>
</div>