lato_media 2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +27 -0
  4. data/Rakefile +5 -0
  5. data/app/assets/config/lato_media_manifest.js +2 -0
  6. data/app/assets/javascripts/lato_media/application.js +18 -0
  7. data/app/assets/javascripts/lato_media/initializers/Inputs.js +62 -0
  8. data/app/assets/javascripts/lato_media/interfaces/MediaSelector.js +128 -0
  9. data/app/assets/stylesheets/lato_media/application.scss +17 -0
  10. data/app/assets/stylesheets/lato_media/cells/_cells.scss +2 -0
  11. data/app/assets/stylesheets/lato_media/cells/elements/_elements.scss +2 -0
  12. data/app/assets/stylesheets/lato_media/cells/elements/_preview.scss +67 -0
  13. data/app/assets/stylesheets/lato_media/cells/elements/_previews.scss +23 -0
  14. data/app/assets/stylesheets/lato_media/cells/inputs/_gallery.scss +13 -0
  15. data/app/assets/stylesheets/lato_media/cells/inputs/_inputs.scss +2 -0
  16. data/app/assets/stylesheets/lato_media/cells/inputs/_media.scss +25 -0
  17. data/app/assets/stylesheets/lato_media/pages/_medias.scss +20 -0
  18. data/app/assets/stylesheets/lato_media/pages/_pages.scss +1 -0
  19. data/app/assets/stylesheets/lato_media/partials/_media_selector.scss +53 -0
  20. data/app/assets/stylesheets/lato_media/partials/_partials.scss +1 -0
  21. data/app/assets/stylesheets/lato_media/theme.scss.erb +12 -0
  22. data/app/cells/lato_media/elements/preview/cell.rb +44 -0
  23. data/app/cells/lato_media/elements/preview/views/general.html.erb +14 -0
  24. data/app/cells/lato_media/elements/preview/views/image.html.erb +10 -0
  25. data/app/cells/lato_media/elements/preview/views/not_found.html.erb +15 -0
  26. data/app/cells/lato_media/elements/preview/views/show.html.erb +33 -0
  27. data/app/cells/lato_media/elements/previews/cell.rb +37 -0
  28. data/app/cells/lato_media/elements/previews/views/show.html.erb +43 -0
  29. data/app/cells/lato_media/inputs/gallery/cell.rb +80 -0
  30. data/app/cells/lato_media/inputs/gallery/views/show.html.erb +39 -0
  31. data/app/cells/lato_media/inputs/media/cell.rb +64 -0
  32. data/app/cells/lato_media/inputs/media/views/show.html.erb +40 -0
  33. data/app/controllers/lato_media/application_controller.rb +13 -0
  34. data/app/controllers/lato_media/back/back_controller.rb +13 -0
  35. data/app/controllers/lato_media/back/media_selector_controller.rb +43 -0
  36. data/app/controllers/lato_media/back/medias_controller.rb +101 -0
  37. data/app/controllers/lato_media/doc/cells_controller.rb +43 -0
  38. data/app/controllers/lato_media/doc/doc_controller.rb +17 -0
  39. data/app/controllers/lato_media/doc/general_controller.rb +9 -0
  40. data/app/helpers/lato_media/application_helper.rb +4 -0
  41. data/app/jobs/lato_media/application_job.rb +4 -0
  42. data/app/mailers/lato_media/application_mailer.rb +6 -0
  43. data/app/models/lato_media/application_record.rb +5 -0
  44. data/app/models/lato_media/media/entity_helpers.rb +15 -0
  45. data/app/models/lato_media/media.rb +26 -0
  46. data/app/views/lato_media/back/media_selector/load_form.js.erb +9 -0
  47. data/app/views/lato_media/back/media_selector/load_index.js.erb +6 -0
  48. data/app/views/lato_media/back/media_selector/load_inputs_gallery.js.erb +6 -0
  49. data/app/views/lato_media/back/media_selector/load_inputs_media.js.erb +6 -0
  50. data/app/views/lato_media/back/medias/edit.html.erb +51 -0
  51. data/app/views/lato_media/back/medias/index.html.erb +25 -0
  52. data/app/views/lato_media/back/medias/new.html.erb +25 -0
  53. data/app/views/lato_media/back/medias/refresh_index.js.erb +11 -0
  54. data/app/views/lato_media/back/medias/shared/_dropzone_modal.html.erb +12 -0
  55. data/app/views/lato_media/back/medias/shared/_form.html.erb +52 -0
  56. data/app/views/lato_media/back/medias/shared/_index.html.erb +14 -0
  57. data/app/views/lato_media/doc/cells/elements_preview.html.erb +241 -0
  58. data/app/views/lato_media/doc/cells/elements_previews.html.erb +87 -0
  59. data/app/views/lato_media/doc/cells/inputs_gallery.html.erb +63 -0
  60. data/app/views/lato_media/doc/cells/inputs_media.html.erb +63 -0
  61. data/app/views/lato_media/doc/doc/index.html.erb +59 -0
  62. data/app/views/lato_media/doc/general/installation.html.erb +49 -0
  63. data/app/views/lato_media/doc/general/personalization.html.erb +0 -0
  64. data/app/views/lato_media/partials/_media_selector.html.erb +12 -0
  65. data/app/views/lato_media/partials/media_selector/_modal.html.erb +16 -0
  66. data/app/views/lato_media/partials/media_selector/_modal_form.html.erb +6 -0
  67. data/app/views/lato_media/partials/media_selector/_modal_index.html.erb +18 -0
  68. data/config/configs.yml +50 -0
  69. data/config/initializers/assets.rb +4 -0
  70. data/config/languages/default.yml +39 -0
  71. data/config/languages/it.yml +39 -0
  72. data/config/routes/api.rb +3 -0
  73. data/config/routes/back.rb +9 -0
  74. data/config/routes/doc.rb +15 -0
  75. data/config/routes.rb +16 -0
  76. data/db/migrate/20160224181218_create_lato_media_media.rb +15 -0
  77. data/lib/lato_media/engine.rb +16 -0
  78. data/lib/lato_media/version.rb +3 -0
  79. data/lib/lato_media.rb +5 -0
  80. data/lib/tasks/lato_media_tasks.rake +4 -0
  81. metadata +179 -0
@@ -0,0 +1,51 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ container_block_big = cell(:elements, :block).new(class: 'xs-12 sm-12 md-8 no-padding no-background no-shadow')
5
+ container_block_small = cell(:elements, :block).new(class: 'xs-12 sm-12 md-4 no-padding no-background no-shadow')
6
+ %>
7
+
8
+ <!-- MAIN CONTAINER -->
9
+ <%=raw row.open %>
10
+
11
+ <!-- SMALL SECTION CONTAINER -->
12
+ <%=raw container_block_small.open %>
13
+
14
+ <%=raw row.open %>
15
+
16
+ <%=raw block.open %>
17
+
18
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'md-12') %>
19
+
20
+ <%=raw block.close %>
21
+
22
+ <%=raw row.close %>
23
+
24
+ <%=raw cell(:elements, :button).new(label: LANGUAGES[:lato_media][:mixed][:delete_media], icon: 'trash',
25
+ url: lato_media.media_path(@media.id), style: 'danger', method: :delete, confirmation: {
26
+ message: LANGUAGES[:lato_media][:mixed][:delete_media_confirm],
27
+ positive_response: LANGUAGES[:lato_media][:mixed][:delete_media_confirm_positive],
28
+ negative_response: LANGUAGES[:lato_media][:mixed][:delete_media_confirm_negative]
29
+ }) %>
30
+
31
+ <%=raw container_block_small.close %>
32
+ <!-- / SMALL SECTION CONTAINER -->
33
+
34
+ <!-- BIG SECTION CONTAINER -->
35
+ <%=raw container_block_big.open %>
36
+
37
+ <%=raw row.open %>
38
+
39
+ <%=raw block.open %>
40
+
41
+ <%= render 'lato_media/back/medias/shared/form', url: lato_media.media_path(@media.id), method: :put %>
42
+
43
+ <%=raw block.close %>
44
+
45
+ <%=raw row.close %>
46
+
47
+ <%=raw container_block_big.close %>
48
+ <!-- / BIG SECTION CONTAINER -->
49
+
50
+ <%=raw row.close %>
51
+ <!-- / MAIN CONTAINER -->
@@ -0,0 +1,25 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ %>
5
+
6
+ <!-- MAIN CONTAINER -->
7
+ <%=raw row.open %>
8
+
9
+ <%=raw block.open %>
10
+
11
+ <div class="text-right">
12
+ <%=raw cell(:elements, :button).new(label: LANGUAGES[:lato_media][:mixed][:add_media], icon: 'plus',
13
+ onclick: "Modal.open('dropzone-modal', event);") %>
14
+ </div>
15
+ <br>
16
+
17
+ <%=raw cell(:elements, :modal).new(id: 'dropzone-modal', title: LANGUAGES[:lato_media][:mixed][:add_media],
18
+ render: render('lato_media/back/medias/shared/dropzone_modal')) %>
19
+
20
+ <%= render 'lato_media/back/medias/shared/index' %>
21
+
22
+ <%=raw block.close %>
23
+
24
+ <%=raw row.close %>
25
+ <!-- / MAIN CONTAINER -->
@@ -0,0 +1,25 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ %>
5
+
6
+ <!-- MAIN CONTAINER -->
7
+ <%=raw row.open %>
8
+
9
+ <%=raw block.open %>
10
+
11
+ <div class="medias__dropzone">
12
+ <%=raw cell(:inputs, :dropzone).new(url: lato_media.medias_path, max_size: CONFIGS[:lato_media][:max_media_accepted_size],
13
+ label: LANGUAGES[:lato_media][:mixed][:load_media_files]) %>
14
+ </div>
15
+
16
+ <br>
17
+ <div class="text-right">
18
+ <%=raw cell(:elements, :button).new(label: LANGUAGES[:lato_media][:mixed][:show_all_media], icon: 'check',
19
+ url: lato_media.medias_path, style: 'success') %>
20
+ </div>
21
+
22
+ <%=raw block.close %>
23
+
24
+ <%=raw row.close %>
25
+ <!-- / MAIN CONTAINER -->
@@ -0,0 +1,11 @@
1
+ // Refresh index
2
+ $('.medias__medias-index').replaceWith('<%=j render 'lato_media/back/medias/shared/index' %>')
3
+
4
+ // Close modal
5
+ Modal.close('dropzone-modal')
6
+
7
+ // Refresh modal content
8
+ $('.medias__dropzone-modal').replaceWith('<%=j render 'lato_media/back/medias/shared/dropzone_modal' %>')
9
+
10
+ // Re-initialize dropzone
11
+ InputsInitializer.init()
@@ -0,0 +1,12 @@
1
+ <div class="medias__dropzone-modal">
2
+ <div class="medias__dropzone">
3
+ <%=raw cell(:inputs, :dropzone).new(url: lato_media.medias_path, max_size: CONFIGS[:lato_media][:max_media_accepted_size],
4
+ label: LANGUAGES[:lato_media][:mixed][:load_media_files]) %>
5
+ </div>
6
+
7
+ <br>
8
+ <div class="medias__dropzone-modal-actions text-right">
9
+ <%=raw cell(:elements, :button).new(label: LANGUAGES[:lato_media][:mixed][:show_all_media], icon: 'check',
10
+ url: lato_media.medias_refresh_index_path, style: 'success', remote: true) %>
11
+ </div>
12
+ </div>
@@ -0,0 +1,52 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ form = cell(:inputs, :form).new(url: url, method: method)
4
+ %>
5
+
6
+ <%=raw form.open %>
7
+
8
+ <%=raw row.open %>
9
+
10
+ <%=raw cell(:inputs, :text).new(name: 'media[title]', label: LANGUAGES[:lato_media][:forms][:title],
11
+ required: true, class: 'md-12', value: @media.title) %>
12
+
13
+ <%=raw row.close %>
14
+
15
+ <%=raw row.open %>
16
+
17
+ <%=raw cell(:inputs, :textarea).new(name: 'media[description]', label: LANGUAGES[:lato_media][:forms][:description],
18
+ class: 'md-12', value: @media.description) %>
19
+
20
+ <%=raw row.close %>
21
+
22
+ <%=raw row.open %>
23
+
24
+ <%=raw cell(:inputs, :text).new(name: '', label: LANGUAGES[:lato_media][:forms][:url],
25
+ disabled: true, class: 'md-12', value: @media.attachment.url) %>
26
+
27
+ <% if @media.image? %>
28
+
29
+ <%=raw cell(:inputs, :text).new(name: '', label: LANGUAGES[:lato_media][:forms][:thumb_url],
30
+ disabled: true, class: 'md-4', value: @media.attachment.url(:thumb)) %>
31
+
32
+ <%=raw cell(:inputs, :text).new(name: '', label: LANGUAGES[:lato_media][:forms][:medium_url],
33
+ disabled: true, class: 'md-4', value: @media.attachment.url(:medium)) %>
34
+
35
+ <%=raw cell(:inputs, :text).new(name: '', label: LANGUAGES[:lato_media][:forms][:large_url],
36
+ disabled: true, class: 'md-4', value: @media.attachment.url(:large)) %>
37
+
38
+ <% end %>
39
+
40
+ <%=raw row.close %>
41
+
42
+ <div class="text-right">
43
+
44
+ <%=raw cell(:elements, :button).new(type: 'link', label: LANGUAGES[:lato_media][:mixed][:cancel],
45
+ style: 'danger', icon: 'ban', url: lato_media.medias_path) %>
46
+
47
+ <%=raw cell(:elements, :button).new(type: 'submit', label: LANGUAGES[:lato_media][:mixed][:save],
48
+ style: 'success', icon: 'check') %>
49
+
50
+ </div>
51
+
52
+ <%=raw form.close %>
@@ -0,0 +1,14 @@
1
+ <div class="medias__medias-index">
2
+
3
+ <div class="row">
4
+ <% @medias.each do |media| %>
5
+
6
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: media, url: lato_media.media_path(media.id), class: 'xs-12 sm-6 md-3 lg-3') %>
7
+
8
+ <% end %>
9
+ </div>
10
+
11
+ <br>
12
+ <%=raw cell(:elements, :pagination).new(total: @pagination_total, current: @pagination_current, url: lato_media.medias_path, param: 'page') %>
13
+
14
+ </div>
@@ -0,0 +1,241 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ code = cell(:elements, :code).new
5
+ %>
6
+
7
+ <!-- PRESENTATION -->
8
+ <%=raw row.open %>
9
+
10
+ <%=raw block.open %>
11
+
12
+ <%=raw cell(:elements, :title).new(label: 'Cells Elements: Preview') %>
13
+
14
+ <p>A Preview is a small preview of a single media element.</p>
15
+
16
+ <p>NB: All examples take a sample media from your gallery as media to show.</p>
17
+
18
+ <%=raw block.close %>
19
+
20
+ <%=raw row.close %>
21
+ <!-- / PRESENTATION -->
22
+
23
+ <hr>
24
+ <%=raw cell(:elements, :title).new(label: 'Normal Preview', size: 3) %>
25
+
26
+ <%=raw row.open %>
27
+
28
+ <%=raw block.open %>
29
+
30
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media) %>
31
+
32
+ <%=raw block.close %>
33
+
34
+ <%=raw row.close %>
35
+
36
+ <!-- CODE SECTION -->
37
+ <%=raw row.open %>
38
+
39
+ <%=raw block.open %>
40
+
41
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
42
+
43
+ <%=raw code.open %>
44
+
45
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media) <%= erb_close_tag %>
46
+
47
+ <%=raw code.close %>
48
+
49
+ <%=raw block.close %>
50
+
51
+ <%=raw row.close %>
52
+ <!-- / CODE SECTION -->
53
+
54
+ <hr>
55
+ <%=raw cell(:elements, :title).new(label: 'Preview inside a row', size: 3) %>
56
+
57
+ <%=raw row.open %>
58
+
59
+ <%=raw block.open %>
60
+
61
+ <%=raw row.open %>
62
+
63
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') %>
64
+
65
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') %>
66
+
67
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') %>
68
+
69
+ <%=raw row.close %>
70
+
71
+ <%=raw block.close %>
72
+
73
+ <%=raw row.close %>
74
+
75
+ <!-- CODE SECTION -->
76
+ <%=raw row.open %>
77
+
78
+ <%=raw block.open %>
79
+
80
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
81
+
82
+ <%=raw code.open %>
83
+
84
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') <%= erb_close_tag %>
85
+
86
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') <%= erb_close_tag %>
87
+
88
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4') <%= erb_close_tag %>
89
+
90
+ <%=raw code.close %>
91
+
92
+ <%=raw block.close %>
93
+
94
+ <%=raw row.close %>
95
+ <!-- / CODE SECTION -->
96
+
97
+ <hr>
98
+ <%=raw cell(:elements, :title).new(label: 'Preview with custom height', size: 3) %>
99
+
100
+ <%=raw row.open %>
101
+
102
+ <%=raw block.open %>
103
+
104
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, height: 400) %>
105
+
106
+ <%=raw block.close %>
107
+
108
+ <%=raw row.close %>
109
+
110
+ <!-- CODE SECTION -->
111
+ <%=raw row.open %>
112
+
113
+ <%=raw block.open %>
114
+
115
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
116
+
117
+ <%=raw code.open %>
118
+
119
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, height: 400) <%= erb_close_tag %>
120
+
121
+ <%=raw code.close %>
122
+
123
+ <%=raw block.close %>
124
+
125
+ <%=raw row.close %>
126
+ <!-- / CODE SECTION -->
127
+
128
+ <hr>
129
+ <%=raw cell(:elements, :title).new(label: 'Preview with custom image size', size: 3) %>
130
+
131
+ <%=raw row.open %>
132
+
133
+ <%=raw block.open %>
134
+
135
+ <p>NB: This example work only with an image media.</p>
136
+
137
+ <%=raw row.open %>
138
+
139
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'thumb') %>
140
+
141
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'medium') %>
142
+
143
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'large') %>
144
+
145
+ <%=raw row.close %>
146
+
147
+ <%=raw block.close %>
148
+
149
+ <%=raw row.close %>
150
+
151
+ <!-- CODE SECTION -->
152
+ <%=raw row.open %>
153
+
154
+ <%=raw block.open %>
155
+
156
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
157
+
158
+ <%=raw code.open %>
159
+
160
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'thumb') <%= erb_close_tag %>
161
+
162
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'medium') <%= erb_close_tag %>
163
+
164
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, class: 'xs-12 sm-4 md-4', size: 'large') <%= erb_close_tag %>
165
+
166
+ <%=raw code.close %>
167
+
168
+ <%=raw block.close %>
169
+
170
+ <%=raw row.close %>
171
+ <!-- / CODE SECTION -->
172
+
173
+ <hr>
174
+ <%=raw cell(:elements, :title).new(label: 'Preview with link', size: 3) %>
175
+
176
+ <%=raw row.open %>
177
+
178
+ <%=raw block.open %>
179
+
180
+ <%=raw row.open %>
181
+
182
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, url: '#', class: 'md-6') %>
183
+
184
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, url: '#', remote: true, class: 'md-6') %>
185
+
186
+ <%=raw row.close %>
187
+
188
+ <%=raw block.close %>
189
+
190
+ <%=raw row.close %>
191
+
192
+ <!-- CODE SECTION -->
193
+ <%=raw row.open %>
194
+
195
+ <%=raw block.open %>
196
+
197
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
198
+
199
+ <%=raw code.open %>
200
+
201
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, url: '#', class: 'md-6') <%= erb_close_tag %>
202
+
203
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, url: '#', remote: true, class: 'md-6') <%= erb_close_tag %>
204
+
205
+ <%=raw code.close %>
206
+
207
+ <%=raw block.close %>
208
+
209
+ <%=raw row.close %>
210
+ <!-- / CODE SECTION -->
211
+
212
+ <hr>
213
+ <%=raw cell(:elements, :title).new(label: 'Preview with onclick action', size: 3) %>
214
+
215
+ <%=raw row.open %>
216
+
217
+ <%=raw block.open %>
218
+
219
+ <%=raw cell('LatoMedia', :elements, :preview).new(media: @media, onclick: "alert('Hello World');") %>
220
+
221
+ <%=raw block.close %>
222
+
223
+ <%=raw row.close %>
224
+
225
+ <!-- CODE SECTION -->
226
+ <%=raw row.open %>
227
+
228
+ <%=raw block.open %>
229
+
230
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
231
+
232
+ <%=raw code.open %>
233
+
234
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :preview).new(media: @media, onclick: "alert('Hello World');") <%= erb_close_tag %>
235
+
236
+ <%=raw code.close %>
237
+
238
+ <%=raw block.close %>
239
+
240
+ <%=raw row.close %>
241
+ <!-- / CODE SECTION -->
@@ -0,0 +1,87 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ code = cell(:elements, :code).new
5
+ %>
6
+
7
+ <!-- PRESENTATION -->
8
+ <%=raw row.open %>
9
+
10
+ <%=raw block.open %>
11
+
12
+ <%=raw cell(:elements, :title).new(label: 'Cells Elements: Previews') %>
13
+
14
+ <p>A Previews is a small preview of a multiple media element.</p>
15
+
16
+ <p>NB: All examples take a sample media from your gallery as media to show.</p>
17
+
18
+ <%=raw block.close %>
19
+
20
+ <%=raw row.close %>
21
+ <!-- / PRESENTATION -->
22
+
23
+ <hr>
24
+ <%=raw cell(:elements, :title).new(label: 'Normal Previews', size: 3) %>
25
+
26
+ <%=raw row.open %>
27
+
28
+ <%=raw block.open %>
29
+
30
+ <%=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: 'md-12') %>
31
+
32
+ <%=raw block.close %>
33
+
34
+ <%=raw row.close %>
35
+
36
+ <!-- CODE SECTION -->
37
+ <%=raw row.open %>
38
+
39
+ <%=raw block.open %>
40
+
41
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
42
+
43
+ <%=raw code.open %>
44
+
45
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: 'md-12') <%= erb_close_tag %>
46
+
47
+ <%=raw code.close %>
48
+
49
+ <%=raw block.close %>
50
+
51
+ <%=raw row.close %>
52
+ <!-- / CODE SECTION -->
53
+
54
+ <hr>
55
+ <%=raw cell(:elements, :title).new(label: 'Previews with options', size: 3) %>
56
+
57
+ <%=raw row.open %>
58
+
59
+ <%=raw block.open %>
60
+
61
+ <%=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: ' sm-12 md-6') %>
62
+
63
+ <%=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: ' sm-12 md-6', size: 'thumb') %>
64
+
65
+ <%=raw block.close %>
66
+
67
+ <%=raw row.close %>
68
+
69
+ <!-- CODE SECTION -->
70
+ <%=raw row.open %>
71
+
72
+ <%=raw block.open %>
73
+
74
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
75
+
76
+ <%=raw code.open %>
77
+
78
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: ' sm-12 md-6') <%= erb_close_tag %>
79
+
80
+ <%= erb_open_tag %>=raw cell('LatoMedia', :elements, :previews).new(medias: @medias, class: ' sm-12 md-6', size: 'thumb') <%= erb_close_tag %>
81
+
82
+ <%=raw code.close %>
83
+
84
+ <%=raw block.close %>
85
+
86
+ <%=raw row.close %>
87
+ <!-- / CODE SECTION -->
@@ -0,0 +1,63 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ code = cell(:elements, :code).new
5
+ form = cell(:inputs, :form).new(url: '#', method: 'get')
6
+ %>
7
+
8
+ <!-- PRESENTATION -->
9
+ <%=raw row.open %>
10
+
11
+ <%=raw block.open %>
12
+
13
+ <%=raw cell(:elements, :title).new(label: 'Cells Inputs: Gallery') %>
14
+
15
+ <p>A Gallery input is an extension of core inputs used to select a multiple media object from the media library.</p>
16
+
17
+ <%=raw block.close %>
18
+
19
+ <%=raw row.close %>
20
+ <!-- / PRESENTATION -->
21
+
22
+ <hr>
23
+ <%=raw cell(:elements, :title).new(label: 'Normal Gallery input', size: 3) %>
24
+
25
+ <%=raw row.open %>
26
+
27
+ <%=raw block.open %>
28
+
29
+ <%=raw form.open %>
30
+
31
+ <%=raw row.open %>
32
+
33
+ <%=raw cell('LatoMedia', :inputs, :gallery).new(name: 'sample', label: 'Select multiple media', class: 'xs-12 sm-6 md-6') %>
34
+
35
+ <%=raw cell('LatoMedia', :inputs, :gallery).new(name: 'sample', label: 'Select multiple media', class: 'xs-12 sm-6 md-6', value: @medias) %>
36
+
37
+ <%=raw row.close %>
38
+
39
+ <%=raw form.close %>
40
+
41
+ <%=raw block.close %>
42
+
43
+ <%=raw row.close %>
44
+
45
+ <!-- CODE SECTION -->
46
+ <%=raw row.open %>
47
+
48
+ <%=raw block.open %>
49
+
50
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
51
+
52
+ <%=raw code.open %>
53
+
54
+ <%= erb_open_tag %>=raw cell('LatoMedia', :inputs, :gallery).new(name: 'sample', label: 'Select multiple media', class: 'xs-12 sm-6 md-6') <%= erb_close_tag %>
55
+
56
+ <%= erb_open_tag %>=raw cell('LatoMedia', :inputs, :gallery).new(name: 'sample', label: 'Select multiple media', class: 'xs-12 sm-6 md-6', value: @medias) <%= erb_close_tag %>
57
+
58
+ <%=raw code.close %>
59
+
60
+ <%=raw block.close %>
61
+
62
+ <%=raw row.close %>
63
+ <!-- / CODE SECTION -->
@@ -0,0 +1,63 @@
1
+ <%
2
+ row = cell(:elements, :row).new
3
+ block = cell(:elements, :block).new(class: 'xs-12 sm-12 md-12')
4
+ code = cell(:elements, :code).new
5
+ form = cell(:inputs, :form).new(url: '#', method: 'get')
6
+ %>
7
+
8
+ <!-- PRESENTATION -->
9
+ <%=raw row.open %>
10
+
11
+ <%=raw block.open %>
12
+
13
+ <%=raw cell(:elements, :title).new(label: 'Cells Inputs: Media') %>
14
+
15
+ <p>A Media input is an extension of core inputs used to select a media object from the media library.</p>
16
+
17
+ <%=raw block.close %>
18
+
19
+ <%=raw row.close %>
20
+ <!-- / PRESENTATION -->
21
+
22
+ <hr>
23
+ <%=raw cell(:elements, :title).new(label: 'Normal Media input', size: 3) %>
24
+
25
+ <%=raw row.open %>
26
+
27
+ <%=raw block.open %>
28
+
29
+ <%=raw form.open %>
30
+
31
+ <%=raw row.open %>
32
+
33
+ <%=raw cell('LatoMedia', :inputs, :media).new(name: 'sample', label: 'Select a media', class: 'xs-12 sm-6 md-6', value: @media.id) %>
34
+
35
+ <%=raw cell('LatoMedia', :inputs, :media).new(name: 'sample', label: 'Select a media', class: 'xs-12 sm-6 md-6') %>
36
+
37
+ <%=raw row.close %>
38
+
39
+ <%=raw form.close %>
40
+
41
+ <%=raw block.close %>
42
+
43
+ <%=raw row.close %>
44
+
45
+ <!-- CODE SECTION -->
46
+ <%=raw row.open %>
47
+
48
+ <%=raw block.open %>
49
+
50
+ <%=raw cell(:elements, :title).new(label: 'Code', size: 6) %>
51
+
52
+ <%=raw code.open %>
53
+
54
+ <%= erb_open_tag %>=raw cell('LatoMedia', :inputs, :media).new(name: 'sample', label: 'Select a media', class: 'xs-12 sm-6 md-6', value: @media.id) <%= erb_close_tag %>
55
+
56
+ <%= erb_open_tag %>=raw cell('LatoMedia', :inputs, :media).new(name: 'sample', label: 'Select a media', class: 'xs-12 sm-6 md-6') <%= erb_close_tag %>
57
+
58
+ <%=raw code.close %>
59
+
60
+ <%=raw block.close %>
61
+
62
+ <%=raw row.close %>
63
+ <!-- / CODE SECTION -->