mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
fix admin/registrations#update
This commit is contained in:
parent
a1ac27fa58
commit
6bcecbd219
4 changed files with 15 additions and 9 deletions
|
|
@ -14,6 +14,9 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
@user.update_attributes(registration_params[:user_attributes])
|
||||
params[:registration].delete :user_attributes
|
||||
|
||||
@registration.update_attributes(registration_params)
|
||||
if @registration.save
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
.col-md-12
|
||||
.page-header
|
||||
%h1
|
||||
Registration for #{@user.username}
|
||||
Registration for #{@user.username} (#{@user.email})
|
||||
|
||||
= link_to 'Edit User', edit_admin_user_path(@user), class: 'btn btn-primary pull-right' if can? :edit, @user
|
||||
.row
|
||||
.col-md-6
|
||||
= semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f|
|
||||
|
|
|
|||
|
|
@ -27,10 +27,11 @@
|
|||
%td
|
||||
= registration.id
|
||||
%td
|
||||
= registration.name
|
||||
- registration.user.roles.each do |role|
|
||||
- if role.resource == @conference
|
||||
%span.label.label-info= role.name.titleize
|
||||
= registration.name.present? ? registration.name : registration.username
|
||||
%br
|
||||
- registration.user.roles.where(resource: @conference).each do |role|
|
||||
%span.label.label-info
|
||||
= role.name.titleize
|
||||
%td
|
||||
= registration.email
|
||||
%td
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@
|
|||
= '...'
|
||||
- else
|
||||
None
|
||||
- if can? :show, user
|
||||
%td
|
||||
%td
|
||||
- if can? :show, user
|
||||
= link_to 'View', admin_user_path(user), class: 'btn btn-success'
|
||||
- if can? :update, user
|
||||
%td
|
||||
%td
|
||||
- if can? :update, user
|
||||
= link_to 'Edit', edit_admin_user_path(user), class: 'btn btn-primary'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue