app/views/admin/roles/_role.html.haml in the_role-2.1.1 vs app/views/admin/roles/_role.html.haml in the_role-2.3
- old
+ new
@@ -1,76 +1,97 @@
+- content_for :role_update_btn_set do
+ .btn-group
+ %a.btn.btn-warning
+ %i.icon-repeat.glyphicon.glyphicon-repeat
+ %a.btn.btn-success
+ %i.icon-ok.glyphicon.glyphicon-ok
+
- content_for :role_main do
- .well
- = form_for(role, :url => change_admin_role_path(role)) do |f|
- %h3.name
- %b= t '.role_name'
- %span.a= role.name
- %span.b{style: 'visibility:hidden'}
- = f.text_field :name
- .btn-group
- %a.btn.btn-warning
- %i.icon-repeat
- %a.btn.btn-success
- %i.icon-ok
+ - hidden = 'visibility:hidden'
+ .panel.panel-primary
+ .panel-heading Role Info (edit in place)
+ .panel-body
+ = form_for(role, url: change_admin_role_path(role), html: { class: "form-inline" } ) do |f|
+ .row
+ .col-md-12
+ %h3.holder
+ = t '.role_name'
+ %span.a= role.name
+ %span.b{ style: hidden }
+ .form-group= f.text_field :name, class: "form-control"
+ = yield(:role_update_btn_set)
- %h5.title
- %b= t '.title'
- %span.a= role.title
- %span.b{style: 'visibility:hidden'}
- = f.text_field :title
- .btn-group
- %a.btn.btn-warning
- %i.icon-repeat
- %a.btn.btn-success
- %i.icon-ok
+ .row
+ .col-md-12
+ %h5.holder
+ = t '.title'
+ %span.a= role.title
+ %span.b{ style: hidden }
+ .form-group= f.text_field :title, class: "form-control"
+ = yield(:role_update_btn_set)
- %h5.description
- %b= t '.role_description'
- %span.a= role.description
- %span.b{style: 'visibility:hidden'}
- = f.text_field :description
- .btn-group
- %a.btn.btn-warning
- %i.icon-repeat
- %a.btn.btn-success
- %i.icon-ok
+ .row
+ .col-md-12
+ %h5.holder
+ = t '.role_description'
+ %span.a= role.description
+ %span.b{ style: hidden }
+ .form-group= f.text_field :description, class: "form-control"
+ = yield(:role_update_btn_set)
- - 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', data: { confirm: t('.section_delete_confirm') }
+ .panel.panel-primary
+ .panel-heading Role rules
+ .panel-body
+ - role.to_hash.each_pair do |section, rules|
+ .panel.panel-info
+ .panel-heading
+ .row
+ .col-md-9
+ %h5= section
+ .col-md-3
+ .delete
+ .btn-group
+ = button_to t('.delete_section'), admin_role_section_path(role, section), method: :delete, class: 'btn btn-danger', data: { 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, data: { confirm: t(".rule_delete_confirm") }
+ .panel-body
+ .rules
+ - rules.each_pair do |rule, value|
+ .row
+ .col-md-9
+ %h4
+ →
+ = rule
+ .col-md-3
+ .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, data: { confirm: t(".rule_delete_confirm") }
- %h4= t '.create_section'
+ .panel.panel-success
+ .panel-heading
+ = t '.create_section'
+ .panel-body
+ = form_tag admin_role_sections_path(role), class: "form-inline"do |f|
+ .form-group
+ = text_field_tag :section_name, '', class: "form-control", placeholder: t('.new_section_placeholder')
+ = submit_tag t('.create_section'), class: "btn btn-success"
- = 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= t '.create_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
+ .panel.panel-success
+ .panel-heading
+ = t '.create_rule'
+ .panel-body
+ = form_tag create_rule_admin_role_sections_path(role), role: :form, class: "form-inline" do |f|
+ .form-group
+ %select.form-control{ name: :section_name }
+ - role.to_hash.each_pair do |section, rules|
+ %option{ value: section }= section
+ .form-group
+ = text_field_tag :rule_name, '', class: "form-control", placeholder: t('.new_rule_placeholder')
+ = submit_tag t('.create_rule'), class: "btn btn-success"
\ No newline at end of file