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
@@ -0,0 +1,127 @@
1
+ //
2
+ // Input groups
3
+ // --------------------------------------------------
4
+
5
+ // Base styles
6
+ // -------------------------
7
+ .input-group {
8
+ position: relative; // For dropdowns
9
+ display: table;
10
+ border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
11
+
12
+ // Undo padding and float of grid classes
13
+ &.col {
14
+ float: none;
15
+ padding-left: 0;
16
+ padding-right: 0;
17
+ }
18
+
19
+ .form-control {
20
+ width: 100%;
21
+ margin-bottom: 0;
22
+ }
23
+ }
24
+
25
+ // Sizing options
26
+ //
27
+ // Remix the default form control sizing classes into new ones for easier
28
+ // manipulation.
29
+
30
+ .input-group-lg > .form-control,
31
+ .input-group-lg > .input-group-addon,
32
+ .input-group-lg > .input-group-btn > .btn { .input-lg(); }
33
+ .input-group-sm > .form-control,
34
+ .input-group-sm > .input-group-addon,
35
+ .input-group-sm > .input-group-btn > .btn { .input-sm(); }
36
+
37
+
38
+ // Display as table-cell
39
+ // -------------------------
40
+ .input-group-addon,
41
+ .input-group-btn,
42
+ .input-group .form-control {
43
+ display: table-cell;
44
+
45
+ &:not(:first-child):not(:last-child) {
46
+ border-radius: 0;
47
+ }
48
+ }
49
+ // Addon and addon wrapper for buttons
50
+ .input-group-addon,
51
+ .input-group-btn {
52
+ width: 1%;
53
+ white-space: nowrap;
54
+ vertical-align: middle; // Match the inputs
55
+ }
56
+
57
+ // Text input groups
58
+ // -------------------------
59
+ .input-group-addon {
60
+ padding: @padding-base-vertical @padding-base-horizontal;
61
+ font-size: @font-size-base;
62
+ font-weight: normal;
63
+ line-height: 1;
64
+ text-align: center;
65
+ background-color: @input-group-addon-bg;
66
+ border: 1px solid @input-group-addon-border-color;
67
+ border-radius: @border-radius-base;
68
+
69
+ // Sizing
70
+ &.input-sm {
71
+ padding: @padding-small-vertical @padding-small-horizontal;
72
+ font-size: @font-size-small;
73
+ border-radius: @border-radius-small;
74
+ }
75
+ &.input-lg {
76
+ padding: @padding-large-vertical @padding-large-horizontal;
77
+ font-size: @font-size-large;
78
+ border-radius: @border-radius-large;
79
+ }
80
+
81
+ // Nuke default margins from checkboxes and radios to vertically center within.
82
+ input[type="radio"],
83
+ input[type="checkbox"] {
84
+ margin-top: 0;
85
+ }
86
+ }
87
+
88
+ // Reset rounded corners
89
+ .input-group .form-control:first-child,
90
+ .input-group-addon:first-child,
91
+ .input-group-btn:first-child > .btn,
92
+ .input-group-btn:first-child > .dropdown-toggle,
93
+ .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
94
+ .border-right-radius(0);
95
+ }
96
+ .input-group-addon:first-child {
97
+ border-right: 0;
98
+ }
99
+ .input-group .form-control:last-child,
100
+ .input-group-addon:last-child,
101
+ .input-group-btn:last-child > .btn,
102
+ .input-group-btn:last-child > .dropdown-toggle,
103
+ .input-group-btn:first-child > .btn:not(:first-child) {
104
+ .border-left-radius(0);
105
+ }
106
+ .input-group-addon:last-child {
107
+ border-left: 0;
108
+ }
109
+
110
+ // Button input groups
111
+ // -------------------------
112
+ .input-group-btn {
113
+ position: relative;
114
+ white-space: nowrap;
115
+ }
116
+ .input-group-btn > .btn {
117
+ position: relative;
118
+ // Jankily prevent input button groups from wrapping
119
+ + .btn {
120
+ margin-left: -4px;
121
+ }
122
+ // Bring the "active" button to the front
123
+ &:hover,
124
+ &:active {
125
+ z-index: 2;
126
+ }
127
+ }
@@ -4,13 +4,14 @@
4
4
 
5
5
 
6
6
  .jumbotron {
7
- padding: 30px;
8
- margin-bottom: 30px;
7
+ padding: @jumbotron-padding;
8
+ margin-bottom: @jumbotron-padding;
9
9
  font-size: (@font-size-base * 1.5);
10
10
  font-weight: 200;
11
11
  line-height: (@line-height-base * 1.5);
12
- color: @jumbotron-lead-color;
12
+ color: @jumbotron-color;
13
13
  background-color: @jumbotron-bg;
14
+
14
15
  h1 {
15
16
  line-height: 1;
16
17
  color: @jumbotron-heading-color;
@@ -18,12 +19,19 @@
18
19
  p {
19
20
  line-height: 1.4;
20
21
  }
21
- }
22
22
 
23
- @media screen and (min-width: @screen-tablet) {
24
- .jumbotron {
25
- padding: 50px 60px;
26
- border-radius: @border-radius-large; // Only round corners at higher resolutions
23
+ .container & {
24
+ border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container
25
+ }
26
+
27
+ @media screen and (min-width: @screen-tablet) {
28
+ padding-top: (@jumbotron-padding * 1.6);
29
+ padding-bottom: (@jumbotron-padding * 1.6);
30
+
31
+ .container & {
32
+ padding-left: (@jumbotron-padding * 2);
33
+ padding-right: (@jumbotron-padding * 2);
34
+ }
27
35
 
28
36
  h1 {
29
37
  font-size: (@font-size-base * 4.5);
@@ -4,67 +4,55 @@
4
4
 
5
5
  .label {
6
6
  display: inline;
7
- padding: .25em .6em;
7
+ padding: .2em .6em .3em;
8
8
  font-size: 75%;
9
- font-weight: 500;
9
+ font-weight: bold;
10
10
  line-height: 1;
11
- color: #fff;
11
+ color: @label-color;
12
12
  text-align: center;
13
13
  white-space: nowrap;
14
- vertical-align: middle;
15
- background-color: @gray-light;
14
+ vertical-align: baseline;
16
15
  border-radius: .25em;
17
16
 
18
17
  // Add hover effects, but only for links
19
18
  &[href] {
20
19
  &:hover,
21
20
  &:focus {
22
- color: #fff;
21
+ color: @label-link-hover-color;
23
22
  text-decoration: none;
24
23
  cursor: pointer;
25
- background-color: darken(@gray-light, 10%);
26
24
  }
27
25
  }
26
+
27
+ // Empty labels collapse automatically (not available in IE8)
28
+ &:empty {
29
+ display: none;
30
+ }
28
31
  }
29
32
 
30
33
  // Colors
31
34
  // Contextual variations (linked labels get darker on :hover)
32
- .label-danger {
33
- background-color: @label-danger-bg;
34
- &[href] {
35
- &:hover,
36
- &:focus {
37
- background-color: darken(@label-danger-bg, 10%);
38
- }
39
- }
35
+
36
+ .label-default {
37
+ .label-variant(@label-default-bg);
38
+ }
39
+
40
+ .label-primary {
41
+ .label-variant(@label-primary-bg);
40
42
  }
41
43
 
42
44
  .label-success {
43
- background-color: @label-success-bg;
44
- &[href] {
45
- &:hover,
46
- &:focus {
47
- background-color: darken(@label-success-bg, 10%);
48
- }
49
- }
45
+ .label-variant(@label-success-bg);
46
+ }
47
+
48
+ .label-info {
49
+ .label-variant(@label-info-bg);
50
50
  }
51
51
 
52
52
  .label-warning {
53
- background-color: @label-warning-bg;
54
- &[href] {
55
- &:hover,
56
- &:focus {
57
- background-color: darken(@label-warning-bg, 10%);
58
- }
59
- }
53
+ .label-variant(@label-warning-bg);
60
54
  }
61
55
 
62
- .label-info {
63
- background-color: @label-info-bg;
64
- &[href] {
65
- &:hover,
66
- &:focus {
67
- background-color: darken(@label-info-bg, 10%);
68
- }
69
- }
56
+ .label-danger {
57
+ .label-variant(@label-danger-bg);
70
58
  }
@@ -9,7 +9,6 @@
9
9
  // No need to set list-style: none; since .list-group-item is block level
10
10
  margin-bottom: 20px;
11
11
  padding-left: 0; // reset padding because ul and ol
12
- background-color: @list-group-bg;
13
12
  }
14
13
 
15
14
  // Individual list items
@@ -18,61 +17,49 @@
18
17
  .list-group-item {
19
18
  position: relative;
20
19
  display: block;
21
- padding: 10px 30px 10px 15px;
20
+ padding: 10px 15px;
22
21
  // Place the border on the list items and negative margin up for better styling
23
22
  margin-bottom: -1px;
23
+ background-color: @list-group-bg;
24
24
  border: 1px solid @list-group-border;
25
25
 
26
26
  // Round the first and last items
27
27
  &:first-child {
28
- .border-top-radius(@border-radius-base);
28
+ .border-top-radius(@list-group-border-radius);
29
29
  }
30
30
  &:last-child {
31
31
  margin-bottom: 0;
32
- .border-bottom-radius(@border-radius-base);
32
+ .border-bottom-radius(@list-group-border-radius);
33
33
  }
34
34
 
35
35
  // Align badges within list items
36
36
  > .badge {
37
37
  float: right;
38
- margin-right: -15px;
39
38
  }
40
- }
41
-
42
- // Custom content options
43
- // -------------------------
44
-
45
- .list-group-item-heading {
46
- margin-top: 0;
47
- margin-bottom: 5px;
48
- }
49
- .list-group-item-text {
50
- margin-bottom: 0;
51
- line-height: 1.3;
52
- }
39
+ > .badge + .badge {
40
+ margin-right: 5px;
41
+ }
53
42
 
54
- // Linked list items
55
- // -------------------------
43
+ // Linked list items
44
+ a& {
45
+ color: @list-group-link-color;
56
46
 
57
- // Custom content within linked items
58
- a.list-group-item {
59
- // Colorize content accordingly
60
- .list-group-item-heading {
61
- color: #333;
62
- }
63
- .list-group-item-text {
64
- color: #555;
65
- }
47
+ .list-group-item-heading {
48
+ color: @list-group-link-heading-color;
49
+ }
66
50
 
67
- // Hover state
68
- &:hover,
69
- &:focus {
70
- text-decoration: none;
71
- background-color: @list-group-hover-bg;
51
+ // Hover state
52
+ &:hover,
53
+ &:focus {
54
+ text-decoration: none;
55
+ background-color: @list-group-hover-bg;
56
+ }
72
57
  }
73
58
 
74
59
  // Active class on item itself, not parent
75
- &.active {
60
+ &.active,
61
+ &.active:hover,
62
+ &.active:focus {
76
63
  z-index: 2; // Place active items above their siblings for proper border styling
77
64
  color: @list-group-active-color;
78
65
  background-color: @list-group-active-bg;
@@ -87,3 +74,15 @@ a.list-group-item {
87
74
  }
88
75
  }
89
76
  }
77
+
78
+ // Custom content options
79
+ // -------------------------
80
+
81
+ .list-group-item-heading {
82
+ margin-top: 0;
83
+ margin-bottom: 5px;
84
+ }
85
+ .list-group-item-text {
86
+ margin-bottom: 0;
87
+ line-height: 1.3;
88
+ }
@@ -36,11 +36,13 @@
36
36
  // Media image alignment
37
37
  // -------------------------
38
38
 
39
- .media > .pull-left {
40
- margin-right: 10px;
41
- }
42
- .media > .pull-right {
43
- margin-left: 10px;
39
+ .media {
40
+ > .pull-left {
41
+ margin-right: 10px;
42
+ }
43
+ > .pull-right {
44
+ margin-left: 10px;
45
+ }
44
46
  }
45
47
 
46
48