Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
22
app/views/admin/conference/roles.html.haml
Normal file
22
app/views/admin/conference/roles.html.haml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.row
|
||||
.col-md-6
|
||||
= semantic_form_for(:user, url: roles_admin_conference_path(@conference.short_title), remote: true) do |f|
|
||||
%h4
|
||||
= f.input :roles, collection: @roles, label: 'Show users for role: '
|
||||
|
||||
= render partial: 'roles'
|
||||
|
||||
:javascript
|
||||
|
||||
$("#user_roles_input").change(function () {
|
||||
|
||||
var url = document.forms[0].action;
|
||||
var selected_role = $(this).find('option:selected').attr('value');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
data: {user: { roles: selected_role } },
|
||||
dataType: "script"
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue