= form_tag({:method => :post, :action => :create}) do %table.flat.checkbox_table{ 'data-none_selected' => "none selected", 'data-confirm' => "are you sure?" } %thead %tr - @header.each do |column| - if column[:name] == 'checkbox' %th{:class => column[:class]}= check_box_tag :select_all, true, false, :class => 'select_all' -else %th{:class => column[:class]}= column[:name] - if !@entities.any? %tr %td{:colspan => @header.size}= "nothing here" - @entities.each do |entity| %tr{:class => cycle('nostripe','stripe')} %td -# - selected = params[:select] == 'all' -# = check_box_tag "entity_selected[]", entity.id, selected, :id => "entity_checkbox_#{entity.id}" %td= link_to entity.name, main_app.url_for(entity.entity_target) %td= select_tag "entity_role_selected[]", options_for_select([['', "#{entity.id},"]] + @roles.map {|r| [t(r.name, :scope=> :role_defs, :default => r.name), "#{entity.id},#{r.id}" ] }, :disabled => @permission_object.permissions.where(:entity_id=>entity.id).collect {|p| "#{entity.id},#{p.role.id}"}), :id => "entity_role_selected_#{entity.id}" %fieldset.options = hidden_field_tag :permission_object_type, @permission_object.class.name = hidden_field_tag :permission_object_id, @permission_object.id = hidden_field_tag :path_prefix, @path_prefix = hidden_field_tag :use_tabs, @use_tabs = submit_tag "Grant Access" = link_to 'Cancel', @return_path, :class => 'button danger'