%= javascript_include_tag "enhanceColorPickers", "stickySaveFooter", "userProfileSettings", "validateFileInputs", defer: true %>
<%= render "users/additional_authentication" %>
<%= form_with(url: profile_path(@user.profile_id), method: "put", html: { class: "sticky-footer-form", id: "user-profile-form" }) do |f| %>
<%= t("views.settings.group.user") %>
<%= f.label :name, t("helpers.label.user.name"), for: "user[name]", class: "crayons-field__label" %>
<%= f.text_field "user[name]",
maxlength: 30,
class: "crayons-textfield",
placeholder: t("helpers.placeholder.user.name"),
value: @user.name %>
<%= f.label :email, t("helpers.label.user.email"), for: "user[email]", class: "crayons-field__label" %>
<%= f.text_field "user[email]",
maxlength: 50,
class: "crayons-textfield",
placeholder: t("helpers.placeholder.user.email"),
value: @user.email %>
<%= f.check_box "users_setting[display_email_on_profile]", class: "crayons-checkbox", checked: @user.setting.display_email_on_profile %>
<%= f.label :display_email_on_profile, t("views.users.profile_fields.display_email_on_profile"), for: "users_setting[display_email_on_profile]", class: "crayons-field__label" %>
<%= f.label :username, t("helpers.label.user.username"), for: "user[username]", class: "crayons-field__label" %>
<%= f.text_field "user[username]",
maxlength: 30,
class: "crayons-textfield",
placeholder: t("helpers.placeholder.user.username"),
value: @user.username %>
<%= f.label :profile_image, t("helpers.label.user.profile_image"), for: "user[profile_image]", class: "crayons-field__label" %>
<% if @user.profile_image_url.present? %>
<% end %>
<%= f.file_field "user[profile_image]", accept: "image/*", class: "crayons-card crayons-card--secondary p-3 flex items-center flex-1 w-100" %>
<% profile = @user.profile %>
<%= t("views.settings.group.Basic") %>
<%= f.url_field "profile[website_url]",
maxlength: 100,
value: profile.website_url,
placeholder: "https://yoursite.com",
class: "crayons-textfield",
aria: { describedby: "url-description" },
data: { character_span_id: "url-characters" } %>
<%= t("views.settings.characters") %>
/100
<%= f.text_field "profile[location]",
maxlength: 100,
value: profile.location,
placeholder: t("views.users.profile_fields.location.placeholder"),
class: "crayons-textfield",
aria: { describedby: "location-description" },
data: { character_span_id: "location-characters" } %>
<%= t("views.settings.characters") %>
/100
<%= f.text_area "profile[summary]",
maxlength: 200,
value: profile.summary,
placeholder: t("views.users.profile_fields.bio.placeholder"),
class: "crayons-textfield",
aria: { describedby: "summary-description" },
data: { character_span_id: "summary-characters" } %>
<%= t("views.settings.characters") %>
/200
<% ProfileFieldGroup.non_empty_groups.each do |group| %>
<%= t("views.settings.group.#{group.name}", default: group.name) %>
<% if group.description.present? %>
<%= group.description %>
<% end %>
<% group.profile_fields.each do |field| %>
<% next if field.attribute_name == "display_email_on_profile" %>
">
<% if field["input_type"] == "check_box" %>
<%= f.public_send(field["input_type"],
"profile[#{field.attribute_name}]",
checked: profile.public_send(field.attribute_name),
class: "crayons-checkbox") %>
<% else %>
<% if field.description.present? %>
<%= field.description %>
<% end %>
<%= f.public_send(field["input_type"],
"profile[#{field.attribute_name}]",
value: profile.public_send(field.attribute_name),
placeholder: field["placeholder_text"],
aria: { describedby: "#{field.attribute_name}-description" },
data: { character_span_id: "#{field.attribute_name}-characters" },
class: "crayons-textfield") %>
<%= t("views.settings.characters") %>
/<%= character_count_denominator(field["input_type"]) %>
<% end %>
<% end %>
<% end %>
<% users_setting = @user.setting %>
<%= t("views.settings.group.Branding") %>
<%= t("views.profile.color.description") %>
<%= f.public_send(:text_field, "users_setting[brand_color1]",
value: users_setting.public_send(:brand_color1),
placeholder: "#000000",
class: "crayons-textfield",
data: { color_picker: "true", label_text: t("views.profile.color.label") }) %>
<% end %>