Sha256: 9e401bbfee4b4866176663e6a3665958e3932bb50c2cbae26c3e1c6039c367ae

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

= 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'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alberich-0.2.0 app/views/alberich/permissions/_form.html.haml