ArturT/Railstom

View on GitHub
app/views/devise/registrations/edit.html.erb

Summary

Maintainability
Test Coverage
<% content_for :my_account_content do %>
  <h2><%= t('.title', :resource => resource_name.to_s.humanize , :default => 'Edit #{resource_name.to_s.humanize}') %></h2>

  <% if @show_change_password_form %>
    <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
      <%= f.error_notification %>

      <div class="form-inputs">
        <%= f.input :email, :required => true, :autofocus => true, placeholder: t('layouts.application.placeholders.email') %>

        <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
          <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
        <% end %>

        <br />

        <%= f.input :password, :autocomplete => "off", :hint => t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it"), :required => false, placeholder: t('layouts.application.placeholders.password') %>
        <%= f.input :password_confirmation, :required => false, placeholder: t('layouts.application.placeholders.password') %>

        <br />

        <%= f.input :current_password, :hint => t('.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes'), :required => true, placeholder: t('layouts.application.placeholders.password') %>
      </div>

      <br>

      <div class="form-actions">
        <%= f.button :submit, t('.update', :default => "Update") %>
      </div>
    <% end %>
  <% else %>
    <%= t('registrations.edit.facebook.reset_password.message_html', reset_password_link: link_to(t('registrations.edit.facebook.reset_password.link'), reset_password_user_registration_path)) %>
  <% end %>
<% end %>

<%= render 'common/my_account' %>