<% content_for :content_title, @user.email %> <% content_for :content_subtitle, @user.display_name %> <% disable_fields = @user.has_role?(:admin) && !is_admin? %>
<%#--- Summary Tab %>
<%= subsection title: "Various Details for #{@user.display_name}" do %> <% if defined?(DmEvent) %> <%= panel body: false, title: "Event Registrations" do %> <% reg = (is_sysadmin? ? Registration.unscoped : Registration.all) %> <% reg.where(user_profile_id: @user.user_profile).includes(:workshop => [:translations]).includes(:account).each do |registration| %> <% end %>
Workshop Title Domain
<%= registration.workshop ? registration.workshop.title : 'oops' %> <%= registration.account.domain %>
<% end %> <% end %> <% if defined?(DmSubscriptions) %> <%= panel title: "Subscriptions" do %> <%= subsection title: 'Subscriptions' do %> <% sub = (is_sysadmin? ? Subscription.unscoped : Subscription.all) %> <% sub.where(subscriber_id: @user, subscriber_type: 'User').each do |subscription| -%> <% end %>
Subscriptions Domain
<%= subscription.subscription_plan.name %> <%= subscription.account.domain %>
<% end %> <%= subsection title: 'Payments' do %> <% pay = (is_sysadmin? ? SubscriptionPayment.unscoped : SubscriptionPayment.all) %> <% pay.unscoped.where(subscriber_id: @user, subscriber_type: 'User').each do |payment| -%> <% end %>
Payments Domain
<%= format_date(payment.created_at) %> <%= payment.amount.format %>
<% end %> <% end %> <% end %> <% if defined?(DmCms) && current_user.is_sysadmin? %> <%= panel body: false, title: "Comments (system admin only)" do %> <% Comment.unscoped.where(user_id: @user).includes(:account).each do |comment| -%> <% end %>
Date Domain type Text
<%= format_date comment.created_at %> <%= comment.account.domain %> <%= comment.commentable_type %> <%= comment.body %>
<% end %> <% end %> <% end %>
<%#--- Profile Tab %>
<%= subsection title: "Profile for #{@user.display_name}" do %> <%= simple_form_for(@user, :url => dm_core.admin_user_path, html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings) do |f| %> <%= f.error_notification :message => "Please review the problems below" %> <%#= f.input :first_name %> <%#= f.input :last_name %> <%= f.input :email, disabled: disable_fields, hint: 'Note: If you change the email address, a confirmation email will be sent to the new address. The email address will look unchanged until it is confirmed' %> <%= f.input(:unconfirmed_email, disabled: true, hint: 'The user needs to re-confirm this email address - an email has already been sent, or you can use the Confirm This User button') if @user.unconfirmed_email %> <%#= f.input :country_id, :wrapper_html => { :class => 'searchDrop' }, :input_html => { :class => 'chosen_select' }, :collection => ut_country_select_collection, :label_method => lambda {|t| t[0]}, :value_method => lambda {|t| t[1]}, :label => "Country" %> <%= submit_or_cancel :cancel_url => dm_core.admin_users_url %> <% end %> <% end %>
<%#--- Permissions Tab %>
<%= subsection title: "Access Permissions for #{@user.display_name}" do %>

Choose which permissions to grant to this user

<%= simple_form_for(@user, :url => dm_core.admin_user_path, html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings) do |f| %> <%= f.error_notification :message => "Please review the problems below" %> <% if disable_fields %> <%= f.input 'roles[admin]', as: :boolean, label: 'Administrator', input_html: {checked: @user.has_role?(:admin)}, disabled: true, hint: 'access to entire website' %> <% else %> <%= f.input('roles[reviewer]', as: :boolean, label: 'Reviewer', input_html: {checked: @user.has_role?(:reviewer)}, hint: 'will be able to view draft versions of blog entries, as long as they are sent the correct link') %> <%= f.input('roles[content_manager]', as: :boolean, label: 'Content Manager', input_html: {checked: @user.has_role?(:content_manager)}, hint: 'can manage blog and static pages') if defined?(DmCms) %> <%= f.input('roles[event_manager]', as: :boolean, label: 'Event Manager', input_html: {checked: @user.has_role?(:event_manager)}, hint: 'can manage events and workshops') if defined?(DmEvent) %> <%= f.input('roles[event_manager_alacarte]',as: :boolean, label: 'Individual Event Management', input_html: {checked: @user.has_role?(:event_manager_alacarte)}, hint: 'grant access to specific events only') if defined?(DmEvent) %> <%= f.input('roles[forum_manager]', as: :boolean, label: 'Forum Manager', input_html: {checked: @user.has_role?(:forum_manager)}, hint: 'can manage forums') if defined?(DmForum) %> <%= f.input('roles[course_manager]', as: :boolean, label: 'Course Manager', input_html: {checked: @user.has_role?(:course_manager)}, hint: 'can manage courses and lessons') if defined?(DmLms) %> <%= f.input('roles[subscription_manager]', as: :boolean, label: 'Subscription Manager', input_html: {checked: @user.has_role?(:course_manager)}, hint: 'can manage site subscriptions') if defined?(DmSubscriptions) %> <%#= f.input 'roles[newsletter_manager]', as: :boolean, label: 'Newsletter Manager', input_html: {checked: @user.has_role?(:newsletter_manager)}, hint: 'can manage newsletters' %>
<%= f.input 'roles[manager]', as: :boolean, label: 'Manager', input_html: {checked: @user.has_role?(:manager)}, hint: 'can manage all areas except for global account settings and deleting users' %> <% if is_admin? %> <%= f.input 'roles[admin]', as: :boolean, label: 'Administrator', input_html: {checked: @user.has_role?(:admin)}, hint: 'access to entire website' %> <% end %> <%= submit_or_cancel :cancel_url => dm_core.admin_users_url %> <% end %> <% end %> <% end %> <% if defined?(DmEvent) %> <%= subsection title: 'Event Permissions' do %>
<% end %> <% end %>

<%= avatar_for @user, 200 %>

<%= subsection title: @user.display_name do %>
Last Accessed On
<%= format_datetime(@user.last_access_at) %>
Confirmed On
<%= format_datetime(@user.confirmed_at) %>
Created On
<%= format_datetime(@user.created_at) %>
<% end %> <% if !@user.confirmed? %> <%= link_to "Confirm This User", dm_core.confirm_admin_user_path(@user.id), :class => "btn btn-block btn-success" %> <% elsif is_admin? || !@user.has_role?(:admin) %> <%= link_to "Become This User", dm_core.masquerade_admin_user_path(@user.id), :class => "btn btn-block btn-info" %> <% end %> <%= link_to("Delete This User", dm_core.admin_user_path(@user, :locale => DmCore::Language.locale), method: :delete, data: { confirm: 'Are you sure?' }, :title => 'Remove', :class => "btn btn-block btn-danger") if is_sysadmin? %>