<%= simple_form_for @user, :html => { :class => 'form-horizontal' } do |f| %>
  <%= f.input :email %>
  <%= error_span(@user[:email]) %>
  <%= f.input :first_name %>
  <%= error_span(@user[:first_name]) %>
  <%= f.input :last_name %>
  <%= error_span(@user[:last_name]) %>
  <%= f.input :phone %>
  <%= error_span(@user[:phone]) %>
  <%= f.input :admin %>
  <%= error_span(@user[:admin]) %>
  <%= f.input :ngo_admin %>
  <%= error_span(@user[:ngo_admin]) %>

  <%= f.button :submit, :class => 'btn-primary' %>
  <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                users_path, :class => 'btn btn-default' %>
<% end %>

<%= simple_form_for @user, :html => { :class => 'form-horizontal' } do |f| %>
  <%= f.input :email %>
  <%= error_span(@user[:email]) %>
  <%= f.input :first_name %>
  <%= error_span(@user[:first_name]) %>
  <%= f.input :last_name %>
  <%= error_span(@user[:last_name]) %>
  <%= f.input :phone %>
  <%= error_span(@user[:phone]) %>
  <% if current_user && current_user.admin? %>
    <%= f.input :admin %>
    <%= error_span(@user[:admin]) %>
    <%# Only admins can set users to be NGO admins %>
    <%= f.input :ngo_admin %>
    <%= error_span(@user[:ngo_admin]) %>
  <% end %>

  <%= f.button :submit, :class => 'btn-primary' %>
  <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                users_path, :class => 'btn btn-default' %>
<% end %>

Hide admin and NGO admin fields from non-admins
Hide admin and NGO admin fields from non-admins
