tabletop-companion/app/views/users/_form.html.erb

50 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-04-18 19:58:38 +00:00
<%# locals: (user:, button_text:) -%>
2024-04-14 19:01:32 +00:00
2024-04-21 12:45:31 +00:00
<section class="inset">
<%= form_with model: user do |f| %>
<%= f.label :username %>
2024-05-30 08:07:54 +00:00
<%= f.text_field :username, required: true, disabled: user.persisted? %>
2024-05-29 07:46:31 +00:00
<%= display_form_errors(user, :username) %>
2024-04-14 19:01:32 +00:00
2024-04-21 12:45:31 +00:00
<%= f.label :first_name %>
<%= f.text_field :first_name %>
2024-05-29 07:46:31 +00:00
<%= display_form_errors(user, :first_name) %>
2024-04-14 19:01:32 +00:00
2024-04-21 12:45:31 +00:00
<%= f.label :last_name %>
<%= f.text_field :last_name %>
2024-05-29 07:46:31 +00:00
<%= display_form_errors(user, :last_name) %>
2024-04-14 19:01:32 +00:00
2024-04-21 12:45:31 +00:00
<%= f.label :email %>
2024-05-30 08:07:54 +00:00
<%= f.text_field :email, required: true, disabled: user.persisted? %>
2024-05-29 07:46:31 +00:00
<%= display_form_errors(user, :email) %>
2024-04-14 19:01:32 +00:00
2024-06-04 08:09:59 +00:00
<% if user.new_record? %>
<fieldset>
<legend><%= t(".password") %></legend>
<%= f.label :password %>
<%= f.password_field :password, required: user.new_record? %>
<%= display_form_errors(user, :password) %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, required: user.new_record? %>
<%= display_form_errors(user, :password_confirmation) %>
</fieldset>
<% end %>
2024-05-30 08:07:54 +00:00
2024-05-30 14:30:25 +00:00
<hr>
2024-05-30 08:07:54 +00:00
<% if user.persisted? %>
2024-05-30 14:30:25 +00:00
<%= f.label :avatar %>
<%= f.file_field :avatar %>
<%= display_form_errors(user, :avatar) %>
2024-05-30 08:07:54 +00:00
<%= f.label :profile %>
<%= f.rich_text_area :profile %>
<%= display_form_errors(user, :profile) %>
<% end %>
2024-04-14 19:01:32 +00:00
2024-04-21 12:45:31 +00:00
<%= f.submit button_text %>
<% end %>
</section>