fustrate-rails 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/lib/fustrate-rails.rb +4 -0
  3. data/lib/fustrate/rails/engine.rb +14 -0
  4. data/lib/fustrate/rails/version.rb +6 -0
  5. data/vendor/assets/javascripts/awesomplete.js +402 -0
  6. data/vendor/assets/javascripts/fustrate.coffee +6 -0
  7. data/vendor/assets/javascripts/fustrate/_module.coffee +134 -0
  8. data/vendor/assets/javascripts/fustrate/components/_module.coffee +3 -0
  9. data/vendor/assets/javascripts/fustrate/components/alert_box.coffee +10 -0
  10. data/vendor/assets/javascripts/fustrate/components/autocomplete.coffee +161 -0
  11. data/vendor/assets/javascripts/fustrate/components/disclosure.coffee +12 -0
  12. data/vendor/assets/javascripts/fustrate/components/drop_zone.coffee +9 -0
  13. data/vendor/assets/javascripts/fustrate/components/dropdown.coffee +48 -0
  14. data/vendor/assets/javascripts/fustrate/components/file_picker.coffee +10 -0
  15. data/vendor/assets/javascripts/fustrate/components/flash.coffee +31 -0
  16. data/vendor/assets/javascripts/fustrate/components/modal.coffee +213 -0
  17. data/vendor/assets/javascripts/fustrate/components/pagination.coffee +84 -0
  18. data/vendor/assets/javascripts/fustrate/components/tabs.coffee +28 -0
  19. data/vendor/assets/javascripts/fustrate/components/tooltip.coffee +72 -0
  20. data/vendor/assets/javascripts/fustrate/generic_form.coffee +31 -0
  21. data/vendor/assets/javascripts/fustrate/generic_page.coffee +40 -0
  22. data/vendor/assets/javascripts/fustrate/generic_table.coffee +57 -0
  23. data/vendor/assets/javascripts/fustrate/listenable.coffee +25 -0
  24. data/vendor/assets/javascripts/fustrate/object.coffee +21 -0
  25. data/vendor/assets/javascripts/fustrate/record.coffee +23 -0
  26. data/vendor/assets/stylesheets/_fustrate.sass +7 -0
  27. data/vendor/assets/stylesheets/awesomplete.sass +75 -0
  28. data/vendor/assets/stylesheets/fustrate/_colors.sass +9 -0
  29. data/vendor/assets/stylesheets/fustrate/_settings.sass +20 -0
  30. data/vendor/assets/stylesheets/fustrate/components/_components.sass +36 -0
  31. data/vendor/assets/stylesheets/fustrate/components/_functions.sass +40 -0
  32. data/vendor/assets/stylesheets/fustrate/components/alerts.sass +78 -0
  33. data/vendor/assets/stylesheets/fustrate/components/buttons.sass +103 -0
  34. data/vendor/assets/stylesheets/fustrate/components/disclosures.sass +23 -0
  35. data/vendor/assets/stylesheets/fustrate/components/dropdowns.sass +31 -0
  36. data/vendor/assets/stylesheets/fustrate/components/flash.sass +33 -0
  37. data/vendor/assets/stylesheets/fustrate/components/forms.sass +188 -0
  38. data/vendor/assets/stylesheets/fustrate/components/grid.sass +204 -0
  39. data/vendor/assets/stylesheets/fustrate/components/labels.sass +63 -0
  40. data/vendor/assets/stylesheets/fustrate/components/modals.sass +119 -0
  41. data/vendor/assets/stylesheets/fustrate/components/pagination.sass +57 -0
  42. data/vendor/assets/stylesheets/fustrate/components/panels.sass +49 -0
  43. data/vendor/assets/stylesheets/fustrate/components/popovers.sass +15 -0
  44. data/vendor/assets/stylesheets/fustrate/components/tables.sass +58 -0
  45. data/vendor/assets/stylesheets/fustrate/components/tabs.sass +44 -0
  46. data/vendor/assets/stylesheets/fustrate/components/tooltips.sass +28 -0
  47. data/vendor/assets/stylesheets/fustrate/components/typography.sass +355 -0
  48. metadata +211 -0
@@ -0,0 +1,204 @@
1
+ $row-width: rem-calc(1000)
2
+ $total-columns: 12
3
+ $column-gutter: rem-calc(30)
4
+
5
+ @function grid-calc($colNumber, $totalColumns)
6
+ @return percentage($colNumber / $totalColumns)
7
+
8
+ // Use +grid-row(nest) to include a nested row
9
+ // Use +grid-row(collapse) to collapsed a container row margins
10
+ // Use +grid-row(nest-collapse) to collapse outer margins on a nested row
11
+ // Use +grid-row to use a container row
12
+ =grid-row($behavior: false)
13
+ @if $behavior == nest
14
+ width: auto
15
+ margin-left: -($column-gutter / 2)
16
+ margin-right: -($column-gutter / 2)
17
+ margin-top: 0
18
+ margin-bottom: 0
19
+ max-width: none
20
+
21
+ @else if $behavior == collapse
22
+ width: 100%
23
+ margin: 0
24
+ max-width: $row-width
25
+
26
+ @else if $behavior == nest-collapse
27
+ width: auto
28
+ margin: 0
29
+ max-width: none
30
+
31
+ @else
32
+ width: 100%
33
+ margin-left: auto
34
+ margin-right: auto
35
+ margin-top: 0
36
+ margin-bottom: 0
37
+ max-width: $row-width
38
+
39
+ // Clearfix for all rows
40
+ +clearfix
41
+
42
+ // Creates a column, should be used inside of a media query to control layouts
43
+ //
44
+ // $columns - The number of columns this should be
45
+ // $last-column - Is this the last column? Default: false.
46
+ // $center - Center these columns? Default: false.
47
+ // $offset - # of columns to offset. Default: false.
48
+ // $push - # of columns to push. Default: false.
49
+ // $pull - # of columns to pull. Default: false.
50
+ // $collapse - Get rid of gutter padding on column? Default: false.
51
+ // $float - Should this float? Default: true. Options: true, false, left, right.
52
+ =grid-column($columns: false, $last-column: false, $center: false, $offset: false, $push: false, $pull: false, $collapse: false, $float: true, $position: false)
53
+
54
+ // If positioned for default .column, include relative position
55
+ // push and pull require position set
56
+ @if $position or $push or $pull
57
+ position: relative
58
+
59
+ // If collapsed, get rid of gutter padding
60
+ @if $collapse
61
+ padding-left: 0
62
+ padding-right: 0
63
+
64
+ @else if $collapse == false
65
+ // Gutter padding whenever a column isn't set to collapse
66
+ // (use $collapse: null to do nothing)
67
+ padding-left: $column-gutter / 2
68
+ padding-right: $column-gutter / 2
69
+
70
+ // If a column number is given, calculate width
71
+ @if $columns
72
+ width: grid-calc($columns, $total-columns)
73
+
74
+ // If last column, float naturally instead of to the right
75
+ @if $last-column
76
+ float: right
77
+
78
+ // Source Ordering, adds left/right depending on which you use.
79
+ @if $push
80
+ left: grid-calc($push, $total-columns)
81
+ right: auto
82
+ @if $pull
83
+ right: grid-calc($pull, $total-columns)
84
+ left: auto
85
+
86
+ @if $float
87
+ @if $float == left or $float == true
88
+ float: left
89
+ @else if $float == right
90
+ float: right
91
+ @else
92
+ float: none
93
+
94
+ // If centered, get rid of float and add appropriate margins
95
+ @if $center
96
+ margin-left: auto
97
+ margin-right: auto
98
+ float: none
99
+
100
+ // If offset, calculate appropriate margins
101
+ @if $offset
102
+ margin-left: grid-calc($offset, $total-columns) !important
103
+
104
+ // Create presentational classes for grid
105
+ //
106
+ // $size - Name of class to use, i.e. "large" will generate .large-1, .large-2, etc.
107
+ =grid-html-classes($size)
108
+ @for $i from 0 through $total-columns - 1
109
+ .#{$size}-push-#{$i}
110
+ +grid-column($push: $i, $collapse: null, $float: false)
111
+
112
+ .#{$size}-pull-#{$i}
113
+ +grid-column($pull: $i, $collapse: null, $float: false)
114
+
115
+ .column,
116
+ .columns
117
+ +grid-column($columns: false, $position: true)
118
+
119
+
120
+ @for $i from 1 through $total-columns
121
+ .#{$size}-#{$i}
122
+ +grid-column($columns: $i, $collapse: null, $float: false)
123
+
124
+ @for $i from 0 through $total-columns - 1
125
+ .#{$size}-offset-#{$i}
126
+ +grid-column($offset: $i, $collapse: null, $float: false)
127
+
128
+ .#{$size}-reset-order
129
+ margin-left: 0
130
+ margin-right: 0
131
+ left: auto
132
+ right: auto
133
+ float: left
134
+
135
+ .column.#{$size}-centered,
136
+ .columns.#{$size}-centered
137
+ +grid-column($center: true, $collapse: null, $float: false)
138
+
139
+ .column.#{$size}-uncentered,
140
+ .columns.#{$size}-uncentered
141
+ margin-left: 0
142
+ margin-right: 0
143
+ float: left
144
+
145
+ // Fighting [class*="column"] + [class*="column"]:last-child
146
+ .column.#{$size}-centered:last-child,
147
+ .columns.#{$size}-centered:last-child
148
+ float: none
149
+
150
+ // Fighting .column.<previous-size>-centered:last-child
151
+ .column.#{$size}-uncentered:last-child,
152
+ .columns.#{$size}-uncentered:last-child
153
+ float: left
154
+
155
+ .column.#{$size}-uncentered.opposite,
156
+ .columns.#{$size}-uncentered.opposite
157
+ float: right
158
+
159
+ =fustrate-grid
160
+ .row
161
+ +grid-row
162
+
163
+ &.fluid
164
+ width: 100%
165
+ max-width: 100%
166
+
167
+ &.collapse
168
+ > .column,
169
+ > .columns
170
+ +grid-column($collapse: true, $float: false)
171
+
172
+ .row
173
+ margin-left: 0
174
+ margin-right: 0
175
+
176
+ .row
177
+ +grid-row(nest)
178
+
179
+ &.collapse
180
+ +grid-row(nest-collapse)
181
+
182
+ .column,
183
+ .columns
184
+ +grid-column($columns: $total-columns)
185
+
186
+ & + &:last-child,
187
+ & + &.end
188
+ float: left
189
+
190
+ [class*="column"] + [class*="column"]:last-child
191
+ float: right
192
+ [class*="column"] + [class*="column"].end
193
+ float: left
194
+
195
+ @media #{$small-up}
196
+ +grid-html-classes($size: small)
197
+
198
+ @media #{$medium-up}
199
+ +grid-html-classes($size: medium)
200
+
201
+ @media #{$large-up}
202
+ +grid-html-classes($size: large)
203
+ .large-column-count-2
204
+ +columns(2)
@@ -0,0 +1,63 @@
1
+ $label-padding: rem-calc(6 8)
2
+ $label-font-size: rem-calc(12)
3
+ $label-font-color: #333
4
+ $label-font-color-alt: #fff
5
+
6
+ =label-color($bg: $primary-color)
7
+ background-color: $bg
8
+
9
+ @if lightness($bg) < 70%
10
+ color: $label-font-color-alt
11
+ text-shadow: 0 1px 1px scale_color($bg, $lightness: -70%)
12
+ @else
13
+ color: $label-font-color
14
+ text-shadow: 0 1px 1px scale_color($bg, $lightness: 70%)
15
+
16
+ =fustrate-labels
17
+ .label
18
+ text-align: center
19
+ text-decoration: none
20
+ line-height: 1
21
+ white-space: nowrap
22
+ display: inline-block
23
+ position: relative
24
+ margin-bottom: inherit
25
+ padding: $label-padding
26
+ font-size: $label-font-size
27
+ border-radius: 3px
28
+ +label-color
29
+
30
+ td.status:last-child &:only-child,
31
+ &.fw
32
+ display: block
33
+
34
+ &.round
35
+ border-radius: 1000px
36
+ &.sharp
37
+ border-radius: 0
38
+
39
+ &.bad,
40
+ &.no,
41
+ &.danger,
42
+ &.inactive
43
+ +label-color($red)
44
+
45
+ &.good,
46
+ &.yes,
47
+ &.success
48
+ +label-color($green)
49
+
50
+ &.warning
51
+ +label-color($orange)
52
+
53
+ &.plain
54
+ +label-color(#eee)
55
+ border: #ddd 1px solid
56
+
57
+ // Check Mark
58
+ &.yes::before
59
+ +font-awesome("\f00c")
60
+
61
+ // X
62
+ &.no::before
63
+ +font-awesome("\f00d")
@@ -0,0 +1,119 @@
1
+ =modal-width($width: 80%)
2
+ margin-left: -($width / 2)
3
+ width: $width
4
+
5
+ =fustrate-modals
6
+ .modal-overlay
7
+ position: fixed
8
+ height: 120%
9
+ width: 100%
10
+ background: #000
11
+ background: rgba(#000, .45)
12
+ z-index: 9500
13
+ display: none
14
+ top: 0
15
+ left: 0
16
+
17
+ .modal
18
+ visibility: hidden
19
+ display: none
20
+ position: absolute
21
+ z-index: 9501
22
+ width: 100vw
23
+ top: 0
24
+ left: 0
25
+ background-color: #fff
26
+ padding: rem-calc(12)
27
+ border: 1px solid #666
28
+ box-shadow: 0 0 10px rgba(#000, .4)
29
+ margin-bottom: 1rem
30
+
31
+ @media #{$small-only}
32
+ min-height: 100vh
33
+
34
+ @media #{$medium-up}
35
+ +modal-width
36
+ top: rem-calc(100)
37
+ left: 50%
38
+
39
+ &.tiny
40
+ +modal-width(30%)
41
+ &.small
42
+ +modal-width(40%)
43
+ &.medium
44
+ +modal-width(60%)
45
+ &.large
46
+ +modal-width(70%)
47
+ &.xlarge
48
+ +modal-width(95%)
49
+
50
+ .column,
51
+ .columns
52
+ min-width: 0
53
+
54
+ & > :first-child
55
+ margin-top: 0
56
+ & > :last-child,
57
+ .modal-content form
58
+ margin-bottom: 0
59
+
60
+ .modal-title
61
+ padding: 0 rem-calc(4) rem-calc(4)
62
+ margin: 0 0 rem-calc(8)
63
+ border-bottom: 1px solid #ddd
64
+ font-weight: bold
65
+
66
+ .modal-close
67
+ font-size: rem-calc(24)
68
+ line-height: 1
69
+ position: absolute
70
+ top: rem-calc(8)
71
+ right: rem-calc(16)
72
+ color: #aaa
73
+ font-weight: bold
74
+ cursor: pointer
75
+
76
+ .picker
77
+ height: 300px
78
+ overflow-y: scroll
79
+ background: #fafafa
80
+ position: relative
81
+
82
+ .section
83
+ &:not(:first-child)
84
+ margin-top: .5rem
85
+
86
+ .title
87
+ background: #e3e3e3
88
+ padding: 2px rem-calc(8)
89
+ border: 1px solid #ccc
90
+ cursor: pointer
91
+
92
+ .count
93
+ float: right
94
+ font-size: rem-calc(12)
95
+
96
+ .option
97
+ cursor: pointer
98
+ border: 1px solid #ccc
99
+ margin-top: -1px
100
+ padding: .5rem
101
+
102
+ &:hover
103
+ background: $info-color
104
+ color: scale_color($info-color, $lightness: -65%)
105
+ border-color: scale_color($info-color, $lightness: -20%)
106
+ z-index: 9999
107
+ position: relative
108
+
109
+ .description
110
+ font-size: .8rem
111
+ color: #555
112
+ padding-left: .5rem
113
+
114
+
115
+ @media print
116
+ .modal-overlay
117
+ display: none !important
118
+ .modal
119
+ background: #fff !important
@@ -0,0 +1,57 @@
1
+ $pagination-active-color: $primary-color !default
2
+
3
+ =fustrate-pagination
4
+ ul.pagination
5
+ display: block
6
+ min-height: rem-calc(24)
7
+ margin-left: rem-calc(-5)
8
+ text-align: center
9
+
10
+ &:empty
11
+ display: none
12
+
13
+ li
14
+ height: rem-calc(24)
15
+ color: #222
16
+ font-size: rem-calc(14)
17
+ margin-left: rem-calc(1)
18
+ display: inline-block
19
+
20
+ a, span
21
+ display: block
22
+ padding: rem-calc(1 10 1)
23
+ color: #999
24
+ background: none
25
+ border-radius: 4px
26
+ font-weight: normal
27
+ font-size: 1em
28
+ line-height: inherit
29
+ +transition(background-color .3s ease-out)
30
+
31
+ &:hover a,
32
+ a:focus,
33
+ &:hover span,
34
+ span:focus
35
+ background: scale-color(#fff, $lightness: -10%)
36
+
37
+ &.unavailable
38
+ a, span
39
+ cursor: default
40
+ color: #999
41
+
42
+ &:hover a,
43
+ & a:focus,
44
+ &:hover button,
45
+ & button:focus
46
+ background: transparent
47
+
48
+ &.current
49
+ a, span
50
+ background: $pagination-active-color
51
+ color: #fff
52
+ font-weight: bold
53
+ cursor: default
54
+
55
+ &:hover,
56
+ &:focus
57
+ background: $pagination-active-color
@@ -0,0 +1,49 @@
1
+ $panel-bg: darken(#fff, 5%)
2
+
3
+ $panel-margin-bottom: rem-calc(20)
4
+ $panel-padding: rem-calc(16 20)
5
+
6
+ $panel-font-color: #333
7
+ $panel-font-color-alt: #fff
8
+
9
+ =panel-color($bg: $panel-bg)
10
+ border: 1px solid darken($bg, 11%)
11
+ background: $bg
12
+
13
+ // We set the font color based on the darkness of the bg.
14
+ h1, h2, h3, h4, h5, h6, p, li, dl
15
+ color: if(lightness($bg) >= 50%, $panel-font-color, $panel-font-color-alt)
16
+
17
+ =fustrate-panels
18
+ .panel
19
+ margin-bottom: $panel-margin-bottom
20
+ padding: $panel-padding
21
+ font-size: rem-calc(14)
22
+ +panel-color
23
+
24
+ // reset header line-heights for panels
25
+ h1, h2, h3, h4, h5, h6
26
+ line-height: 1
27
+ margin-bottom: rem-calc(20) / 2
28
+
29
+ ul, ol, dl
30
+ font-size: inherit
31
+
32
+ // Respect the padding, fool.
33
+ & > :first-child
34
+ margin-top: 0
35
+ & > :last-child
36
+ margin-bottom: 0
37
+
38
+ &.radius
39
+ border-radius: 3px
40
+
41
+ &.info
42
+ +panel-color(lighten($info-color, 5%))
43
+ &.success
44
+ +panel-color(lighten($success-color, 20%))
45
+ &.danger
46
+ +panel-color(scale_color($danger-color, $lightness: 70%, $saturation: -20%))
47
+
48
+ &.small
49
+ padding: $panel-padding / 2