Fix managing user roles

This commit is contained in:
Henne Vogelsang 2013-10-22 14:16:20 +02:00
parent b4a3baea1c
commit 52d1785a7c
2 changed files with 8 additions and 32 deletions

View file

@ -28,34 +28,10 @@
%th %th
Code Valid Code Valid
%tbody %tbody
- @conference.supporter_registrations.each do |u|
:javascript %tr
$(document).ready(function() { %td= u.name
$('#supporters').dataTable( { %td= u.email
"bProcessing": true, %td= u.supporter_level
"bServerSide": true, %td= u.code
sPaginationType: "full_numbers", %td= u.code_is_valid
sAjaxSource: "#{admin_conference_supporters_path(@conference.short_title)}",
"aoColumns": [
// TODO Disable sorting entirely for now, until issues with joins on the Person are resolved
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
]
} );
$("#supporter-add-form").live('ajax:error', function(xhr, status, error) {
alert('error');
})
.live('ajax:success', function() {
$("#new-supporter-dialog").dialog("close");
$("#supporters").dataTable().fnReloadAjax();
$("#flash-bar").html("<div class='alert alert-success'><a href='#' class='close' data-dismiss='alert'> ×</a>Supporter added.</div>");
});
$("#new-supporter-dialog").hide();
$("#new-supporter-button").click(function(event) {
$("#new-supporter-dialog").dialog();
});
} );

View file

@ -65,7 +65,7 @@
%button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"} %button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"}
Cancel Cancel
= f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"} = f.action :submit, :as => :button, :button_html => {:value => "Save", :class => "btn btn-primary"}
=link_to "Modify Roles", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}}" =link_to "Modify Roles", "#", "data-toggle" => "modal", "data-target" => "#user-role-selection-#{user.id}"
%td %td
=link_to "Details", "javascript: void(0)", :class => "user-details-popover", "data-trigger" => "click", "data-placement" => "bottom", =link_to "Details", "javascript: void(0)", :class => "user-details-popover", "data-trigger" => "click", "data-placement" => "bottom",
"data-html" => "true", "data-html" => "true",