padrino-admin 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +3 -3
  3. data/lib/padrino-admin/access_control.rb +46 -47
  4. data/lib/padrino-admin/bootstrap-less/alerts.less +29 -55
  5. data/lib/padrino-admin/bootstrap-less/badges.less +13 -15
  6. data/lib/padrino-admin/bootstrap-less/bootstrap.less +17 -21
  7. data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +6 -11
  8. data/lib/padrino-admin/bootstrap-less/button-groups.less +114 -32
  9. data/lib/padrino-admin/bootstrap-less/buttons.less +41 -41
  10. data/lib/padrino-admin/bootstrap-less/carousel.less +43 -18
  11. data/lib/padrino-admin/bootstrap-less/close.less +4 -4
  12. data/lib/padrino-admin/bootstrap-less/code.less +8 -10
  13. data/lib/padrino-admin/bootstrap-less/component-animations.less +10 -4
  14. data/lib/padrino-admin/bootstrap-less/dropdowns.less +78 -51
  15. data/lib/padrino-admin/bootstrap-less/forms.less +183 -274
  16. data/lib/padrino-admin/bootstrap-less/glyphicons.less +232 -0
  17. data/lib/padrino-admin/bootstrap-less/grid.less +230 -88
  18. data/lib/padrino-admin/bootstrap-less/input-groups.less +127 -0
  19. data/lib/padrino-admin/bootstrap-less/jumbotron.less +16 -8
  20. data/lib/padrino-admin/bootstrap-less/labels.less +25 -37
  21. data/lib/padrino-admin/bootstrap-less/list-group.less +34 -35
  22. data/lib/padrino-admin/bootstrap-less/media.less +7 -5
  23. data/lib/padrino-admin/bootstrap-less/mixins.less +321 -108
  24. data/lib/padrino-admin/bootstrap-less/modals.less +24 -20
  25. data/lib/padrino-admin/bootstrap-less/navbar.less +474 -216
  26. data/lib/padrino-admin/bootstrap-less/navs.less +67 -85
  27. data/lib/padrino-admin/bootstrap-less/pager.less +4 -4
  28. data/lib/padrino-admin/bootstrap-less/pagination.less +64 -69
  29. data/lib/padrino-admin/bootstrap-less/panels.less +114 -62
  30. data/lib/padrino-admin/bootstrap-less/popovers.less +18 -18
  31. data/lib/padrino-admin/bootstrap-less/print.less +22 -7
  32. data/lib/padrino-admin/bootstrap-less/progress-bars.less +10 -33
  33. data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +141 -40
  34. data/lib/padrino-admin/bootstrap-less/scaffolding.less +66 -19
  35. data/lib/padrino-admin/bootstrap-less/tables.less +154 -158
  36. data/lib/padrino-admin/bootstrap-less/theme.less +232 -0
  37. data/lib/padrino-admin/bootstrap-less/thumbnails.less +9 -20
  38. data/lib/padrino-admin/bootstrap-less/tooltip.less +3 -3
  39. data/lib/padrino-admin/bootstrap-less/type.less +47 -55
  40. data/lib/padrino-admin/bootstrap-less/utilities.less +2 -2
  41. data/lib/padrino-admin/bootstrap-less/variables.less +289 -93
  42. data/lib/padrino-admin/bootstrap-less/wells.less +2 -2
  43. data/lib/padrino-admin/generators/actions.rb +11 -10
  44. data/lib/padrino-admin/generators/admin_app.rb +11 -11
  45. data/lib/padrino-admin/generators/admin_page.rb +9 -9
  46. data/lib/padrino-admin/generators/orm.rb +6 -7
  47. data/lib/padrino-admin/generators/templates/account/activerecord.rb.tt +7 -7
  48. data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +16 -16
  49. data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +7 -7
  50. data/lib/padrino-admin/generators/templates/account/minirecord.rb.tt +7 -7
  51. data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +8 -8
  52. data/lib/padrino-admin/generators/templates/account/mongomapper.rb.tt +7 -7
  53. data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +9 -9
  54. data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +8 -8
  55. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js +9 -3
  56. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js +4 -2
  57. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +4 -4
  58. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js +9 -5
  59. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js +19 -12
  60. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js +68 -45
  61. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js +6 -7
  62. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js +43 -40
  63. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js +16 -10
  64. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js +6 -4
  65. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js +4 -2
  66. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js +78 -48
  67. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/transition.js +10 -1
  68. data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +1 -0
  69. data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +622 -334
  70. data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +2 -2
  71. data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +9 -9
  72. data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +3 -3
  73. data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +3 -3
  74. data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +1 -1
  75. data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +9 -7
  76. data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +2 -2
  77. data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +2 -2
  78. data/lib/padrino-admin/generators/templates/page/controller.rb.tt +3 -3
  79. data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +1 -1
  80. data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +9 -7
  81. data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +2 -2
  82. data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +2 -2
  83. data/lib/padrino-admin/helpers/authentication_helpers.rb +35 -35
  84. data/lib/padrino-admin/helpers/view_helpers.rb +12 -19
  85. data/lib/padrino-admin/utils/crypt.rb +10 -9
  86. data/lib/padrino-admin.rb +4 -5
  87. data/test/fixtures/data_mapper.rb +10 -9
  88. data/test/generators/test_account_model_generator.rb +2 -2
  89. metadata +14 -21
@@ -4,21 +4,32 @@
4
4
 
5
5
 
6
6
  // Dropdown arrow/caret
7
- // --------------------
8
7
  .caret {
9
8
  display: inline-block;
10
9
  width: 0;
11
10
  height: 0;
12
11
  margin-left: 2px;
13
12
  vertical-align: middle;
14
- border-top: 4px solid #000;
15
- border-right: 4px solid transparent;
16
- border-left: 4px solid transparent;
13
+ border-top: @caret-width-base solid @dropdown-caret-color;
14
+ border-right: @caret-width-base solid transparent;
15
+ border-left: @caret-width-base solid transparent;
16
+ // Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once fixed,
17
+ // we can just straight up remove this.
18
+ border-bottom: 0 dotted;
17
19
  content: "";
18
20
  }
19
21
 
22
+ // The dropdown wrapper (div)
23
+ .dropdown {
24
+ position: relative;
25
+ }
26
+
27
+ // Prevent the focus on the dropdown toggle when closing dropdowns
28
+ .dropdown-toggle:focus {
29
+ outline: 0;
30
+ }
31
+
20
32
  // The dropdown menu (ul)
21
- // ----------------------
22
33
  .dropdown-menu {
23
34
  position: absolute;
24
35
  top: 100%;
@@ -30,12 +41,13 @@
30
41
  padding: 5px 0;
31
42
  margin: 2px 0 0; // override default ul
32
43
  list-style: none;
44
+ font-size: @font-size-base;
33
45
  background-color: @dropdown-bg;
34
- border: 1px solid #ccc; // IE8 fallback
46
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
35
47
  border: 1px solid @dropdown-border;
36
48
  border-radius: @border-radius-base;
37
49
  .box-shadow(0 6px 12px rgba(0,0,0,.175));
38
- .background-clip(padding-box);
50
+ background-clip: padding-box;
39
51
 
40
52
  // Aligns the dropdown menu to right
41
53
  &.pull-right {
@@ -45,7 +57,7 @@
45
57
 
46
58
  // Dividers (basically an hr) within the dropdown
47
59
  .divider {
48
- .nav-divider(@dropdown-divider-top, @dropdown-divider-bottom);
60
+ .nav-divider(@dropdown-divider-bg);
49
61
  }
50
62
 
51
63
  // Links within the dropdown menu
@@ -61,45 +73,51 @@
61
73
  }
62
74
 
63
75
  // Hover/Focus state
64
- // -----------
65
- .dropdown-menu > li > a:hover,
66
- .dropdown-menu > li > a:focus {
67
- text-decoration: none;
68
- color: @dropdown-link-hover-color;
69
- #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));
76
+ .dropdown-menu > li > a {
77
+ &:hover,
78
+ &:focus {
79
+ text-decoration: none;
80
+ color: @dropdown-link-hover-color;
81
+ background-color: @dropdown-link-hover-bg;
82
+ }
70
83
  }
71
84
 
72
85
  // Active state
73
- // ------------
74
- .dropdown-menu > .active > a,
75
- .dropdown-menu > .active > a:hover,
76
- .dropdown-menu > .active > a:focus {
77
- color: @dropdown-link-active-color;
78
- text-decoration: none;
79
- outline: 0;
80
- #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));
86
+ .dropdown-menu > .active > a {
87
+ &,
88
+ &:hover,
89
+ &:focus {
90
+ color: @dropdown-link-active-color;
91
+ text-decoration: none;
92
+ outline: 0;
93
+ background-color: @dropdown-link-active-bg;
94
+ }
81
95
  }
82
96
 
83
97
  // Disabled state
84
- // --------------
98
+ //
85
99
  // Gray out text and ensure the hover/focus state remains gray
86
- .dropdown-menu > .disabled > a,
87
- .dropdown-menu > .disabled > a:hover,
88
- .dropdown-menu > .disabled > a:focus {
89
- color: @gray-light;
100
+
101
+ .dropdown-menu > .disabled > a {
102
+ &,
103
+ &:hover,
104
+ &:focus {
105
+ color: @dropdown-link-disabled-color;
106
+ }
90
107
  }
91
108
  // Nuke hover/focus effects
92
- .dropdown-menu > .disabled > a:hover,
93
- .dropdown-menu > .disabled > a:focus {
94
- text-decoration: none;
95
- background-color: transparent;
96
- background-image: none; // Remove CSS gradient
97
- .reset-filter();
98
- cursor: default;
109
+ .dropdown-menu > .disabled > a {
110
+ &:hover,
111
+ &:focus {
112
+ text-decoration: none;
113
+ background-color: transparent;
114
+ background-image: none; // Remove CSS gradient
115
+ .reset-filter();
116
+ cursor: not-allowed;
117
+ }
99
118
  }
100
119
 
101
120
  // Open state for the dropdown
102
- // ---------------------------
103
121
  .open {
104
122
  // Show the menu
105
123
  > .dropdown-menu {
@@ -112,9 +130,16 @@
112
130
  }
113
131
  }
114
132
 
133
+ // Dropdown section headers
134
+ .dropdown-header {
135
+ display: block;
136
+ padding: 3px 20px;
137
+ font-size: @font-size-small;
138
+ line-height: @line-height-base;
139
+ color: @dropdown-header-color;
140
+ }
115
141
 
116
142
  // Backdrop to catch body clicks on mobile, etc.
117
- // ---------------------------
118
143
  .dropdown-backdrop {
119
144
  position: fixed;
120
145
  left: 0;
@@ -125,22 +150,24 @@
125
150
  }
126
151
 
127
152
  // Right aligned dropdowns
128
- // ---------------------------
129
153
  .pull-right > .dropdown-menu {
130
154
  right: 0;
131
155
  left: auto;
132
156
  }
133
157
 
134
158
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
135
- // ------------------------------------------------------
159
+ //
136
160
  // Just add .dropup after the standard .dropdown class and you're set, bro.
137
161
  // TODO: abstract this so that the navbar fixed styles are not placed here?
162
+
138
163
  .dropup,
139
164
  .navbar-fixed-bottom .dropdown {
140
165
  // Reverse the caret
141
166
  .caret {
142
- border-top: 0;
143
- border-bottom: 4px solid #000;
167
+ // Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once this
168
+ // gets fixed, restore `border-top: 0;`.
169
+ border-top: 0 dotted;
170
+ border-bottom: 4px solid @dropdown-caret-color;
144
171
  content: "";
145
172
  }
146
173
  // Different positioning for bottom up menu
@@ -151,16 +178,16 @@
151
178
  }
152
179
  }
153
180
 
154
- // Tweak nav headers
155
- // ---------------------------
156
- // Increase padding from 15px to 20px on sides
157
- .dropdown .dropdown-menu .nav-header {
158
- padding-left: 20px;
159
- padding-right: 20px;
160
- }
161
181
 
162
- // Typeahead
163
- // ---------------------------
164
- .typeahead {
165
- z-index: 1051;
182
+ // Component alignment
183
+ //
184
+ // Reiterate per navbar.less and the modified component alignment there.
185
+
186
+ @media (min-width: @grid-float-breakpoint) {
187
+ .navbar-right {
188
+ .dropdown-menu {
189
+ .pull-right > .dropdown-menu();
190
+ }
191
+ }
166
192
  }
193
+