<% provide(:head_title, t("users.registrations.edit.head_title")) %>

<%=t "users.registrations.edit.title" %>

<% if not resource.errors.empty? %>
<%= devise_error_messages! %>
<% end %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, "data-for" => "avatar" }) do |f| %> <%= hidden_field_tag "user[change_avatar]", "true" %>
<%= f.label t("users.registrations.edit.avatar_label") %>
<% @user_avatar_url ||= avatar_path(current_user, :thumb) %> <%= image_tag @user_avatar_url %>

<%=t "users.registrations.edit.avatar_btn" %>

<%=t "users.registrations.edit.avatar_title" %>

<%= f.label :avatar, t("users.registrations.edit.avatar_edit_label") %> <%= f.file_field :avatar, class: "btn btn-default" %>
<%=t "general.cancel" %> <%= f.submit t("users.registrations.edit.avatar_submit"), class: 'btn btn-primary', onclick: "processFile(event, #{@direct_upload});" %>
<% end %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name, format: :json), remote: true, html: { method: :put, "data-for" => "full_name" }) do |f| %>
<%= f.label t("users.registrations.edit.name_label") %>

<%=t "users.registrations.edit.name_title" %>

<%= f.label :full_name, t("users.registrations.edit.name_label") %> <%= f.text_field :full_name, class: "form-control", "data-role" => "edit" %>
<%=t "general.cancel" %> <%= f.submit t("general.update"), class: "btn btn-primary" %>
<% end %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name, format: :json), remote: true, html: { method: :put, "data-for" => "initials" }) do |f| %>
<%= f.label t("users.registrations.edit.initials_label") %>

<%=t "users.registrations.edit.initials_title" %>

<%= f.label :initials, t("users.registrations.edit.initials_label") %> <%= f.text_field :initials, class: "form-control", "data-role" => "edit" %>
<%=t "general.cancel" %> <%= f.submit t("general.update"), class: "btn btn-primary" %>
<% end %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name, format: :json), remote: true, html: { method: :put, "data-for" => "email" }) do |f| %>
<%= f.label t("users.registrations.edit.email_label") %> <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> <% end %>

<%=t "users.registrations.edit.email_title" %>

<%= f.label :email, t("users.registrations.edit.new_email_label") %> <%= f.email_field :email, class: "form-control", "data-role" => "edit" %>
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <%=t "users.registrations.edit.password_explanation" %> <%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%=t "general.cancel" %> <%= f.submit t("general.update"), class: "btn btn-primary" %>
<% end %> <%= form_for(resource, as: resource_name, url: registration_path(resource_name, format: :json), remote: true, html: { method: :put, "data-for" => "password" }) do |f| %> <%= hidden_field_tag "user[change_password]", "true" %>
<%= f.label t("users.registrations.edit.password_label") %>

<%=t "users.registrations.edit.password_title" %>

<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <%=t "users.registrations.edit.password_explanation" %> <%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%= f.label :password, t("users.registrations.edit.new_password_label") %> <%= f.password_field :password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%= f.label :password_confirmation, t("users.registrations.edit.new_password_2_label") %> <%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%=t "general.cancel" %> <%= f.submit t("general.update"), class: "btn btn-primary" %>
<% end %>
<%= javascript_include_tag("canvas-to-blob.min") %> <%= javascript_include_tag("direct-upload") %> <%= javascript_include_tag "users/registrations/edit" %>