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.
- checksums.yaml +7 -0
- data/README.rdoc +3 -3
- data/lib/padrino-admin/access_control.rb +46 -47
- data/lib/padrino-admin/bootstrap-less/alerts.less +29 -55
- data/lib/padrino-admin/bootstrap-less/badges.less +13 -15
- data/lib/padrino-admin/bootstrap-less/bootstrap.less +17 -21
- data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +6 -11
- data/lib/padrino-admin/bootstrap-less/button-groups.less +114 -32
- data/lib/padrino-admin/bootstrap-less/buttons.less +41 -41
- data/lib/padrino-admin/bootstrap-less/carousel.less +43 -18
- data/lib/padrino-admin/bootstrap-less/close.less +4 -4
- data/lib/padrino-admin/bootstrap-less/code.less +8 -10
- data/lib/padrino-admin/bootstrap-less/component-animations.less +10 -4
- data/lib/padrino-admin/bootstrap-less/dropdowns.less +78 -51
- data/lib/padrino-admin/bootstrap-less/forms.less +183 -274
- data/lib/padrino-admin/bootstrap-less/glyphicons.less +232 -0
- data/lib/padrino-admin/bootstrap-less/grid.less +230 -88
- data/lib/padrino-admin/bootstrap-less/input-groups.less +127 -0
- data/lib/padrino-admin/bootstrap-less/jumbotron.less +16 -8
- data/lib/padrino-admin/bootstrap-less/labels.less +25 -37
- data/lib/padrino-admin/bootstrap-less/list-group.less +34 -35
- data/lib/padrino-admin/bootstrap-less/media.less +7 -5
- data/lib/padrino-admin/bootstrap-less/mixins.less +321 -108
- data/lib/padrino-admin/bootstrap-less/modals.less +24 -20
- data/lib/padrino-admin/bootstrap-less/navbar.less +474 -216
- data/lib/padrino-admin/bootstrap-less/navs.less +67 -85
- data/lib/padrino-admin/bootstrap-less/pager.less +4 -4
- data/lib/padrino-admin/bootstrap-less/pagination.less +64 -69
- data/lib/padrino-admin/bootstrap-less/panels.less +114 -62
- data/lib/padrino-admin/bootstrap-less/popovers.less +18 -18
- data/lib/padrino-admin/bootstrap-less/print.less +22 -7
- data/lib/padrino-admin/bootstrap-less/progress-bars.less +10 -33
- data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +141 -40
- data/lib/padrino-admin/bootstrap-less/scaffolding.less +66 -19
- data/lib/padrino-admin/bootstrap-less/tables.less +154 -158
- data/lib/padrino-admin/bootstrap-less/theme.less +232 -0
- data/lib/padrino-admin/bootstrap-less/thumbnails.less +9 -20
- data/lib/padrino-admin/bootstrap-less/tooltip.less +3 -3
- data/lib/padrino-admin/bootstrap-less/type.less +47 -55
- data/lib/padrino-admin/bootstrap-less/utilities.less +2 -2
- data/lib/padrino-admin/bootstrap-less/variables.less +289 -93
- data/lib/padrino-admin/bootstrap-less/wells.less +2 -2
- data/lib/padrino-admin/generators/actions.rb +11 -10
- data/lib/padrino-admin/generators/admin_app.rb +11 -11
- data/lib/padrino-admin/generators/admin_page.rb +9 -9
- data/lib/padrino-admin/generators/orm.rb +6 -7
- data/lib/padrino-admin/generators/templates/account/activerecord.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +16 -16
- data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/minirecord.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +8 -8
- data/lib/padrino-admin/generators/templates/account/mongomapper.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +9 -9
- data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +8 -8
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js +9 -3
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js +4 -2
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +4 -4
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js +9 -5
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js +19 -12
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js +68 -45
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js +6 -7
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js +43 -40
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js +16 -10
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js +6 -4
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js +4 -2
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js +78 -48
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/transition.js +10 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +1 -0
- data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +622 -334
- data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +2 -2
- data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +9 -9
- data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +3 -3
- data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +3 -3
- data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +9 -7
- data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +2 -2
- data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +2 -2
- data/lib/padrino-admin/generators/templates/page/controller.rb.tt +3 -3
- data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +1 -1
- data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +9 -7
- data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +2 -2
- data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +2 -2
- data/lib/padrino-admin/helpers/authentication_helpers.rb +35 -35
- data/lib/padrino-admin/helpers/view_helpers.rb +12 -19
- data/lib/padrino-admin/utils/crypt.rb +10 -9
- data/lib/padrino-admin.rb +4 -5
- data/test/fixtures/data_mapper.rb +10 -9
- data/test/generators/test_account_model_generator.rb +2 -2
- 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:
|
8
|
-
margin-bottom:
|
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-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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: .
|
7
|
+
padding: .2em .6em .3em;
|
8
8
|
font-size: 75%;
|
9
|
-
font-weight:
|
9
|
+
font-weight: bold;
|
10
10
|
line-height: 1;
|
11
|
-
color:
|
11
|
+
color: @label-color;
|
12
12
|
text-align: center;
|
13
13
|
white-space: nowrap;
|
14
|
-
vertical-align:
|
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:
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
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-
|
63
|
-
|
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
|
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
|
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
|
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
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
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
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
.media {
|
40
|
+
> .pull-left {
|
41
|
+
margin-right: 10px;
|
42
|
+
}
|
43
|
+
> .pull-right {
|
44
|
+
margin-left: 10px;
|
45
|
+
}
|
44
46
|
}
|
45
47
|
|
46
48
|
|