edit.html.erb 3.56 KB
<div class="page-header">
  <h1><%= t('.title', :resource => resource_class.model_name.human , :default => "Edit #{resource_name.to_s.humanize}") %></h1>
</div>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => "form-inline" }) do |f| %>
  <%= devise_error_messages! %>

  <div class="row margin-left-none">
    <div class="form-table col-md-9">
      <div class="form-row">
        <div class="field-container">
          <%= f.label :name, class: 'control-label' %><br />
          <%= f.text_field :name, :autofocus => true, class: 'text-field form-control' %>
        </div>
        <div class="help-container">
          <p>
            <%= t('.your_full_name')%>
          </p>
        </div>
      </div>
      <div class="form-row">
        <div class="field-container">
          <%= f.label :email, class: 'control-label' %><br />
          <%= f.email_field :email, class: 'text-field form-control' %>
          <%- if devise_mapping.confirmable? && resource.pending_reconfirmation? -%>
            <p>
              <%= t('.currently_waiting_confirmation_for_email', :email => resource.unconfirmed_email, :default => "Currently waiting confirmation for: %{email}") %>
            </p>
          <%- end -%>
        </div>
        <div class="help-container">
          <p>
            <%= t('.your_email_is_our_communication_channel')%>
          </p>
        </div>
      </div>

      <% if current_user && current_user.provider.nil? %>
      <div class="form-row">
        <div class="field-container">
          <%= f.label :password, class: 'control-label' %> <i>(<%= t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)</i><br />
          <%= f.password_field :password, :autocomplete => "off", class: 'text-field form-control' %>
        </div>
        <div class="help-container">
          <p>
            <%= t('.password_instructions')%>
          </p>
        </div>
      </div>

      <div class="form-row">
        <div class="field-container">
          <%= f.label :password_confirmation, class: 'control-label' %><br />
          <%= f.password_field :password_confirmation, class: 'text-field form-control' %>
        </div>
        <div class="help-container">
          <p>
            <%= t('.confirm_your_password')%>
          </p>
        </div>
      </div>

      <div class="form-row">
        <div class="field-container">
          <%= f.label :current_password, class: 'control-label' %> <i>(<%= t('.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes') %>)</i><br />
          <%= f.password_field :current_password, class: 'text-field form-control' %>
        </div>
        <div class="help-container">
          <p>
            <%= t('.current_password_required')%>
          </p>
        </div>
      </div>
      <% end %>

      <div class="row margin-left-none" style="margin-top: 20px">
        <%= f.submit t('.update', :default => "Update"), class: 'btn btn-primary col-md-2' %>
      </div>
    </div>
  </div>
<% end %>

<hr />
<h2><%= t('.cancel_my_account', :default => 'Cancel my account') %></h2>

<p><%= t('.unhappy', :default => 'Unhappy') %>? <%= link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete, class: 'btn btn-warning' %>.</p>

<%= link_to t('devise.shared.links.back', :default => "Back"), :back, class: 'btn btn-default' %>