<%= form_for @admin, :url => url_for(:controller => 'administrators', :action => @action) do |f| %>
<%= render :partial => 'roroacms/admin/partials/submit_bar', :locals => { admin_record: @admin } %>
<% if !@admin.id.blank? %>
<% if @admin.avatar.blank? %> <%= image_tag("roroacms/default-profile.jpg", size: "140", class: "img-circle") %> <% else %> <% end %>

<%= @admin.username %>

<% if !@admin.first_name.blank? %> <%= @admin.first_name + ' ' + @admin.last_name %> <% end %>
<%= render partial: 'roroacms/admin/partials/cover_image', locals: { image: @admin.cover_picture } %> <%= f.file_field :cover_picture, :class => "", :id => "cover_image" %>
<% else %>
<%= image_tag("roroacms/default-profile.jpg", size: "140", class: "img-circle") %>
<%= t("views.admin.generic.change_cover") %> <%= hidden_field_tag :has_cover_image, "" %> <%= f.file_field :cover_picture, :class => "" %>
<% end %>
<%= f.label :first_name, :class => "col-sm-3 control-label" %>
<%= f.text_field :first_name, size: 40, :class => "form-control" %>
<%= f.label :last_name, :class => "col-sm-3 control-label" %>
<%= f.text_field :last_name, size: 40, :class => "form-control" %>
<%= f.label :email, :class => "col-sm-3 control-label" %>
<%= f.text_field :email, size: 40, :class => "form-control" %> <%= errors_for @admin, :email %>
<%= f.label :username, :class => "col-sm-3 control-label" %>
<%= f.text_field :username, size: 40, :class => "form-control" %> <%= errors_for @admin, :username %>
<%= f.label :avatar, :class => "col-sm-3 control-label" %>
<%= t("views.admin.generic.browse") %><%= f.file_field :avatar, :class => "" %> <%= t("views.admin.administrators.form.ideal_size") %>
<% if (is_overlord? || @admin.id == nil) && @admin.id != current_user.id %>
<%= f.label :access_level, :class => "col-sm-3 control-label" %>
<%= f.select :access_level, Roroacms::Admin.access_levels, { prompt: t("views.admin.administrators.form.select_access_level") }, { class: "form-control" } %> <%= errors_for @admin, :access_level %>
<% end %>
<%= f.label :description, :class => "col-sm-3 control-label" %>
<%= f.text_area :description, :class => "form-control" %>
<%= f.label :password, :class => "col-sm-3 control-label" %>
<%= f.password_field :password, :class => "form-control" %> <%= errors_for @admin, :password %>
<%= f.label :password_confirmation, :class => "col-sm-3 control-label" %>
<%= f.password_field :password_confirmation, :class => "form-control" %> <%= errors_for @admin, :password_confirmation %>
<% end %>