.well %h3 %b= t '.role_name' = role.name %h5 %b= t '.title' = role.title %p.description %b= t '.role_description' = role.description - role.to_hash.each_pair do |section, rules| .section %h3= section .delete .btn-group = button_to t('.delete_section'), admin_role_section_path(role, section), :method => :delete, :class => 'btn btn-danger', :confirm => t('.section_delete_confirm') - rules.each_pair do |rule, value| .rule %h4 → = rule .controls .btn-group - klass = value ? :success : :info - state = value ? t('.enable') : t('.disable') %button{ :class => "btn btn-#{klass}" }= state %button{ :class => "btn btn-#{klass} dropdown-toggle", 'data-toggle' => :dropdown } %span.caret %ul.dropdown-menu %li.success= link_to t('.enable'), rule_on_admin_role_section_path(role, section, :name => rule), :method => :put %li.info= link_to t('.disable'), rule_off_admin_role_section_path(role, section, :name => rule), :method => :put %li.divider %li.error= link_to t('.delete_rule'), destroy_rule_admin_role_section_path(role, section, :name => rule), :method => :delete, :confirm => t('.rule_delete_confirm') %h4 Create new section = form_tag admin_role_sections_path(role), :class => 'well form-inline' do |f| = text_field_tag :section_name, '', :class => 'input-xlarge', :placeholder => t('.new_section_placeholder') = submit_tag t('.create_section'), :class => :btn %h4 Create new rule = form_tag create_rule_admin_role_sections_path(role), :class => 'well form-inline' do |f| %select.span3{ :name => :section_name } - role.to_hash.each_pair do |section, rules| %option{ :value => section }= section = text_field_tag :rule_name, '', :class => 'input-large', :placeholder => t('.new_rule_placeholder') = submit_tag t('.create_rule'), :class => :btn