rails_admin_featured_content 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +2 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +5 -0
  7. data/CODE_OF_CONDUCT.md +49 -0
  8. data/Gemfile +13 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +81 -0
  11. data/Rakefile +21 -0
  12. data/app/assets/images/fc-image-default.jpg +0 -0
  13. data/app/assets/images/fc-loading.svg +1 -0
  14. data/app/assets/images/fc-snippet-highlight.jpg +0 -0
  15. data/app/assets/images/fc-snippet-slide.jpg +0 -0
  16. data/app/assets/images/fc-snippet-text.jpg +0 -0
  17. data/app/assets/images/fc-snippet-three.jpg +0 -0
  18. data/app/assets/images/fc-snippet-two.jpg +0 -0
  19. data/app/assets/javascripts/rails_admin/featured_content.js.erb +399 -0
  20. data/app/assets/stylesheets/rails_admin/featured_content.scss +599 -0
  21. data/app/controllers/rails_admin_featured_content/featured_content_controller.rb +28 -0
  22. data/app/models/.keep +0 -0
  23. data/app/models/rails_admin_featured_content/featured_content.rb +16 -0
  24. data/app/models/rails_admin_featured_content/featured_content_image.rb +9 -0
  25. data/app/views/.gitkeep +0 -0
  26. data/app/views/rails_admin/main/featured_content.html.erb +42 -0
  27. data/bin/console +14 -0
  28. data/bin/setup +8 -0
  29. data/config/initializers/assets.rb +7 -0
  30. data/config/locales/featured_content.en.yml +17 -0
  31. data/config/locales/featured_content.pt-BR.yml +17 -0
  32. data/config/routes.rb +9 -0
  33. data/lib/generators/rails_admin_featured_content_generator.rb +31 -0
  34. data/lib/generators/templates/create_featured_content_images_migration.rb +10 -0
  35. data/lib/generators/templates/create_featured_content_migration.rb +11 -0
  36. data/lib/generators/templates/featured_content_image_uploader.rb +50 -0
  37. data/lib/generators/templates/rails_admin_featured_content.rb +22 -0
  38. data/lib/rails_admin_featured_content.rb +55 -0
  39. data/lib/rails_admin_featured_content/engine.rb +23 -0
  40. data/lib/rails_admin_featured_content/version.rb +3 -0
  41. data/rails_admin_featured_content.gemspec +45 -0
  42. data/spec/controllers/rails_admin_featured_content/featured_content_controller_spec.rb +42 -0
  43. data/spec/dummy/Gemfile +11 -0
  44. data/spec/dummy/Gemfile.lock +235 -0
  45. data/spec/dummy/Rakefile +6 -0
  46. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  47. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  48. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  49. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  50. data/spec/dummy/app/uploaders/content_builder_image_uploader.rb +54 -0
  51. data/spec/dummy/app/uploaders/featured_content_image_uploader.rb +50 -0
  52. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  53. data/spec/dummy/bin/bundle +3 -0
  54. data/spec/dummy/bin/rails +4 -0
  55. data/spec/dummy/bin/rake +4 -0
  56. data/spec/dummy/bin/setup +29 -0
  57. data/spec/dummy/config.ru +4 -0
  58. data/spec/dummy/config/application.rb +31 -0
  59. data/spec/dummy/config/boot.rb +5 -0
  60. data/spec/dummy/config/database.yml +25 -0
  61. data/spec/dummy/config/environment.rb +5 -0
  62. data/spec/dummy/config/environments/development.rb +41 -0
  63. data/spec/dummy/config/environments/production.rb +79 -0
  64. data/spec/dummy/config/environments/test.rb +42 -0
  65. data/spec/dummy/config/initializers/assets.rb +11 -0
  66. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  67. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  68. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  69. data/spec/dummy/config/initializers/inflections.rb +16 -0
  70. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  71. data/spec/dummy/config/initializers/rails_admin.rb +37 -0
  72. data/spec/dummy/config/initializers/rails_admin_content_builder.rb +37 -0
  73. data/spec/dummy/config/initializers/rails_admin_featured_content.rb +22 -0
  74. data/spec/dummy/config/initializers/session_store.rb +3 -0
  75. data/spec/dummy/config/initializers/simple_form.rb +165 -0
  76. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  77. data/spec/dummy/config/locales/en.yml +23 -0
  78. data/spec/dummy/config/locales/simple_form.en.yml +31 -0
  79. data/spec/dummy/config/routes.rb +57 -0
  80. data/spec/dummy/config/secrets.yml +22 -0
  81. data/spec/dummy/db/development.sqlite3 +0 -0
  82. data/spec/dummy/db/migrate/20160729105801_create_content_builder_categories.rb +10 -0
  83. data/spec/dummy/db/migrate/20160729105802_create_content_builders.rb +16 -0
  84. data/spec/dummy/db/migrate/20160729105803_create_content_builder_images.rb +10 -0
  85. data/spec/dummy/db/migrate/20160729105947_create_featured_contents.rb +11 -0
  86. data/spec/dummy/db/migrate/20160729105948_create_featured_content_images.rb +10 -0
  87. data/spec/dummy/db/schema.rb +64 -0
  88. data/spec/dummy/db/test.sqlite3 +0 -0
  89. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  90. data/spec/dummy/log/development.log +1698 -0
  91. data/spec/dummy/log/test.log +36 -0
  92. data/spec/dummy/public/404.html +67 -0
  93. data/spec/dummy/public/422.html +67 -0
  94. data/spec/dummy/public/500.html +66 -0
  95. data/spec/dummy/public/favicon.ico +0 -0
  96. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/center_example.jpg +0 -0
  97. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/example.jpg +0 -0
  98. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/left_or_right_example.jpg +0 -0
  99. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/center_example.jpg +0 -0
  100. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/example.jpg +0 -0
  101. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/left_or_right_example.jpg +0 -0
  102. data/spec/dummy/public/uploads/rails_admin_featured_content/featured_content_image/image/1/example.jpg +0 -0
  103. data/spec/dummy/public/uploads/rails_admin_featured_content/featured_content_image/image/1/thumb_example.jpg +0 -0
  104. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/center_example.jpg +0 -0
  105. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/example.jpg +0 -0
  106. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/left_or_right_example.jpg +0 -0
  107. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/center_example.jpg +0 -0
  108. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/example.jpg +0 -0
  109. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/left_or_right_example.jpg +0 -0
  110. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/center_example.jpg +0 -0
  111. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/example.jpg +0 -0
  112. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/left_or_right_example.jpg +0 -0
  113. data/spec/factories/featured_content.rb +7 -0
  114. data/spec/factories/featured_content_image.rb +7 -0
  115. data/spec/fixtures/assets/example.jpg +0 -0
  116. data/spec/spec_helper.rb +20 -0
  117. data/spec/version_spec.rb +7 -0
  118. data/vendor/assets/stylesheets/rails_admin_featured_content.scss +557 -0
  119. metadata +575 -0
@@ -0,0 +1,599 @@
1
+ /*
2
+ *= require owl.carousel
3
+ *= require owl.theme
4
+ */
5
+
6
+ @import 'medium-editor/medium-editor';
7
+ @import 'medium-editor/themes/bootstrap';
8
+
9
+ .fc-snippet {
10
+ position: fixed;
11
+ z-index: 100;
12
+ top: 50px;
13
+ bottom: 110px;
14
+ right: 0;
15
+
16
+ width: 180px;
17
+
18
+ padding: 20px;
19
+
20
+ background: #f8f8f8;
21
+ border-left: solid 1px rgba(0,0,0,.1);
22
+
23
+ overflow: hidden;
24
+ overflow-y: scroll;
25
+ }
26
+
27
+ .fc-snippet__btn {
28
+ display: block;
29
+ text-decoration: none;
30
+ margin-bottom: 20px;
31
+
32
+ transition: box-shadow .1s ease;
33
+
34
+ &:hover {
35
+ box-shadow: 0 0 0 2px rgba(0,0,0,.1);
36
+ }
37
+ }
38
+
39
+ .fc-snippet__image {
40
+ width: 100%;
41
+ }
42
+
43
+ .fc-controls {
44
+ position: fixed;
45
+ z-index: 100;
46
+ bottom: 0;
47
+ right: 0;
48
+
49
+ width: 180px;
50
+
51
+ padding: 20px;
52
+
53
+ background: #f8f8f8;
54
+ border-top: solid 1px rgba(0,0,0,.1);
55
+ border-left: solid 1px rgba(0,0,0,.1);
56
+ }
57
+
58
+
59
+ .fc-tools {
60
+ position: absolute;
61
+ z-index: 300;
62
+ top: 0;
63
+ left: -40px;
64
+
65
+ border-radius: .4em;
66
+ background: darken(#fff, 7%);
67
+
68
+ overflow: hidden;
69
+ }
70
+
71
+ .fc-tools--center {
72
+ top: 50%;
73
+ left: 50%;
74
+ transform: translateX(-50%) translateY(-50%);
75
+
76
+ .fc-tools__btn {
77
+ display: inline-block;
78
+ }
79
+ }
80
+
81
+ .fc-tools--disabled {
82
+ z-index: 100;
83
+ }
84
+
85
+ .fc-tools__btn {
86
+ display: block;
87
+
88
+ font-size: 12px;
89
+ text-align: center;
90
+ text-transform: uppercase;
91
+
92
+ padding: 10px;
93
+
94
+ &:hover,
95
+ &:focus {
96
+ background: rgba(0,0,0,.05);
97
+ text-decoration: none;
98
+ }
99
+ }
100
+
101
+ .fc-tools__input {
102
+
103
+ }
104
+
105
+ .fc-tools__input--upload {
106
+ display: none !important;
107
+ }
108
+
109
+
110
+ .fc-container {
111
+ width: 777px;
112
+ padding: 0 0 0 40px;
113
+ }
114
+
115
+ .fc-content {
116
+ position: relative;
117
+ max-width: 100%;
118
+ height: auto !important;
119
+
120
+ &:after {
121
+ visibility: hidden;
122
+ display: block;
123
+ font-size: 0;
124
+ content: " ";
125
+ clear: both;
126
+ height: 0;
127
+ }
128
+ }
129
+
130
+ .fc-row {
131
+ position: relative;
132
+ }
133
+
134
+ .fc-row--flex {
135
+ display: flex;
136
+ }
137
+
138
+ .fc-loading {
139
+ position: absolute;
140
+ z-index: 200;
141
+ top: 0;
142
+ left: 0;
143
+
144
+ width: 100%;
145
+ height: 100%;
146
+ background: image_url('fc-loading.svg') no-repeat center rgba(#fff, .95);
147
+ }
148
+
149
+ .fc-search {
150
+ margin-bottom: 10px;
151
+
152
+ width: 100%;
153
+ padding: 8px;
154
+ border-radius: 4px;
155
+ border: solid 1px #ccc;
156
+
157
+ outline: none;
158
+
159
+ &:focus {
160
+ border-color: #999;
161
+ }
162
+ }
163
+
164
+
165
+ [contenteditable="true"] {
166
+ outline: none;
167
+ min-height: 15px;
168
+
169
+ &:focus {
170
+ box-shadow: 0 0 0 1px rgba(0,0,0,.2);
171
+ }
172
+
173
+ &:empty {
174
+ background: rgba(#000, .1);
175
+ }
176
+ }
177
+
178
+ .ui-sortable-placeholder {
179
+ margin: 20px 0;
180
+ height: 80px;
181
+
182
+ background: rgba(0,0,0,.05);
183
+ border: dashed 2px rgba(0,0,0,.05);
184
+ }
185
+
186
+
187
+ .fc-content {
188
+ line-height: 1.6;
189
+
190
+ color: rgba(0,0,0,.7);
191
+ font-family: arial, sans-serif;
192
+ font-size: 16px;
193
+
194
+ margin-bottom: 30px;
195
+ }
196
+
197
+
198
+ .fc-row {
199
+ position: relative;
200
+
201
+ &:after {
202
+ visibility: hidden;
203
+ display: block;
204
+ font-size: 0;
205
+ content: " ";
206
+ clear: both;
207
+ height: 0;
208
+ }
209
+ }
210
+
211
+ .fc-date {
212
+ color: lighten(#111, 50%);
213
+ font-size: 12px;
214
+
215
+ margin-bottom: 16px;
216
+ padding-bottom: 16px;
217
+
218
+ border-bottom: solid 1px rgba(#111, .06);
219
+ }
220
+
221
+ .fc-item {
222
+ position: relative;
223
+
224
+ &:after {
225
+ visibility: hidden;
226
+ display: block;
227
+ font-size: 0;
228
+ content: " ";
229
+ clear: both;
230
+ height: 0;
231
+ }
232
+
233
+ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
234
+ font-family: 'Open Sans', sans-serif !important;
235
+ font-weight: 700 !important;
236
+ }
237
+ }
238
+
239
+ .fc-item--border {
240
+ margin-bottom: 16px;
241
+ padding-bottom: 16px;
242
+
243
+ border-bottom: solid 1px rgba(#111, .06);
244
+ }
245
+
246
+ .fc-link {
247
+ display: none;
248
+ }
249
+
250
+ .fc-figure {
251
+ position: relative;
252
+ margin: 0 0 10px;
253
+
254
+ text-align: center;
255
+
256
+ border-radius: 4px;
257
+ overflow: hidden;
258
+ }
259
+
260
+ .fc-image {
261
+ margin-bottom: -7px;
262
+
263
+ height: 100%;
264
+ border-radius: 4px;
265
+ }
266
+
267
+ .fc-content {
268
+ height: 144px;
269
+ overflow: hidden;
270
+ }
271
+
272
+ .fc-time {
273
+ line-height: 1.6;
274
+
275
+ float: right;
276
+ color: darken(#fff, 40%);
277
+ font-size: 14px;
278
+ }
279
+
280
+ .fc-caption {
281
+ color: lighten(#111, 40%);
282
+ font-family: 'Open Sans', sans-serif;
283
+ font-size: 11px;
284
+ text-transform: uppercase;
285
+
286
+ margin: 0 0 10px;
287
+ }
288
+
289
+ .fc-title {
290
+ display: block;
291
+ width: 100%;
292
+ line-height: 1.2;
293
+
294
+ color: lighten(#111, 23%) !important;
295
+ font-size: 16px;
296
+ letter-spacing: -.04em;
297
+
298
+ margin: 0;
299
+ }
300
+
301
+ .fc-title--highlight {
302
+ padding: 8px;
303
+ background: #333;
304
+
305
+ color: #fff !important;
306
+ font-size: 19px !important;
307
+ }
308
+
309
+ .fc-text {
310
+ line-height: 1.5;
311
+
312
+ color: lighten(#111, 30%);
313
+ font-size: 14px;
314
+
315
+ margin: 10px 0 0;
316
+ }
317
+
318
+
319
+ @media screen and (min-width: 460px) {
320
+ .fc-figure {
321
+ float: left;
322
+ height: 112px;
323
+ margin: 4px 16px 0 0;
324
+ }
325
+
326
+ .fc-caption {
327
+ font-size: 13px;
328
+ }
329
+
330
+ .fc-title {
331
+ line-height: 1.4;
332
+ font-size: 20px;
333
+ }
334
+
335
+ .fc-title--small {
336
+ font-size: 17px;
337
+ }
338
+
339
+ .fc-title--large {
340
+ line-height: 1.3;
341
+ font-size: 26px;
342
+ }
343
+
344
+ .fc-text {
345
+ font-size: 14px;
346
+ }
347
+ }
348
+
349
+ @media screen and (min-width: 768px) {
350
+ .fc-item--two {
351
+ float: left;
352
+ display: block;
353
+ margin-right: 3.57866%;
354
+ width: 48.21067%;
355
+
356
+ &:nth-child(2n+1) {
357
+ clear: left;
358
+ }
359
+
360
+ &:nth-child(2n) {
361
+ margin-right: 0;
362
+ }
363
+ }
364
+
365
+ .fc-item--three {
366
+ float: left;
367
+ display: block;
368
+ margin-right: 3.16844%;
369
+ width: 31.22104%;
370
+
371
+ &:nth-child(3n+1) {
372
+ clear: left;
373
+ }
374
+
375
+ &:nth-child(3n) {
376
+ margin-right: 0;
377
+ }
378
+ }
379
+
380
+ .fc-item--four {
381
+ float: left;
382
+ display: block;
383
+ margin-right: 3.57866%;
384
+ width: 22.316%;
385
+
386
+ &:nth-child(4n+1) {
387
+ clear: left;
388
+ }
389
+
390
+ &:nth-child(4n) {
391
+ margin-right: 0;
392
+ }
393
+ }
394
+
395
+ .fc-date {
396
+ font-size: 14px;
397
+ }
398
+
399
+ .fc-title--highlight {
400
+ padding: 8px 14px;
401
+ }
402
+
403
+ .fc-figure--block {
404
+ float: none;
405
+ width: 100%;
406
+ margin: 0 16px 10px 0;
407
+
408
+ .fc-image {
409
+ width: 100%;
410
+ height: auto;
411
+ }
412
+ }
413
+
414
+ .fc-figure--small {
415
+ height: 64px;
416
+ }
417
+
418
+ .fc-figure--large {
419
+ height: 128px;
420
+ }
421
+
422
+ .fc-figure--clip {
423
+ .fc-figure {
424
+ width: 160px;
425
+ }
426
+
427
+ .fc-figure--small {
428
+ width: 96px;
429
+ }
430
+
431
+ .fc-figure--large {
432
+ width: 224px;
433
+ }
434
+ }
435
+ }
436
+
437
+
438
+ // slide
439
+
440
+ .fc-slide {
441
+
442
+ .owl-controls {
443
+ position: relative;
444
+ height: 30px;
445
+ line-height: 30px;
446
+
447
+ .owl-pagination {
448
+ position: absolute;
449
+ top: 0;
450
+ left: 0;
451
+
452
+ span {
453
+ margin: 0 10px 0 0;
454
+ width: 10px;
455
+ height: 10px;
456
+ line-height: 1;
457
+ }
458
+ }
459
+
460
+ .owl-buttons {
461
+ position: absolute;
462
+ top: 0;
463
+ right: 0;
464
+
465
+ div {
466
+ margin: 0;
467
+
468
+ color: rgba(0,0,0,.6);
469
+ font-size: 30px;
470
+ text-align: center;
471
+
472
+ width: 30px;
473
+ line-height: 1;
474
+ padding: 0;
475
+ border-radius: 0;
476
+ background: none;
477
+ }
478
+ }
479
+ }
480
+ }
481
+
482
+ .fc-slide__item {
483
+ position: relative;
484
+ height: 496px;
485
+ overflow: hidden;
486
+ }
487
+
488
+ .fc-slide__caption {
489
+ position: absolute;
490
+ top: 0;
491
+ left: 0;
492
+ z-index: 300;
493
+ margin: 32px;
494
+
495
+ color: #fff;
496
+ font-size: 16px;
497
+ text-transform: uppercase;
498
+
499
+ display: block;
500
+ min-width: calc(100% - 64px);
501
+ line-height: 1.6;
502
+
503
+ text-shadow: 1px 1px 0 rgba(0,0,0,.5);
504
+
505
+ &:after {
506
+ content: "";
507
+
508
+ position: absolute;
509
+ bottom: -10px;
510
+ left: 0;
511
+
512
+ display: block;
513
+ width: 48px;
514
+ height: 3px;
515
+
516
+ background: #444;
517
+ }
518
+ }
519
+
520
+ h2.fc-slide__caption {
521
+ font-weight: 600 !important;
522
+ }
523
+
524
+ .fc-slide__content {
525
+ padding: 32px;
526
+ }
527
+
528
+ .fc-slide__title {
529
+ margin: 0;
530
+
531
+ width: 100% !important;
532
+ line-height: 1.4;
533
+ color: #fff !important;
534
+ letter-spacing: -.04em;
535
+ font-size: 33px;
536
+
537
+ text-shadow: 1px 1px 0 rgba(0,0,0,.6);
538
+ }
539
+
540
+ .fc-slide__text {
541
+ margin: 8px 0 0;
542
+
543
+ width: 100% !important;
544
+ color: #fff;
545
+ font-size: 19px;
546
+ line-height: 1.6;
547
+
548
+ text-shadow: 1px 1px 0 rgba(0,0,0,.6);
549
+ }
550
+
551
+ .fc-slide__figure {
552
+ margin: 0;
553
+
554
+ width: 100%;
555
+ height: 0;
556
+ border-radius: 4px;
557
+ padding-bottom: 60%;
558
+
559
+ overflow: hidden;
560
+
561
+ &:before {
562
+ content: "";
563
+
564
+ position: absolute;
565
+ top: 0;
566
+ left: 0;
567
+ z-index: 10;
568
+
569
+ display: block;
570
+ width: 100%;
571
+ height: 100%;
572
+ opacity: .9;
573
+ background: rgba(#000, .4);
574
+ background-size: 120%;
575
+ border-radius: 4px;
576
+ }
577
+ }
578
+
579
+ .fc-slide__image {
580
+ position: absolute;
581
+ width: 100%;
582
+ min-height: 100%;
583
+ z-index: 100;
584
+ z-index: 0;
585
+ }
586
+
587
+ .fc-slide__link {
588
+ display: none;
589
+ }
590
+
591
+ .fc-slide__content {
592
+ position: absolute;
593
+ z-index: 200;
594
+ left: 0;
595
+ bottom: 0;
596
+ padding: 32px;
597
+
598
+ width: 100%;
599
+ }