Fix issue with user actions
This commit is contained in:
parent
8f2707ffe7
commit
fd6317566d
|
@ -2,23 +2,28 @@
|
|||
module Management
|
||||
class UsersController < ManagementController
|
||||
def index
|
||||
@profiles = current_conference.participant_profiles
|
||||
@conference = find_conference
|
||||
@profiles = @conference.participant_profiles
|
||||
end
|
||||
|
||||
def toggle_admin
|
||||
@user = find_user
|
||||
@conference = find_conference
|
||||
@user = find_user
|
||||
|
||||
@user.toggle_admin!
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
def show
|
||||
@user = find_user
|
||||
@profile = @user.personal_profile(current_conference)
|
||||
@conference = find_conference
|
||||
@user = find_user
|
||||
@profile = @user.personal_profile(@conference)
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = find_user
|
||||
@profile = @user.personal_profile(current_conference)
|
||||
@conference = find_conference
|
||||
@user = find_user
|
||||
@profile = @user.personal_profile(@conference)
|
||||
end
|
||||
|
||||
def update
|
||||
|
@ -44,6 +49,10 @@ module Management
|
|||
User.find(params[:id])
|
||||
end
|
||||
|
||||
def find_conference
|
||||
Conference.find(params[:conference_id])
|
||||
end
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(
|
||||
:email,
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
.row
|
||||
.col-lg-12
|
||||
= simple_nested_form_for [:management, @user], wrapper: :horizontal_form, html: { class: 'form-horizontal' } do |f|
|
||||
= simple_nested_form_for [:management, @conference, @user], wrapper: :horizontal_form, html: { class: 'form-horizontal' } do |f|
|
||||
.panel.panel-primary
|
||||
.panel-heading
|
||||
h1.panel-title
|
||||
= t 'views.user.info'
|
||||
= link_to icon(:eye), [:management, @user], class: 'btn btn-xs btn-info pull-right'
|
||||
= link_to icon(:eye), [:management, @conference, @user], class: 'btn btn-xs btn-info pull-right'
|
||||
|
||||
.panel-body
|
||||
.row
|
||||
|
|
|
@ -27,9 +27,4 @@
|
|||
|
||||
td.actions
|
||||
div.btn-group.btn-group-sm
|
||||
= link_to management_user_path(user), title: t('actions.view.button', model: User.model_name.human), class: 'btn btn-info'
|
||||
= icon :eye
|
||||
= link_to edit_management_user_path(user), title: t('actions.edit.button', model: User.model_name.human), class: 'btn btn-primary'
|
||||
= icon :edit
|
||||
= link_to management_user_path(user), title: t('actions.destroy.button', model: User.model_name.human), class: ['btn', 'btn-danger'], method: :delete, data: {confirm: t('actions.are_you_sure')}
|
||||
= icon :trash
|
||||
= action_buttons(@conference, user, [:show, :edit, :destroy])
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
.panel-heading
|
||||
h1.panel-title
|
||||
= @profile.name
|
||||
= link_to icon(:edit), edit_management_user_path(@user), class: 'btn btn-xs btn-danger pull-right'
|
||||
= link_to icon(:edit), [:edit, :management, @conference, @user], class: 'btn btn-xs btn-danger pull-right'
|
||||
.panel-body
|
||||
.center
|
||||
= image_tag @profile.picture.medium.url, class: "profile-image"
|
||||
|
|
Loading…
Reference in New Issue