rails_admin_featured_content 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +4 -0
  4. data/.rspec +3 -1
  5. data/Gemfile +1 -1
  6. data/README.md +25 -19
  7. data/app/assets/images/fc-snippet-four.jpg +0 -0
  8. data/app/assets/images/fc-snippet-four.psd +0 -0
  9. data/app/assets/images/fc-snippet-highlight.jpg +0 -0
  10. data/app/assets/images/fc-snippet-highlight.psd +0 -0
  11. data/app/assets/images/fc-snippet-slide.jpg +0 -0
  12. data/app/assets/images/fc-snippet-slide.psd +0 -0
  13. data/app/assets/images/fc-snippet-text.jpg +0 -0
  14. data/app/assets/images/fc-snippet-text.psd +0 -0
  15. data/app/assets/images/fc-snippet-three.jpg +0 -0
  16. data/app/assets/images/fc-snippet-three.psd +0 -0
  17. data/app/assets/images/fc-snippet-two.jpg +0 -0
  18. data/app/assets/images/fc-snippet-two.psd +0 -0
  19. data/app/assets/javascripts/rails_admin/featured_content.js.erb +68 -19
  20. data/app/assets/stylesheets/rails_admin/featured_content.scss +184 -74
  21. data/app/views/rails_admin/main/featured_content.html.erb +27 -5
  22. data/config/initializers/assets.rb +2 -1
  23. data/config/locales/featured_content.en.yml +7 -0
  24. data/config/locales/featured_content.pt-BR.yml +7 -0
  25. data/lib/rails_admin_featured_content/version.rb +1 -1
  26. data/screenshots/image-1.png +0 -0
  27. data/spec/dummy/db/test.sqlite3 +0 -0
  28. data/spec/dummy/log/development.log +11 -1692
  29. data/spec/dummy/log/test.log +264 -0
  30. data/spec/spec_helper.rb +22 -5
  31. data/spec/version_spec.rb +1 -1
  32. data/vendor/assets/stylesheets/rails_admin_featured_content.scss +144 -96
  33. metadata +11 -34
  34. data/spec/dummy/db/development.sqlite3 +0 -0
  35. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/center_example.jpg +0 -0
  36. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/example.jpg +0 -0
  37. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/left_or_right_example.jpg +0 -0
  38. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/center_example.jpg +0 -0
  39. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/example.jpg +0 -0
  40. data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/left_or_right_example.jpg +0 -0
  41. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/center_example.jpg +0 -0
  42. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/example.jpg +0 -0
  43. data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/left_or_right_example.jpg +0 -0
  44. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/center_example.jpg +0 -0
  45. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/example.jpg +0 -0
  46. data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/left_or_right_example.jpg +0 -0
  47. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/center_example.jpg +0 -0
  48. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/example.jpg +0 -0
  49. data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/left_or_right_example.jpg +0 -0
@@ -8,74 +8,92 @@
8
8
 
9
9
  .fc-snippet {
10
10
  position: fixed;
11
- z-index: 100;
12
- top: 50px;
13
- bottom: 110px;
11
+ z-index: 400;
12
+ bottom: 54px;
13
+ left: 0;
14
14
  right: 0;
15
15
 
16
- width: 150px;
17
-
18
- padding: 20px;
19
-
16
+ width: 100%;
17
+ height: 100px;
18
+ padding: 10px 0;
20
19
  background: #f8f8f8;
21
- border-left: solid 1px rgba(0,0,0,.1);
22
-
23
- overflow: hidden;
20
+ border-top: solid 1px rgba(0,0,0,.1);
24
21
  overflow-y: scroll;
25
22
  }
26
23
 
27
24
  .fc-snippet__btn {
28
- display: block;
25
+ box-sizing: border-box;
26
+ float: left;
27
+ width: 25%;
28
+ padding: 10px;
29
+
30
+ text-align: center;
29
31
  text-decoration: none;
30
- margin-bottom: 20px;
31
32
 
32
33
  transition: box-shadow .1s ease;
33
34
 
34
35
  &:hover {
36
+ text-decoration: none;
35
37
  box-shadow: 0 0 0 2px rgba(0,0,0,.1);
36
38
  }
37
39
  }
38
40
 
41
+ .fc-snippet__caption {
42
+ display: none;
43
+ padding: 5px;
44
+
45
+ color: rgba(0,0,0,.6);
46
+ font-size: 10px;
47
+ }
48
+
39
49
  .fc-snippet__image {
40
50
  width: 100%;
41
51
  }
42
52
 
43
53
  .fc-controls {
44
54
  position: fixed;
45
- z-index: 100;
55
+ z-index: 400;
46
56
  bottom: 0;
47
57
  right: 0;
48
58
 
49
- width: 150px;
59
+ width: 100%;
50
60
 
51
- padding: 20px;
61
+ padding: 10px;
52
62
 
53
63
  background: #f8f8f8;
54
64
  border-top: solid 1px rgba(0,0,0,.1);
55
65
  border-left: solid 1px rgba(0,0,0,.1);
56
- }
57
66
 
67
+ .btn-block {
68
+ margin-top: 0;
69
+ width: auto !important;
70
+ }
71
+
72
+ .btn-right {
73
+ float: right;
74
+ }
75
+
76
+ .btn-left {
77
+ float: left;
78
+ }
79
+ }
58
80
 
59
81
  .fc-tools {
60
- position: absolute;
61
- z-index: 300;
62
- top: 0;
63
- left: -40px;
82
+ margin-bottom: 10px;
64
83
 
65
- border-radius: .4em;
84
+ border-radius: .4rem;
66
85
  background: darken(#fff, 7%);
67
-
68
86
  overflow: hidden;
87
+
88
+ text-align: right;
69
89
  }
70
90
 
71
91
  .fc-tools--center {
92
+ position: absolute;
93
+ z-index: 300;
72
94
  top: 50%;
73
95
  left: 50%;
74
96
  transform: translateX(-50%) translateY(-50%);
75
-
76
- .fc-tools__btn {
77
- display: inline-block;
78
- }
79
97
  }
80
98
 
81
99
  .fc-tools--disabled {
@@ -83,7 +101,7 @@
83
101
  }
84
102
 
85
103
  .fc-tools__btn {
86
- display: block;
104
+ display: inline-block;
87
105
 
88
106
  font-size: 12px;
89
107
  text-align: center;
@@ -98,6 +116,10 @@
98
116
  }
99
117
  }
100
118
 
119
+ .fc-tools__btn--delete {
120
+ float: left;
121
+ }
122
+
101
123
  .fc-tools__input {
102
124
 
103
125
  }
@@ -106,10 +128,9 @@
106
128
  display: none !important;
107
129
  }
108
130
 
109
-
110
131
  .fc-container {
111
- width: 777px;
112
- padding: 0 0 0 40px;
132
+ box-sizing: border-box;
133
+ padding: 0 0 300px 0;
113
134
  }
114
135
 
115
136
  .fc-content {
@@ -131,13 +152,9 @@
131
152
  position: relative;
132
153
  }
133
154
 
134
- .fc-row--flex {
135
- display: flex;
136
- }
137
-
138
155
  .fc-loading {
139
156
  position: absolute;
140
- z-index: 200;
157
+ z-index: 400;
141
158
  top: 0;
142
159
  left: 0;
143
160
 
@@ -229,16 +246,11 @@
229
246
  clear: both;
230
247
  height: 0;
231
248
  }
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
249
  }
238
250
 
239
251
  .fc-item--border {
240
- margin-bottom: 16px;
241
- padding-bottom: 16px;
252
+ margin-bottom: 24px;
253
+ padding-bottom: 24px;
242
254
 
243
255
  border-bottom: solid 1px rgba(#111, .06);
244
256
  }
@@ -249,10 +261,12 @@
249
261
 
250
262
  .fc-figure {
251
263
  position: relative;
252
- margin: 0 0 10px;
264
+ float: left;
265
+ margin: 4px 16px 0 0;
253
266
 
254
267
  text-align: center;
255
268
 
269
+ height: 112px;
256
270
  border-radius: 4px;
257
271
  overflow: hidden;
258
272
  }
@@ -279,8 +293,7 @@
279
293
 
280
294
  .fc-caption {
281
295
  color: lighten(#111, 40%);
282
- font-family: 'Open Sans', sans-serif;
283
- font-size: 11px;
296
+ font-size: 10px;
284
297
  text-transform: uppercase;
285
298
 
286
299
  margin: 0 0 10px;
@@ -301,9 +314,10 @@
301
314
  .fc-title--highlight {
302
315
  padding: 8px;
303
316
  background: #333;
317
+ border-radius: 4px;
304
318
 
305
319
  color: #fff !important;
306
- font-size: 19px !important;
320
+ font-size: 17px !important;
307
321
  }
308
322
 
309
323
  .fc-text {
@@ -317,10 +331,8 @@
317
331
 
318
332
 
319
333
  @media screen and (min-width: 460px) {
320
- .fc-figure {
321
- float: left;
322
- height: 112px;
323
- margin: 4px 16px 0 0;
334
+ .fc-snippet__caption {
335
+ display: block;
324
336
  }
325
337
 
326
338
  .fc-caption {
@@ -338,7 +350,7 @@
338
350
 
339
351
  .fc-title--large {
340
352
  line-height: 1.3;
341
- font-size: 26px;
353
+ font-size: 25px;
342
354
  }
343
355
 
344
356
  .fc-text {
@@ -347,6 +359,92 @@
347
359
  }
348
360
 
349
361
  @media screen and (min-width: 768px) {
362
+ .fc-snippet {
363
+ top: 50px;
364
+ right: 0;
365
+ bottom: 112px;
366
+ left: auto;
367
+
368
+ width: 150px;
369
+ height: auto;
370
+ padding: 20px;
371
+ border: 0;
372
+ border-left: solid 1px rgba(0,0,0,.1);
373
+
374
+ -webkit-transform: translateX(0%);
375
+ -moz-transform: translateX(0%);
376
+ transform: translateX(0%);
377
+ }
378
+
379
+ .fc-snippet__btn {
380
+ margin-bottom: 20px;
381
+
382
+ display: block;
383
+ width: 100%;
384
+ padding: 0;
385
+ }
386
+
387
+ .fc-tools {
388
+ position: absolute;
389
+ z-index: 300;
390
+ top: 0;
391
+ left: -40px;
392
+ }
393
+
394
+ .fc-tools__btn {
395
+ display: block;
396
+ }
397
+
398
+ .fc-tools--center {
399
+ position: absolute;
400
+ z-index: 300;
401
+ top: 50%;
402
+ left: 50%;
403
+
404
+ .fc-tools__btn {
405
+ display: inline-block;
406
+ }
407
+ }
408
+
409
+ .fc-controls {
410
+ position: fixed;
411
+ z-index: 100;
412
+ bottom: 0;
413
+ right: 0;
414
+
415
+ width: 150px;
416
+
417
+ padding: 20px;
418
+
419
+ background: #f8f8f8;
420
+ border-top: solid 1px rgba(0,0,0,.1);
421
+ border-left: solid 1px rgba(0,0,0,.1);
422
+
423
+ .btn-block {
424
+ width: 100% !important;
425
+ }
426
+
427
+ .btn-block + .btn-block {
428
+ margin-top: 5px;
429
+ }
430
+
431
+ .btn-left,
432
+ .btn-right {
433
+ float: none;
434
+ }
435
+ }
436
+
437
+ .fc-container {
438
+ box-sizing: border-box;
439
+ padding: 30px 160px 100px 40px;
440
+ width: 80%;
441
+ margin: 0 auto;
442
+ }
443
+
444
+ .fc-row--flex {
445
+ display: flex;
446
+ }
447
+
350
448
  .fc-item--two {
351
449
  float: left;
352
450
  display: block;
@@ -401,36 +499,34 @@
401
499
  }
402
500
 
403
501
  .fc-figure--block {
502
+ position: relative;
404
503
  float: none;
504
+ margin: 0 1rem .5rem 0;
505
+
405
506
  width: 100%;
406
- margin: 0 16px 10px 0;
507
+ height: 0;
508
+ padding-bottom: 50%;
407
509
 
408
510
  .fc-image {
511
+ position: absolute;
512
+ top: 50%;
513
+ left: 0;
514
+
409
515
  width: 100%;
410
516
  height: auto;
517
+
518
+ -webkit-transform: translateY(-50%);
519
+ -moz-transform: translateY(-50%);
520
+ transform: translateY(-50%);
411
521
  }
412
522
  }
413
523
 
414
524
  .fc-figure--small {
415
- height: 64px;
525
+ padding-bottom: 40%;
416
526
  }
417
527
 
418
528
  .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
- }
529
+ padding-bottom: 60%;
434
530
  }
435
531
  }
436
532
 
@@ -491,7 +587,7 @@
491
587
  margin: 32px;
492
588
 
493
589
  color: #fff;
494
- font-size: 16px;
590
+ font-size: 12px;
495
591
  text-transform: uppercase;
496
592
 
497
593
  display: block;
@@ -511,7 +607,7 @@
511
607
  width: 48px;
512
608
  height: 3px;
513
609
 
514
- background: #444;
610
+ background: rgba(#fff, .7);
515
611
  }
516
612
  }
517
613
 
@@ -530,7 +626,7 @@ h2.fc-slide__caption {
530
626
  line-height: 1.3;
531
627
  color: #fff !important;
532
628
  letter-spacing: -.04em;
533
- font-size: 33px;
629
+ font-size: 16px;
534
630
 
535
631
  text-shadow: 1px 1px 0 rgba(0,0,0,.6);
536
632
  }
@@ -539,8 +635,8 @@ h2.fc-slide__caption {
539
635
  margin: 8px 0 0;
540
636
 
541
637
  width: 100% !important;
542
- color: #fff;
543
- font-size: 19px;
638
+ color: rgba(#fff, .8);
639
+ font-size: 12px;
544
640
  line-height: 1.6;
545
641
 
546
642
  text-shadow: 1px 1px 0 rgba(0,0,0,.6);
@@ -553,7 +649,7 @@ h2.fc-slide__caption {
553
649
 
554
650
  width: 100%;
555
651
  height: 0;
556
- border-radius: 6px;
652
+ border-radius: 4px;
557
653
  padding-bottom: 60%;
558
654
 
559
655
  overflow: hidden;
@@ -599,3 +695,17 @@ h2.fc-slide__caption {
599
695
 
600
696
  width: 100%;
601
697
  }
698
+
699
+ @media screen and (min-width: 768px) {
700
+ .fc-slide__caption {
701
+ font-size: 16px;
702
+ }
703
+
704
+ .fc-slide__title {
705
+ font-size: 33px;
706
+ }
707
+
708
+ .fc-slide__text {
709
+ font-size: 19px;
710
+ }
711
+ }
@@ -4,32 +4,54 @@
4
4
  <div class="fc-snippet">
5
5
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '1'} do %>
6
6
  <%= image_tag 'fc-snippet-highlight.jpg', class: 'fc-snippet__image' %>
7
+ <span class="fc-snippet__caption">
8
+ <%= t('admin.actions.featured_content.snippet.targe') %>
9
+ </span>
7
10
  <% end %>
8
11
 
9
12
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '2'} do %>
10
13
  <%= image_tag 'fc-snippet-text.jpg', class: 'fc-snippet__image' %>
14
+ <span class="fc-snippet__caption">
15
+ <%= t('admin.actions.featured_content.snippet.title_large') %>
16
+ </span>
11
17
  <% end %>
12
18
 
13
19
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '3'} do %>
14
20
  <%= image_tag 'fc-snippet-slide.jpg', class: 'fc-snippet__image' %>
21
+ <span class="fc-snippet__caption">
22
+ <%= t('admin.actions.featured_content.snippet.slide') %>
23
+ </span>
15
24
  <% end %>
16
25
 
17
26
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '4'} do %>
18
- <%= image_tag 'fc-snippet-three.jpg', class: 'fc-snippet__image' %>
27
+ <%= image_tag 'fc-snippet-two.jpg', class: 'fc-snippet__image' %>
28
+ <span class="fc-snippet__caption">
29
+ <%= t('admin.actions.featured_content.snippet.list_two') %>
30
+ </span>
19
31
  <% end %>
20
32
 
21
33
  <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '5'} do %>
22
- <%= image_tag 'fc-snippet-two.jpg', class: 'fc-snippet__image' %>
34
+ <%= image_tag 'fc-snippet-three.jpg', class: 'fc-snippet__image' %>
35
+ <span class="fc-snippet__caption">
36
+ <%= t('admin.actions.featured_content.snippet.list_three') %>
37
+ </span>
38
+ <% end %>
39
+
40
+ <%= link_to '#', class: 'fc-snippet__btn', data: {snippet: '6'} do %>
41
+ <%= image_tag 'fc-snippet-four.jpg', class: 'fc-snippet__image' %>
42
+ <span class="fc-snippet__caption">
43
+ <%= t('admin.actions.featured_content.snippet.list_four') %>
44
+ </span>
23
45
  <% end %>
24
46
  </div>
25
47
 
26
48
  <%= simple_form_for rails_admin.featured_content_url(@abstract_model.to_param, id: @object.id), html: { class: 'fc-form' }, remote: false do |f| %>
27
49
  <div class="fc-controls">
28
- <%= f.button :submit, "Salvar", name: 'save', class: 'btn btn-block btn-primary' %>
50
+ <%= f.button :submit, "Salvar", name: 'save', class: 'btn btn-block btn-primary btn-right' %>
29
51
  <% if @object.status %>
30
- <%= f.button :submit, "Despublicar", name: 'unpublish', class: 'btn btn-block btn-danger' %>
52
+ <%= f.button :submit, "Despublicar", name: 'unpublish', class: 'btn btn-block btn-danger btn-left' %>
31
53
  <% else %>
32
- <%= f.button :submit, "Publicar", name: 'publish', class: 'btn btn-block btn-success' %>
54
+ <%= f.button :submit, "Publicar", name: 'publish', class: 'btn btn-block btn-success btn-left' %>
33
55
  <% end %>
34
56
  </div>
35
57
 
@@ -3,5 +3,6 @@ Rails.application.config.assets.precompile += %w( fc-image-default.jpg )
3
3
  Rails.application.config.assets.precompile += %w( fc-snippet-highlight.jpg )
4
4
  Rails.application.config.assets.precompile += %w( fc-snippet-slide.jpg )
5
5
  Rails.application.config.assets.precompile += %w( fc-snippet-text.jpg )
6
- Rails.application.config.assets.precompile += %w( fc-snippet-three.jpg )
7
6
  Rails.application.config.assets.precompile += %w( fc-snippet-two.jpg )
7
+ Rails.application.config.assets.precompile += %w( fc-snippet-three.jpg )
8
+ Rails.application.config.assets.precompile += %w( fc-snippet-four.jpg )
@@ -15,3 +15,10 @@ en:
15
15
  save: "Save"
16
16
  publish: "Publish"
17
17
  unpublish: 'Unpublish'
18
+ snippet:
19
+ targe: "Targe"
20
+ title_large: "Title large"
21
+ slide: "Slide"
22
+ list_two: "List with two"
23
+ list_three: "List with three"
24
+ list_four: "List with four"
@@ -15,3 +15,10 @@ pt-BR:
15
15
  save: "Salvar"
16
16
  publish: "Publicar"
17
17
  unpublish: 'Despublicar'
18
+ snippet:
19
+ targe: "Tarja"
20
+ title_large: "Título grande"
21
+ slide: "Slide"
22
+ list_two: "Lista com duas"
23
+ list_three: "Lista com três"
24
+ list_four: "Lista com quatro"
@@ -1,3 +1,3 @@
1
1
  module RailsAdminFeaturedContent
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5".freeze
3
3
  end
Binary file
Binary file