<%= form_for(@user) do |f| %>
  <%= render partial: "layouts/errors", object: @user %>

  <fieldset>
    <legend><span><%= t('.provide_details') %></span></legend>
    <div class="clearfix">
      <%= f.label :first_name %>
      <div class="input">
        <div class="inline-inputs">
          <%= f.text_field :first_name, placeholder: t('.first_label'),autofocus: true, class: "input-large" %>
          <%= f.text_field :last_name, placeholder: t('.last_label'), class: "input-large" %>
        </div>
      </div>
    </div>

    <div class="clearfix">
      <%= f.label :email %>
      <div class="input">
        <%= f.text_field :email, placeholder: t('.email_label'), class: "input-xlarge" %>
      </div>
    </div>

    <% if @user.new_record? %>
      <div class="clearfix">
        <%= f.label :password %>
        <div class="input">
          <%= f.password_field :password, class: "input-medium" %>
        </div>
      </div>
      <div class="clearfix">
        <%= f.label :password_confirmation %>
        <div class="input">
          <%= f.password_field :password_confirmation, class: "input-medium" %>
        </div>
      </div>
    <% end %>
  </fieldset>

  <fieldset>
    <legend><span><%= t('.options') %></span></legend>

    <div class="clearfix">
      <%= f.label :locale %>
      <div class="input">
        <%= f.select :locale, options_for_select(I18n.available_locales, @user.locale? ? @user.locale.to_sym :  I18n.locale.to_sym) %>
      </div>
    </div>

    <div class="clearfix">
      <%= f.label :time_zone %>
      <div class="input">
        <%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones, default: ConcertoConfig[:system_time_zone]  %>
      </div>
    </div>

    <div class="clearfix">
      <div class="input checkbox">
        <%= f.check_box :receive_moderation_notifications %> <%= f.label :receive_moderation_notifications %>
      </div>
    </div>

    <% if can? :manage, @user %>
      <div class="clearfix">
        <div class="input checkbox">
          <%= f.check_box :is_admin %> <%= f.label :is_admin %>
        </div>
      </div>
    <% end %>
  </fieldset>
  <div class="submit_bar actions">
    <%= f.submit class: "btn btn-primary" %>
    <%= link_to t('users.change_password'), edit_user_registration_path, class: "btn" if current_user == @user %>
    <%= link_to t(:cancel), users_path, class: "btn" if current_user != @user %>
    <%= link_to t(:cancel), current_user, class: "btn" if current_user == @user %>
  </div>
<% end %>
