<% self.page_title = "Editing user: #{@user.name}" if @user == current_user self.page_description = "You are editing " + link_to("your own", [:admin, @user]) + " profile." else self.page_description = "You are editing " + link_to("#{@user.name}", [:admin, @user]) + "'s profile." end self.page_description_links = link_to("View all users", admin_users_path) %> <% content_for :sidebar do %> <% if @user != current_user %>

Preventing access

Unchecking the This account is activated box will effectively disable logins.

<% end %> <% end %> <%= form_for([:admin, @user], html: { multipart: true }, builder: PagesCore::Admin::FormBuilder) do |f| %>

Account details

<%= f.labelled_text_field :name %> <%= f.labelled_text_field :email %>

Profile picture

<%= f.image_uploader :image, alternative: @user.name %> <% if policy(@user).change_password? %>

Password

<%= f.labelled_password_field :password, 'Change password' %> <%= f.labelled_password_field :confirm_password, 'Confirm password' %>

Leave the password blank if you do not wish to change the password.

<% end %> <%= render partial: "access_control", locals: { user: @user, f: f } %>

<% end %>