the_role 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,7 @@ class Admin::RolesController < ApplicationController
30
30
  end
31
31
 
32
32
  def update
33
- if @role.update_role params[:role].try(:[],:the_role)
33
+ if @role.update_role params[:role][:the_role]
34
34
  flash[:notice] = t 'the_role.role_updated'
35
35
  redirect_to_edit
36
36
  else
@@ -47,7 +47,7 @@ class Admin::RolesController < ApplicationController
47
47
  protected
48
48
 
49
49
  def role_params
50
- params.require(:role).permit(:name, :title, :description)
50
+ params.require(:role).permit(:name, :title, :description, :the_role)
51
51
  end
52
52
 
53
53
  def role_find
@@ -17,7 +17,7 @@
17
17
  %h3= section
18
18
  .delete
19
19
  .btn-group
20
- = button_to t('.delete_section'), admin_role_section_path(role, section), :method => :delete, :class => 'btn btn-danger', :confirm => t('.section_delete_confirm')
20
+ = button_to t('.delete_section'), admin_role_section_path(role, section), method: :delete, class: 'btn btn-danger', data: { confirm: t('.section_delete_confirm') }
21
21
 
22
22
  - rules.each_pair do |rule, value|
23
23
  .rule
@@ -28,27 +28,27 @@
28
28
  .btn-group
29
29
  - klass = value ? :success : :info
30
30
  - state = value ? t('.enable') : t('.disable')
31
- %button{ :class => "btn btn-#{klass}" }= state
32
- %button{ :class => "btn btn-#{klass} dropdown-toggle", 'data-toggle' => :dropdown }
31
+ %button{ class: "btn btn-#{klass}" }= state
32
+ %button{ class: "btn btn-#{klass} dropdown-toggle", 'data-toggle' => :dropdown }
33
33
  %span.caret
34
34
  %ul.dropdown-menu
35
35
  %li.success= link_to t('.enable'), rule_on_admin_role_section_path(role, section, :name => rule), :method => :put
36
36
  %li.info= link_to t('.disable'), rule_off_admin_role_section_path(role, section, :name => rule), :method => :put
37
37
  %li.divider
38
- %li.error= link_to t('.delete_rule'), destroy_rule_admin_role_section_path(role, section, :name => rule), :method => :delete, :confirm => t('.rule_delete_confirm')
38
+ %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") }
39
39
 
40
40
  %h4= t '.create_section'
41
41
 
42
- = form_tag admin_role_sections_path(role), :class => 'well form-inline' do |f|
43
- = text_field_tag :section_name, '', :class => 'input-xlarge', :placeholder => t('.new_section_placeholder')
44
- = submit_tag t('.create_section'), :class => :btn
42
+ = form_tag admin_role_sections_path(role), class: 'well form-inline' do |f|
43
+ = text_field_tag :section_name, '', class: 'input-xlarge', :placeholder => t('.new_section_placeholder')
44
+ = submit_tag t('.create_section'), class: :btn
45
45
 
46
46
  %h4= t '.create_rule'
47
47
 
48
- = form_tag create_rule_admin_role_sections_path(role), :class => 'well form-inline' do |f|
48
+ = form_tag create_rule_admin_role_sections_path(role), class: 'well form-inline' do |f|
49
49
  %select.span3{ :name => :section_name }
50
50
  - role.to_hash.each_pair do |section, rules|
51
51
  %option{ :value => section }= section
52
52
 
53
- = text_field_tag :rule_name, '', :class => 'input-large', :placeholder => t('.new_rule_placeholder')
54
- = submit_tag t('.create_rule'), :class => :btn
53
+ = text_field_tag :rule_name, '', class: 'input-large', :placeholder => t('.new_rule_placeholder')
54
+ = submit_tag t('.create_rule'), class: :btn
@@ -1,3 +1,3 @@
1
1
  module TheRole
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_role
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-11 00:00:00.000000000 Z
12
+ date: 2013-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &76998310 !ruby/object:Gem::Requirement
16
+ requirement: &77484780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *76998310
24
+ version_requirements: *77484780
25
25
  description: Authorization for Rails 4 with Web Interface
26
26
  email:
27
27
  - zykin-ilya@ya.ru
@@ -44,7 +44,6 @@ files:
44
44
  - app/models/concerns/role_model.rb
45
45
  - app/models/concerns/the_role_base.rb
46
46
  - app/models/concerns/the_role_user_model.rb
47
- - app/views/admin/roles/_form.haml
48
47
  - app/views/admin/roles/_role.html.haml
49
48
  - app/views/admin/roles/_sidebar.html.haml
50
49
  - app/views/admin/roles/edit.html.haml
@@ -1,25 +0,0 @@
1
- - role = @role.to_hash
2
-
3
- - if role.blank?
4
- %h3= t('.empty')
5
- - else
6
- -role.each do |name, set|
7
- %h4
8
- = name
9
- %span.controls
10
- = link_to(t('.delete'), admin_role_section_path(@role, name), :method => :delete, :confirm => t('.destroy_section_confirm'))
11
-
12
- - if set.is_a?(Hash)
13
- %ul.rights
14
- - set.each do |n, v|
15
- %li
16
- = check_box_tag "role[the_role][#{name}][#{n}]", true, v
17
- = n
18
- .controls
19
- = link_to t('.delete'), destroy_rule_admin_role_section_path(@role, name, :name => n), :method => :delete, :confirm => t('.delete_rule_confirm')
20
-
21
- = f.submit button
22
-
23
-
24
-
25
-