the_role 1.7.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.travis.yml +5 -0
  2. data/README.md +139 -114
  3. data/app/assets/stylesheets/the_role.css.scss +47 -0
  4. data/app/controllers/admin/role_sections_controller.rb +8 -6
  5. data/app/controllers/admin/roles_controller.rb +9 -6
  6. data/app/controllers/the_role_controller.rb +18 -0
  7. data/app/models/concerns/role_model.rb +124 -0
  8. data/app/models/concerns/the_role_base.rb +30 -0
  9. data/app/models/concerns/the_role_user_model.rb +45 -0
  10. data/app/views/admin/roles/_role.html.haml +54 -53
  11. data/app/views/admin/roles/_sidebar.html.haml +4 -1
  12. data/app/views/admin/roles/edit.html.haml +2 -2
  13. data/app/views/admin/roles/index.haml +2 -2
  14. data/app/views/admin/roles/new.html.haml +18 -17
  15. data/lib/generators/the_role/USAGE +19 -0
  16. data/lib/generators/the_role/templates/the_role.rb +5 -0
  17. data/lib/generators/the_role/the_role_generator.rb +23 -0
  18. data/lib/the_role/config.rb +20 -0
  19. data/lib/the_role/hash.rb +23 -30
  20. data/lib/the_role/param_helper.rb +5 -11
  21. data/lib/the_role/version.rb +1 -1
  22. data/lib/the_role.rb +15 -14
  23. data/the_role.gemspec +2 -2
  24. metadata +20 -18
  25. data/app/assets/javascripts/admin_the_role.js +0 -4
  26. data/app/assets/javascripts/bootstrap-alert.js +0 -90
  27. data/app/assets/javascripts/bootstrap-dropdown.js +0 -100
  28. data/app/assets/stylesheets/admin_the_role.css +0 -6
  29. data/app/assets/stylesheets/custom.css +0 -3
  30. data/app/assets/stylesheets/headers.css +0 -12
  31. data/app/assets/stylesheets/reset.css +0 -117
  32. data/app/assets/stylesheets/role_base.css +0 -1739
  33. data/lib/the_role/engine.rb +0 -16
  34. data/lib/the_role/modules/base.rb +0 -30
  35. data/lib/the_role/modules/controller_requires.rb +0 -17
  36. data/lib/the_role/modules/role_model.rb +0 -121
  37. data/lib/the_role/modules/user_model.rb +0 -31
@@ -1,100 +0,0 @@
1
- /* ============================================================
2
- * bootstrap-dropdown.js v2.0.4
3
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
4
- * ============================================================
5
- * Copyright 2012 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ============================================================ */
19
-
20
-
21
- !function ($) {
22
-
23
- "use strict"; // jshint ;_;
24
-
25
-
26
- /* DROPDOWN CLASS DEFINITION
27
- * ========================= */
28
-
29
- var toggle = '[data-toggle="dropdown"]'
30
- , Dropdown = function (element) {
31
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
32
- $('html').on('click.dropdown.data-api', function () {
33
- $el.parent().removeClass('open')
34
- })
35
- }
36
-
37
- Dropdown.prototype = {
38
-
39
- constructor: Dropdown
40
-
41
- , toggle: function (e) {
42
- var $this = $(this)
43
- , $parent
44
- , selector
45
- , isActive
46
-
47
- if ($this.is('.disabled, :disabled')) return
48
-
49
- selector = $this.attr('data-target')
50
-
51
- if (!selector) {
52
- selector = $this.attr('href')
53
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
54
- }
55
-
56
- $parent = $(selector)
57
- $parent.length || ($parent = $this.parent())
58
-
59
- isActive = $parent.hasClass('open')
60
-
61
- clearMenus()
62
-
63
- if (!isActive) $parent.toggleClass('open')
64
-
65
- return false
66
- }
67
-
68
- }
69
-
70
- function clearMenus() {
71
- $(toggle).parent().removeClass('open')
72
- }
73
-
74
-
75
- /* DROPDOWN PLUGIN DEFINITION
76
- * ========================== */
77
-
78
- $.fn.dropdown = function (option) {
79
- return this.each(function () {
80
- var $this = $(this)
81
- , data = $this.data('dropdown')
82
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
83
- if (typeof option == 'string') data[option].call($this)
84
- })
85
- }
86
-
87
- $.fn.dropdown.Constructor = Dropdown
88
-
89
-
90
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
91
- * =================================== */
92
-
93
- $(function () {
94
- $('html').on('click.dropdown.data-api', clearMenus)
95
- $('body')
96
- .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
- .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
98
- })
99
-
100
- }(window.jQuery);
@@ -1,6 +0,0 @@
1
- /*
2
- *= require 'reset'
3
- *= require 'custom'
4
- *= require 'headers'
5
- *= require 'role_base'
6
- */
@@ -1,3 +0,0 @@
1
- p{
2
- margin-bottom: 1em;
3
- }
@@ -1,12 +0,0 @@
1
- h1,h2,h3,h4,h5,h6{
2
- color: #333;
3
- font-weight: normal;
4
- line-height: 100%;
5
- margin-bottom: 15px
6
- }
7
- h1{ font-size:2.3em }
8
- h2{ font-size:2.7em }
9
- h3{ font-size:2.3em }
10
- h4{ font-size:1.9em }
11
- h5{ font-size:1.5em }
12
- h6{ font-size:1.1em }
@@ -1,117 +0,0 @@
1
- /*
2
- zykin-ilya@ya.ru
3
- github.com/the-teacher
4
- Last modified: 19 mar 2012
5
-
6
- GLOBAL font-size: 10px; (aka 62.5%)
7
- provide identity of:
8
- 10px => 1em => 100%
9
- 15px => 1.5em => 150%
10
- 18px => 1.8em => 180%
11
- */
12
-
13
- *{ margin: 0; padding: 0 }
14
-
15
- /* all block elements */
16
- article, aside, details, figcaption, figure, footer, header, hgroup,
17
- menu, nav, section, html, head, body, address, blockquote, center, dir,
18
- div, dl, fieldset, form, h1, h2, h3, h4, h5, h6, hr, isindex, menu, noframes, noscript,
19
- ol, p, pre, table, ul{
20
- border: 0;
21
- outline: 0;
22
- font-size: 10px;
23
- line-height: 100%;
24
- background: transparent;
25
- vertical-align: baseline;
26
- }
27
-
28
- html{ background: white }
29
-
30
- /* HTML5 INIT (experimental section) */
31
- article, aside, details, figcaption, figure, footer,
32
- header, hgroup, menu, nav, section{
33
- display: block
34
- }
35
- canvas, video, audio[controls]{
36
- display: inline-block;
37
- *display: inline;
38
- zoom: 1
39
- }
40
- audio{ display: none }
41
- [hidden]{ display: none }
42
- mark{ background: yellow; padding: 0 5px }
43
- /* HTML5 INIT */
44
-
45
- /* TABLES */
46
- table, tr, th, td{
47
- border-collapse: collapse;
48
- vertical-align: top;
49
- border-spacing: 0
50
- }
51
- th{ font-weight: bold }
52
- /* TABLES */
53
-
54
- /* LIST */
55
- ol, ul{ list-style: none; margin: 0 }
56
- li{ list-style-position: outside }
57
- /* LIST */
58
-
59
- img{ vertical-align: top }
60
-
61
- a{ text-decoration: underline }
62
- a:hover{ text-decoration: none }
63
- a:hover, a:active { outline: 0 }
64
-
65
- sup, sub{ font-size: 85%; zoom: 1 }
66
- sup{ vertical-align: 40% }
67
- sub{ vertical-align: -40% }
68
-
69
- noscript{
70
- background: red;
71
- font-size: 2em;
72
- padding: 5px;
73
- color: white
74
- }
75
-
76
- /* CUSTOM */
77
- p{ line-height: 1.35em }
78
- label{ display: block }
79
-
80
- .numered_list, .marked_list{ margin-left: 20px }
81
- .numered_list li, .marked_list li{
82
- list-style-position: outside;
83
- margin-left: 15px;
84
- padding-left: 5px
85
- }
86
- .numered_list li{ list-style-type: decimal }
87
- .marked_list li{ list-style-type: disc }
88
-
89
- .hidden { display: none }
90
- .invisible{ visibility: hidden; height: 0 }
91
- .visible { visibility: visible; height: auto }
92
-
93
- /* Unbreakable */
94
- .nobr{ white-space: nowrap }
95
-
96
- /* For sliders building */
97
- .nobr_item{
98
- display: inline-block;
99
- vertical-align: top;
100
- *display: inline;
101
- zoom: 1
102
- }
103
-
104
- :focus{ outline: 0 }
105
- .u{ text-decoration: underline }
106
- .overblock{ overflow: hidden; zoom: 1 }
107
- .indicator, .stop_indicator{
108
- position: absolute;
109
- top: 0; left: 0;
110
- z-index: 1000;
111
- display: none
112
- }
113
-
114
- /* WebKit fixes */
115
- @media screen and (-webkit-min-device-pixel-ratio:0){
116
- /* display: inline-table; */
117
- }