easy_cms 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +31 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/easy_cms.gemspec +36 -0
  13. data/lib/easy_cms.rb +5 -0
  14. data/lib/easy_cms/version.rb +3 -0
  15. data/lib/generators/easy_cms/model/model_generator.rb +71 -0
  16. data/lib/generators/easy_cms/model/templates/controllers/model_controller.erb +55 -0
  17. data/lib/generators/easy_cms/model/templates/layouts/_form.html.erb +26 -0
  18. data/lib/generators/easy_cms/model/templates/layouts/edit.html.erb +13 -0
  19. data/lib/generators/easy_cms/model/templates/layouts/index.html.erb +37 -0
  20. data/lib/generators/easy_cms/model/templates/layouts/item_navegation.html.erb +19 -0
  21. data/lib/generators/easy_cms/model/templates/layouts/new.html.erb +13 -0
  22. data/lib/generators/easy_cms/model/templates/layouts/show.html.erb +22 -0
  23. data/lib/generators/easy_cms/namespace/namespace_generator.rb +45 -0
  24. data/lib/generators/easy_cms/namespace/templates/assets/base_javascript.erb +3 -0
  25. data/lib/generators/easy_cms/namespace/templates/assets/base_scss.erb +1 -0
  26. data/lib/generators/easy_cms/namespace/templates/controllers/base_controller.erb +5 -0
  27. data/lib/generators/easy_cms/namespace/templates/layouts/layout.html.erb +71 -0
  28. data/lib/generators/resource_helpers.rb +31 -0
  29. data/vendor/assets/javascripts/.keep +0 -0
  30. data/vendor/assets/javascripts/easy_cms/base.js +351 -0
  31. data/vendor/assets/javascripts/easy_cms/bootstrap-notify.js +404 -0
  32. data/vendor/assets/javascripts/easy_cms/bootstrap.min.js +7 -0
  33. data/vendor/assets/javascripts/easy_cms/chartist.min.js +9 -0
  34. data/vendor/assets/javascripts/easy_cms/demo.js +183 -0
  35. data/vendor/assets/javascripts/easy_cms/jquery-3.1.0.min.js +4 -0
  36. data/vendor/assets/javascripts/easy_cms/material.min.js +1 -0
  37. data/vendor/assets/stylesheets/.keep +0 -0
  38. data/vendor/assets/stylesheets/easy_cms/bootstrap.min.css +5 -0
  39. data/vendor/assets/stylesheets/easy_cms/demo.css +64 -0
  40. data/vendor/assets/stylesheets/easy_cms/easy_cms.css +5065 -0
  41. data/vendor/assets/stylesheets/easy_cms/easy_cms_sass.scss +51 -0
  42. data/vendor/assets/stylesheets/easy_cms/md/_alerts.scss +57 -0
  43. data/vendor/assets/stylesheets/easy_cms/md/_buttons.scss +259 -0
  44. data/vendor/assets/stylesheets/easy_cms/md/_cards.scss +337 -0
  45. data/vendor/assets/stylesheets/easy_cms/md/_chartist.scss +254 -0
  46. data/vendor/assets/stylesheets/easy_cms/md/_checkboxes.scss +193 -0
  47. data/vendor/assets/stylesheets/easy_cms/md/_colors.scss +325 -0
  48. data/vendor/assets/stylesheets/easy_cms/md/_dialogs.scss +99 -0
  49. data/vendor/assets/stylesheets/easy_cms/md/_dropdown.scss +67 -0
  50. data/vendor/assets/stylesheets/easy_cms/md/_footers.scss +44 -0
  51. data/vendor/assets/stylesheets/easy_cms/md/_forms.scss +58 -0
  52. data/vendor/assets/stylesheets/easy_cms/md/_inputs-size.scss +223 -0
  53. data/vendor/assets/stylesheets/easy_cms/md/_inputs.scss +394 -0
  54. data/vendor/assets/stylesheets/easy_cms/md/_misc.scss +115 -0
  55. data/vendor/assets/stylesheets/easy_cms/md/_mixins.scss +422 -0
  56. data/vendor/assets/stylesheets/easy_cms/md/_navbars.scss +329 -0
  57. data/vendor/assets/stylesheets/easy_cms/md/_pills.scss +117 -0
  58. data/vendor/assets/stylesheets/easy_cms/md/_popups.scss +77 -0
  59. data/vendor/assets/stylesheets/easy_cms/md/_radios.scss +114 -0
  60. data/vendor/assets/stylesheets/easy_cms/md/_responsive.scss +453 -0
  61. data/vendor/assets/stylesheets/easy_cms/md/_ripples.scss +40 -0
  62. data/vendor/assets/stylesheets/easy_cms/md/_shadows.scss +138 -0
  63. data/vendor/assets/stylesheets/easy_cms/md/_sidebar-and-main-panel.scss +260 -0
  64. data/vendor/assets/stylesheets/easy_cms/md/_tables.scss +45 -0
  65. data/vendor/assets/stylesheets/easy_cms/md/_tabs.scss +53 -0
  66. data/vendor/assets/stylesheets/easy_cms/md/_togglebutton.scss +87 -0
  67. data/vendor/assets/stylesheets/easy_cms/md/_typography.scss +75 -0
  68. data/vendor/assets/stylesheets/easy_cms/md/_variables.scss +1127 -0
  69. data/vendor/assets/stylesheets/easy_cms/md/mixins/_chartist.scss +89 -0
  70. data/vendor/assets/stylesheets/easy_cms/md/mixins/_transparency.scss +20 -0
  71. data/vendor/assets/stylesheets/easy_cms/md/mixins/_vendor-prefixes.scss +185 -0
  72. data/vendor/assets/stylesheets/easy_cms/md/plugins/_animate.scss +227 -0
  73. data/vendor/assets/stylesheets/easy_cms/md/plugins/_plugin-nouislider.scss +161 -0
  74. metadata +174 -0
@@ -0,0 +1,394 @@
1
+ // This file has been autogenerated by grunt task lessToSass. Any changes will be overwritten.
2
+
3
+ @import '_inputs-size';
4
+
5
+ // label variations
6
+ .label {
7
+ border-radius: $border-radius-small;
8
+ @include variations(unquote(".label"), unquote(""), background-color, $grey);
9
+ }
10
+
11
+ // must be broken out for reuse - webkit selector breaks firefox
12
+ @mixin label-static($label-top, $static-font-size, $static-line-height){
13
+ label.control-label {
14
+ top: $label-top;
15
+ left: 0;
16
+ // must repeat because the selector above is more specific than the general label sizing
17
+ font-size: $static-font-size;
18
+ line-height: $static-line-height;
19
+ }
20
+ }
21
+
22
+ @mixin label-size-variant($placeholder-font-size, $vertical-padding, $line-height, $static-font-size, $static-line-height, $help-block-font-size){
23
+ .form-control {
24
+ @include material-placeholder {
25
+ font-size: $placeholder-font-size;
26
+ line-height: $line-height;
27
+ color: $mdb-input-placeholder-color;
28
+ font-weight: 400;
29
+
30
+ }
31
+ // margin-bottom must be specified to give help-block vertical space.
32
+ // $see also form-group padding-bottom (and size variants) re: collapsible margins. These work together.
33
+ margin-bottom: $vertical-padding;
34
+ }
35
+
36
+ // generic labels used anywhere in the form (not control-label)
37
+ .checkbox label,
38
+ .radio label,
39
+ label {
40
+ font-size: $placeholder-font-size;
41
+ line-height: $line-height;
42
+ color: $mdb-input-placeholder-color;
43
+ font-weight: 400;
44
+ }
45
+
46
+ // smaller focused or static size
47
+ label.control-label {
48
+ font-size: $static-font-size;
49
+ line-height: $static-line-height;
50
+ color: $mdb-input-placeholder-color;
51
+ font-weight: 400;
52
+ margin: 16px 0 0 0; // std and lg
53
+ }
54
+
55
+ .help-block {
56
+ margin-top: 0; // allow the input margin to set-off the top of the help-block
57
+ font-size: $help-block-font-size;
58
+ }
59
+ }
60
+
61
+ @mixin form-group-validation-state($name, $color){
62
+
63
+ &.#{$name} { // e.g. has-error
64
+ .form-control {
65
+ box-shadow: none;
66
+ }
67
+ &.is-focused .form-control {
68
+ background-image: linear-gradient($color, $color), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
69
+ }
70
+ label.control-label,
71
+ .help-block {
72
+ color: $color;
73
+ }
74
+ }
75
+ }
76
+
77
+ @mixin form-group-size-variant($parent, $placeholder-font-size, $label-top-margin, $vertical-padding, $line-height, $label-as-placeholder-shim){
78
+ $static-font-size: ceil(($mdb-label-static-size-ratio * $placeholder-font-size)) !default;
79
+ $static-line-height: ($mdb-label-static-size-ratio * $line-height) !default;
80
+
81
+ $label-as-placeholder-top: -1 * ($vertical-padding + $label-as-placeholder-shim) !default;
82
+ $label-top: $label-as-placeholder-top - ($placeholder-font-size + $vertical-padding) !default;
83
+
84
+ $help-block-font-size: ceil(($mdb-help-block-size-ratio * $placeholder-font-size)) !default;
85
+ $help-block-line-height: ($mdb-help-block-size-ratio * $line-height) !default;
86
+
87
+ // this is outside a form-group
88
+ @if not $parent {
89
+ @include label-size-variant($placeholder-font-size, $vertical-padding, $line-height, $static-font-size, $static-line-height, $help-block-font-size);
90
+ }
91
+
92
+ // this is inside a form-group, may be .form-group.form-group-sm or .form-group.form-group-lg
93
+ @else {
94
+ #{$parent} {
95
+ @include label-size-variant($placeholder-font-size, $vertical-padding, $line-height, $static-font-size, $static-line-height, $help-block-font-size);
96
+
97
+ // form-group padding-bottom
98
+ // upon collapsing margins, the largest margin is honored which collapses the form-control margin-bottom,
99
+ // so the form-control margin-bottom must also be expressed as form-group padding
100
+ padding-bottom: $vertical-padding;
101
+
102
+ // form-group margin-top must be large enough for the label and the label's top padding since label is absolutely positioned
103
+ margin: ($label-top-margin + $static-font-size) 0 0 0;
104
+
105
+ // larger labels as placeholders
106
+ &.label-floating,
107
+ &.label-placeholder {
108
+ label.control-label {
109
+ top: $label-as-placeholder-top; // place the floating label to look like a placeholder with input padding
110
+ font-size: $placeholder-font-size;
111
+ line-height: $line-height;
112
+ }
113
+ }
114
+
115
+ // static, focused, or autofill floating labels
116
+ &.label-static,
117
+ &.label-floating.is-focused,
118
+ &.label-floating:not(.is-empty) {
119
+ @include label-static($label-top, $static-font-size, $static-line-height);
120
+ }
121
+ // #559 Fix for webkit/chrome autofill - rule must be separate because it breaks firefox otherwise #731
122
+ &.label-floating input.form-control:-webkit-autofill ~ label.control-label {
123
+ @include label-static($label-top, $static-font-size, $static-line-height);
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ // -----
130
+ // Inputs
131
+
132
+ .form-control,
133
+ .form-group .form-control {
134
+ border: 0;
135
+ background-image: linear-gradient($brand-primary, $brand-primary), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
136
+ background-size: 0 2px, 100% 1px;
137
+ background-repeat: no-repeat;
138
+ background-position: center bottom, center calc(100% - 1px);
139
+ background-color: rgba(0, 0, 0, 0);
140
+ transition: background 0s ease-out;
141
+ float: none;
142
+ box-shadow: none;
143
+ border-radius: 0;
144
+
145
+ font-weight: 400;
146
+
147
+ // Placeholders and and labels-as-placeholders should look the same
148
+ @include material-placeholder {
149
+ color: $mdb-input-placeholder-color;
150
+ font-weight: 400;
151
+ }
152
+
153
+
154
+ //&:textarea { // appears to be an invalid selector
155
+ // height: 40px;
156
+ //}
157
+
158
+ &[readonly],
159
+ &[disabled],
160
+ fieldset[disabled] & {
161
+ background-color: rgba(0, 0, 0, 0);
162
+ }
163
+
164
+ &[disabled],
165
+ fieldset[disabled] & {
166
+ background-image: none;
167
+ border-bottom: 1px dotted $mdb-input-underline-color;
168
+ }
169
+ }
170
+
171
+ // -----
172
+ // Labels with form-group signalled state
173
+ //
174
+ // Reference http://www.google.com/design/spec/components/text-fields.html
175
+ // MDL implementation: http://www.getmdl.io/components/index.html#textfields-section
176
+ //.variations(unquote(" label.control-label"), color, $mdb-input-placeholder-color); // default label color variations
177
+
178
+ .form-group {
179
+ position: relative;
180
+
181
+ // -----
182
+ // Labels with form-group signalled state
183
+ //
184
+ // Reference http://www.google.com/design/spec/components/text-fields.html
185
+ // MDL implementation: http://www.getmdl.io/components/index.html#textfields-section
186
+ &.label-static,
187
+ &.label-placeholder,
188
+ &.label-floating {
189
+ label.control-label {
190
+ position: absolute;
191
+ pointer-events: none;
192
+ transition: 0.3s ease all;
193
+ }
194
+ }
195
+
196
+ // hint to browser for optimization
197
+ // TODO: evaluate effectiveness - looking for community feedback
198
+ &.label-floating label.control-label {
199
+ will-change: left, top, contents;
200
+ }
201
+
202
+ // hide label-placeholders when the field is not empty
203
+ &.label-placeholder:not(.is-empty){
204
+ label.control-label{
205
+ display: none;
206
+ }
207
+ }
208
+
209
+ // Help blocks - position: absolute approach - uses no vertical space, text wrapping - not so good.
210
+ .help-block {
211
+ position: absolute; // do not use position: absolute because width/wrapping isn't automatic and overflows occur
212
+ display: none;
213
+ }
214
+
215
+ // form-group is-focused display
216
+ &.is-focused {
217
+ .form-control {
218
+ outline: none;
219
+ background-image: linear-gradient($brand-primary, $brand-primary), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
220
+ background-size: 100% 2px, 100% 1px;
221
+ box-shadow: none;
222
+ transition-duration: 0.3s;
223
+
224
+ .material-input:after {
225
+ background-color: $brand-primary;
226
+ }
227
+ }
228
+
229
+ &.form-info{
230
+ .form-control{
231
+ background-image: linear-gradient($brand-info, $brand-info), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
232
+ }
233
+ }
234
+ &.form-success{
235
+ .form-control{
236
+ background-image: linear-gradient($brand-success, $brand-success), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
237
+ }
238
+ }
239
+ &.form-warning{
240
+ .form-control{
241
+ background-image: linear-gradient($brand-warning, $brand-warning), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
242
+ }
243
+ }
244
+ &.form-danger{
245
+ .form-control{
246
+ background-image: linear-gradient($brand-danger, $brand-danger), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
247
+ }
248
+ }
249
+ &.form-rose{
250
+ .form-control{
251
+ background-image: linear-gradient($brand-rose, $brand-rose), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
252
+ }
253
+ }
254
+ &.form-white{
255
+ .form-control{
256
+ background-image: linear-gradient($white-color, $white-color), linear-gradient($mdb-input-underline-color, $mdb-input-underline-color);
257
+ }
258
+ }
259
+
260
+ //.variations(unquote(".is-focused.label-placeholder label.control-label"), color, $mdb-input-placeholder-color); // default label color variations
261
+ &.label-placeholder {
262
+ label,
263
+ label.control-label {
264
+ color: $mdb-input-placeholder-color;
265
+ }
266
+ }
267
+
268
+ .help-block {
269
+ display: block;
270
+ }
271
+ }
272
+
273
+ @include form-group-validation-state(has-warning, $brand-warning);
274
+ @include form-group-validation-state(has-error, $brand-danger);
275
+ @include form-group-validation-state(has-success, $brand-success);
276
+ @include form-group-validation-state(has-info, $brand-info);
277
+
278
+ textarea {
279
+ resize: none;
280
+ & ~ .form-control-highlight {
281
+ margin-top: -11px;
282
+ }
283
+ }
284
+
285
+ select {
286
+ appearance: none; // Fix for OS X
287
+
288
+ & ~ .material-input:after {
289
+ display: none;
290
+ }
291
+ }
292
+ }
293
+
294
+ // default floating size/location without a form-group (will skip form-group styles, and just render default sizing variation)
295
+ @include form-group-size-variant(null, $mdb-input-font-size-base, $mdb-label-top-margin-base, $mdb-input-padding-base-vertical, $mdb-input-line-height-base, $mdb-label-as-placeholder-shim-base);
296
+
297
+ // default floating size/location with a form-group (need margin etc from a default form-group)
298
+ @include form-group-size-variant(unquote(".form-group"), $mdb-input-font-size-base, $mdb-label-top-margin-base, $mdb-input-padding-base-vertical, $mdb-input-line-height-base, $mdb-label-as-placeholder-shim-base);
299
+
300
+ // sm floating size/location
301
+ @include form-group-size-variant(unquote(".form-group.form-group-sm"), $mdb-input-font-size-small, $mdb-label-top-margin-small, $mdb-input-padding-small-vertical, $mdb-input-line-height-small, $mdb-label-as-placeholder-shim-small);
302
+
303
+ // lg floating size/location
304
+ @include form-group-size-variant(unquote(".form-group.form-group-lg"), $mdb-input-font-size-large, $mdb-label-top-margin-large, $mdb-input-padding-large-vertical, $mdb-input-line-height-large, $mdb-label-as-placeholder-shim-large);
305
+
306
+
307
+ select.form-control {
308
+
309
+ border: 0;
310
+ box-shadow: none;
311
+ border-radius: 0;
312
+
313
+ .form-group.is-focused & {
314
+ box-shadow: none;
315
+ border-color: $mdb-input-underline-color;
316
+ }
317
+
318
+ &[multiple] {
319
+ &,
320
+ .form-group.is-focused & {
321
+ height: 85px;
322
+ }
323
+ }
324
+ }
325
+
326
+ @mixin input-group-button-variation($vertical-padding){
327
+ .input-group-btn {
328
+ .btn {
329
+ margin: 0 0 $vertical-padding 0;
330
+ }
331
+ }
332
+ }
333
+
334
+ // ----------------
335
+ // input group/addon related styles
336
+
337
+ // default margin - no form-group required
338
+ @include input-group-button-variation($mdb-input-padding-base-vertical);
339
+
340
+ .form-group {
341
+ //.form-control {
342
+ // float: none;
343
+ //}
344
+
345
+ // sm margin
346
+ &.form-group-sm {
347
+ @include input-group-button-variation($mdb-input-padding-small-vertical);
348
+ }
349
+
350
+ // lg margin
351
+ &.form-group-lg {
352
+ @include input-group-button-variation($mdb-input-padding-large-vertical);
353
+ }
354
+ }
355
+
356
+ .input-group { // may be in or outside of form-group
357
+ .input-group-btn {
358
+ padding: 0 12px; // match addon spacing
359
+ }
360
+
361
+ .input-group-addon {
362
+ border: 0;
363
+ background: transparent;
364
+ padding: 6px 15px 0px;
365
+ }
366
+ }
367
+
368
+ // Input files - hide actual input - requires specific markup in the sample.
369
+ .form-group input[type=file] {
370
+ opacity: 0;
371
+ position: absolute;
372
+ top: 0;
373
+ right: 0;
374
+ bottom: 0;
375
+ left: 0;
376
+ width: 100%;
377
+ height: 100%;
378
+ z-index: 100;
379
+ }
380
+
381
+
382
+ .form-control-feedback{
383
+ opacity: 0;
384
+
385
+ .has-success &{
386
+ color: $green;
387
+ opacity: 1;
388
+ }
389
+
390
+ .has-error &{
391
+ color: $red;
392
+ opacity: 1;
393
+ }
394
+ }
@@ -0,0 +1,115 @@
1
+ body {
2
+ background-color: #EEEEEE;
3
+ // background: #fdfdfe;
4
+ color: $black-color;
5
+ &.inverse {
6
+ background: #333333;
7
+ &, .form-control {
8
+ color: $mdb-text-color-light;
9
+ }
10
+ .modal,
11
+ .panel-default,
12
+ .card {
13
+ &,
14
+ .form-control {
15
+ background-color: initial;
16
+ color: initial;
17
+ }
18
+ }
19
+
20
+ }
21
+ }
22
+
23
+ .wrapper{
24
+
25
+ &.wrapper-full-page{
26
+ height: auto;
27
+ min-height: 100vh;
28
+ }
29
+ }
30
+
31
+
32
+ blockquote{
33
+ p{
34
+ font-style: italic;
35
+ }
36
+ }
37
+
38
+ .life-of-material-dashboard{
39
+ background: #FFFFFF;
40
+ }
41
+
42
+ body, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4 {
43
+ font-family: $font-family-sans-serif;
44
+ font-weight: 300;
45
+ line-height: 1.5em;
46
+ }
47
+
48
+ .serif-font{
49
+ font-family: $font-family-serif;
50
+ }
51
+
52
+ .page-header {
53
+ height: 60vh;
54
+ background-position: center center;
55
+ background-size: cover;
56
+ margin: 0;
57
+ padding: 0;
58
+ border: 0;
59
+ border-bottom-left-radius: 6px;
60
+ border-bottom-right-radius: 6px;
61
+ }
62
+
63
+ a{
64
+ color: $link-color;
65
+ &:hover,
66
+ &:focus{
67
+ color: darken($link-color, 5%);
68
+ text-decoration: none;
69
+ }
70
+
71
+ &.text-info{
72
+ &:hover, &:focus{
73
+ color: darken($brand-info, 5%);
74
+ }
75
+ }
76
+
77
+ & .material-icons {
78
+ vertical-align: middle;
79
+ }
80
+ }
81
+
82
+ /* Animations */
83
+ .animation-transition-general{
84
+ @include transition($general-transition-time, $transition-linear);
85
+ }
86
+
87
+ .animation-transition-slow{
88
+ @include transition($slow-transition-time, $transition-linear);
89
+ }
90
+
91
+ .animation-transition-fast{
92
+ @include transition($fast-transition-time, $transition-ease);
93
+ }
94
+ legend {
95
+ border-bottom: 0;
96
+ }
97
+
98
+ // Prevent highlight on mobile
99
+ * {
100
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
101
+ -webkit-tap-highlight-color: transparent;
102
+ &:focus {
103
+ outline: 0;
104
+ }
105
+ }
106
+ a:focus, a:active,
107
+ button:active, button:focus, button:hover,
108
+ button::-moz-focus-inner,
109
+ input[type="reset"]::-moz-focus-inner,
110
+ input[type="button"]::-moz-focus-inner,
111
+ input[type="submit"]::-moz-focus-inner,
112
+ select::-moz-focus-inner,
113
+ input[type="file"] > input[type="button"]::-moz-focus-inner {
114
+ outline : 0 !important;
115
+ }