spina 2.3.5 → 2.6.1

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.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -3
  3. data/app/assets/javascripts/spina/application.js +1 -1
  4. data/app/assets/javascripts/spina/controllers/application.js +11 -0
  5. data/app/assets/javascripts/spina/controllers/embed_controller.js +16 -0
  6. data/app/assets/javascripts/spina/controllers/embed_tag_controller.js +16 -0
  7. data/app/assets/javascripts/spina/controllers/index.js +5 -0
  8. data/app/assets/javascripts/spina/controllers/trix_controller.js +12 -2
  9. data/app/assets/stylesheets/spina/_fonts.css.erb +114 -0
  10. data/app/assets/stylesheets/spina/_tailwind.css +18 -5
  11. data/app/assets/stylesheets/spina/application.css +6 -0
  12. data/app/assets/stylesheets/spina/tailwind/custom.css +13 -5
  13. data/app/components/spina/forms/trix_toolbar_component.html.erb +26 -15
  14. data/app/components/spina/media_picker/image_component.html.erb +1 -1
  15. data/app/components/spina/pages/new_page_button_component.html.erb +32 -0
  16. data/app/components/spina/pages/new_page_button_component.rb +19 -0
  17. data/app/controllers/concerns/spina/frontend.rb +1 -1
  18. data/app/controllers/spina/admin/embeds_controller.rb +36 -0
  19. data/app/controllers/spina/admin/pages_controller.rb +1 -2
  20. data/app/controllers/spina/admin/password_resets_controller.rb +2 -4
  21. data/app/helpers/spina/admin/icons_helper.rb +2 -2
  22. data/app/helpers/spina/images_helper.rb +1 -1
  23. data/app/helpers/spina/spina_helper.rb +3 -2
  24. data/app/mailers/spina/application_mailer.rb +7 -0
  25. data/app/mailers/spina/user_mailer.rb +6 -14
  26. data/app/models/spina/embeds/base.rb +7 -0
  27. data/app/models/spina/embeds/button.rb +13 -0
  28. data/app/models/spina/embeds/vimeo.rb +39 -0
  29. data/app/models/spina/embeds/youtube.rb +39 -0
  30. data/app/models/spina/page.rb +10 -3
  31. data/app/models/spina/user.rb +6 -0
  32. data/app/presenters/spina/content_presenter.rb +1 -1
  33. data/app/presenters/spina/rich_text_presenter.rb +45 -0
  34. data/app/views/layouts/spina/admin/application.html.erb +1 -1
  35. data/app/views/layouts/spina/mail.html.erb +476 -1
  36. data/app/views/spina/admin/embeds/new.html.erb +47 -0
  37. data/app/views/spina/admin/pages/edit_template.html.erb +1 -1
  38. data/app/views/spina/admin/pages/index.html.erb +1 -21
  39. data/app/views/spina/admin/shared/_flash.html.erb +2 -2
  40. data/app/views/spina/embeds/buttons/_button.html.erb +3 -0
  41. data/app/views/spina/embeds/buttons/_button_fields.html.erb +14 -0
  42. data/app/views/spina/embeds/buttons/_trix_button.html.erb +3 -0
  43. data/app/views/spina/embeds/vimeos/_thumbnail.html.erb +6 -0
  44. data/app/views/spina/embeds/vimeos/_vimeo.html.erb +1 -0
  45. data/app/views/spina/embeds/vimeos/_vimeo_fields.html.erb +9 -0
  46. data/app/views/spina/embeds/youtubes/_thumbnail.html.erb +6 -0
  47. data/app/views/spina/embeds/youtubes/_youtube.html.erb +1 -0
  48. data/app/views/spina/embeds/youtubes/_youtube_fields.html.erb +9 -0
  49. data/app/views/spina/user_mailer/forgot_password.html.erb +57 -1
  50. data/app/views/spina/user_mailer/forgot_password.text.erb +9 -0
  51. data/config/initializers/importmap.rb +12 -0
  52. data/config/locales/en.yml +30 -0
  53. data/config/locales/nl.yml +1 -0
  54. data/config/routes.rb +5 -2
  55. data/lib/generators/spina/embed_generator.rb +18 -0
  56. data/lib/generators/spina/install_generator.rb +36 -14
  57. data/lib/generators/spina/templates/app/models/spina/embeds/embed.rb.tt +18 -0
  58. data/lib/generators/spina/templates/app/views/default/pages/homepage.html.erb +1 -1
  59. data/lib/generators/spina/templates/app/views/spina/embeds/_fields.html.erb +13 -0
  60. data/lib/generators/spina/templates/app/views/spina/embeds/_partial.html.erb +2 -0
  61. data/lib/generators/spina/templates/config/initializers/spina.rb +7 -0
  62. data/lib/generators/spina/templates/config/initializers/themes/default.rb +3 -0
  63. data/lib/generators/spina/templates/config/initializers/themes/demo.rb +4 -1
  64. data/lib/spina/embeddable.rb +48 -0
  65. data/lib/spina/embeds/trix_conversion.rb +41 -0
  66. data/lib/spina/embeds.rb +11 -0
  67. data/lib/spina/engine.rb +7 -21
  68. data/lib/spina/part.rb +10 -2
  69. data/lib/spina/railtie.rb +10 -0
  70. data/lib/spina/theme.rb +16 -3
  71. data/lib/spina/theme_reloader.rb +20 -0
  72. data/lib/spina/version.rb +1 -1
  73. data/lib/spina.rb +11 -0
  74. data/lib/tasks/spina_tasks.rake +19 -2
  75. metadata +66 -34
  76. data/app/assets/stylesheets/spina/_fonts.scss +0 -114
  77. data/app/assets/stylesheets/spina/application.sass +0 -3
  78. data/app/views/spina/user_mailer/forgot_password.txt.erb +0 -1
@@ -1 +1,476 @@
1
- <%= yield %>
1
+ <!-- The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Wildbit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE. -->
22
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
+ <html xmlns="http://www.w3.org/1999/xhtml">
24
+ <head>
25
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
26
+ <meta name="x-apple-disable-message-reformatting" />
27
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
28
+ <meta name="color-scheme" content="light dark" />
29
+ <meta name="supported-color-schemes" content="light dark" />
30
+ <title></title>
31
+ <style type="text/css" rel="stylesheet" media="all">
32
+ /* Base ------------------------------ */
33
+
34
+ @import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&amp;display=swap");
35
+ body {
36
+ width: 100% !important;
37
+ height: 100%;
38
+ margin: 0;
39
+ -webkit-text-size-adjust: none;
40
+ }
41
+
42
+ a {
43
+ color: #3869D4;
44
+ }
45
+
46
+ a img {
47
+ border: none;
48
+ }
49
+
50
+ td {
51
+ word-break: break-word;
52
+ }
53
+
54
+ .preheader {
55
+ display: none !important;
56
+ visibility: hidden;
57
+ mso-hide: all;
58
+ font-size: 1px;
59
+ line-height: 1px;
60
+ max-height: 0;
61
+ max-width: 0;
62
+ opacity: 0;
63
+ overflow: hidden;
64
+ }
65
+ /* Type ------------------------------ */
66
+
67
+ body,
68
+ td,
69
+ th {
70
+ font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
71
+ }
72
+
73
+ h1 {
74
+ margin-top: 0;
75
+ color: #333333;
76
+ font-size: 22px;
77
+ font-weight: bold;
78
+ text-align: left;
79
+ }
80
+
81
+ h2 {
82
+ margin-top: 0;
83
+ color: #333333;
84
+ font-size: 16px;
85
+ font-weight: bold;
86
+ text-align: left;
87
+ }
88
+
89
+ h3 {
90
+ margin-top: 0;
91
+ color: #333333;
92
+ font-size: 14px;
93
+ font-weight: bold;
94
+ text-align: left;
95
+ }
96
+
97
+ td,
98
+ th {
99
+ font-size: 16px;
100
+ }
101
+
102
+ p,
103
+ ul,
104
+ ol,
105
+ blockquote {
106
+ margin: .4em 0 1.1875em;
107
+ font-size: 16px;
108
+ line-height: 1.625;
109
+ }
110
+
111
+ p.sub {
112
+ font-size: 13px;
113
+ }
114
+ /* Utilities ------------------------------ */
115
+
116
+ .align-right {
117
+ text-align: right;
118
+ }
119
+
120
+ .align-left {
121
+ text-align: left;
122
+ }
123
+
124
+ .align-center {
125
+ text-align: center;
126
+ }
127
+ /* Buttons ------------------------------ */
128
+
129
+ .button {
130
+ background-color: #3869D4;
131
+ border-top: 10px solid #3869D4;
132
+ border-right: 18px solid #3869D4;
133
+ border-bottom: 10px solid #3869D4;
134
+ border-left: 18px solid #3869D4;
135
+ display: inline-block;
136
+ color: #FFF;
137
+ text-decoration: none;
138
+ border-radius: 7px;
139
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
140
+ -webkit-text-size-adjust: none;
141
+ box-sizing: border-box;
142
+ }
143
+
144
+ .button--green {
145
+ background-color: #22BC66;
146
+ border-top: 10px solid #22BC66;
147
+ border-right: 18px solid #22BC66;
148
+ border-bottom: 10px solid #22BC66;
149
+ border-left: 18px solid #22BC66;
150
+ }
151
+
152
+ .button--spina {
153
+ background-color: #6865b4;
154
+ border-top: 10px solid #6865b4;
155
+ border-right: 18px solid #6865b4;
156
+ border-bottom: 10px solid #6865b4;
157
+ border-left: 18px solid #6865b4;
158
+ }
159
+
160
+ .button--red {
161
+ background-color: #FF6136;
162
+ border-top: 10px solid #FF6136;
163
+ border-right: 18px solid #FF6136;
164
+ border-bottom: 10px solid #FF6136;
165
+ border-left: 18px solid #FF6136;
166
+ }
167
+
168
+ @media only screen and (max-width: 500px) {
169
+ .button {
170
+ width: 100% !important;
171
+ text-align: center !important;
172
+ }
173
+ }
174
+ /* Attribute list ------------------------------ */
175
+
176
+ .attributes {
177
+ margin: 0 0 21px;
178
+ }
179
+
180
+ .attributes_content {
181
+ background-color: #F4F4F7;
182
+ padding: 16px;
183
+ }
184
+
185
+ .attributes_item {
186
+ padding: 0;
187
+ }
188
+ /* Related Items ------------------------------ */
189
+
190
+ .related {
191
+ width: 100%;
192
+ margin: 0;
193
+ padding: 25px 0 0 0;
194
+ -premailer-width: 100%;
195
+ -premailer-cellpadding: 0;
196
+ -premailer-cellspacing: 0;
197
+ }
198
+
199
+ .related_item {
200
+ padding: 10px 0;
201
+ color: #CBCCCF;
202
+ font-size: 15px;
203
+ line-height: 18px;
204
+ }
205
+
206
+ .related_item-title {
207
+ display: block;
208
+ margin: .5em 0 0;
209
+ }
210
+
211
+ .related_item-thumb {
212
+ display: block;
213
+ padding-bottom: 10px;
214
+ }
215
+
216
+ .related_heading {
217
+ border-top: 1px solid #CBCCCF;
218
+ text-align: center;
219
+ padding: 25px 0 10px;
220
+ }
221
+ /* Discount Code ------------------------------ */
222
+
223
+ .discount {
224
+ width: 100%;
225
+ margin: 0;
226
+ padding: 24px;
227
+ -premailer-width: 100%;
228
+ -premailer-cellpadding: 0;
229
+ -premailer-cellspacing: 0;
230
+ background-color: #F4F4F7;
231
+ border: 2px dashed #CBCCCF;
232
+ }
233
+
234
+ .discount_heading {
235
+ text-align: center;
236
+ }
237
+
238
+ .discount_body {
239
+ text-align: center;
240
+ font-size: 15px;
241
+ }
242
+ /* Social Icons ------------------------------ */
243
+
244
+ .social {
245
+ width: auto;
246
+ }
247
+
248
+ .social td {
249
+ padding: 0;
250
+ width: auto;
251
+ }
252
+
253
+ .social_icon {
254
+ height: 20px;
255
+ margin: 0 8px 10px 8px;
256
+ padding: 0;
257
+ }
258
+ /* Data table ------------------------------ */
259
+
260
+ .purchase {
261
+ width: 100%;
262
+ margin: 0;
263
+ padding: 35px 0;
264
+ -premailer-width: 100%;
265
+ -premailer-cellpadding: 0;
266
+ -premailer-cellspacing: 0;
267
+ }
268
+
269
+ .purchase_content {
270
+ width: 100%;
271
+ margin: 0;
272
+ padding: 25px 0 0 0;
273
+ -premailer-width: 100%;
274
+ -premailer-cellpadding: 0;
275
+ -premailer-cellspacing: 0;
276
+ }
277
+
278
+ .purchase_item {
279
+ padding: 10px 0;
280
+ color: #51545E;
281
+ font-size: 15px;
282
+ line-height: 18px;
283
+ }
284
+
285
+ .purchase_heading {
286
+ padding-bottom: 8px;
287
+ border-bottom: 1px solid #EAEAEC;
288
+ }
289
+
290
+ .purchase_heading p {
291
+ margin: 0;
292
+ color: #85878E;
293
+ font-size: 12px;
294
+ }
295
+
296
+ .purchase_footer {
297
+ padding-top: 15px;
298
+ border-top: 1px solid #EAEAEC;
299
+ }
300
+
301
+ .purchase_total {
302
+ margin: 0;
303
+ text-align: right;
304
+ font-weight: bold;
305
+ color: #333333;
306
+ }
307
+
308
+ .purchase_total--label {
309
+ padding: 0 15px 0 0;
310
+ }
311
+
312
+ body {
313
+ background-color: #FFF;
314
+ color: #333;
315
+ }
316
+
317
+ p {
318
+ color: #333;
319
+ }
320
+
321
+ .email-wrapper {
322
+ width: 100%;
323
+ margin: 0;
324
+ padding: 0;
325
+ -premailer-width: 100%;
326
+ -premailer-cellpadding: 0;
327
+ -premailer-cellspacing: 0;
328
+ }
329
+
330
+ .email-content {
331
+ width: 100%;
332
+ margin: 0;
333
+ padding: 0;
334
+ -premailer-width: 100%;
335
+ -premailer-cellpadding: 0;
336
+ -premailer-cellspacing: 0;
337
+ }
338
+ /* Masthead ----------------------- */
339
+
340
+ .email-masthead {
341
+ padding: 25px 0;
342
+ text-align: center;
343
+ }
344
+
345
+ .email-masthead_logo {
346
+ width: 94px;
347
+ }
348
+
349
+ .email-masthead_name {
350
+ font-size: 16px;
351
+ font-weight: bold;
352
+ color: #A8AAAF;
353
+ text-decoration: none;
354
+ text-shadow: 0 1px 0 white;
355
+ }
356
+ /* Body ------------------------------ */
357
+
358
+ .email-body {
359
+ width: 100%;
360
+ margin: 0;
361
+ padding: 0;
362
+ -premailer-width: 100%;
363
+ -premailer-cellpadding: 0;
364
+ -premailer-cellspacing: 0;
365
+ }
366
+
367
+ .email-body_inner {
368
+ width: 570px;
369
+ margin: 0 auto;
370
+ padding: 0;
371
+ -premailer-width: 570px;
372
+ -premailer-cellpadding: 0;
373
+ -premailer-cellspacing: 0;
374
+ }
375
+
376
+ .email-footer {
377
+ width: 570px;
378
+ margin: 0 auto;
379
+ padding: 0;
380
+ -premailer-width: 570px;
381
+ -premailer-cellpadding: 0;
382
+ -premailer-cellspacing: 0;
383
+ text-align: center;
384
+ }
385
+
386
+ .email-footer p {
387
+ color: #A8AAAF;
388
+ }
389
+
390
+ .body-action {
391
+ width: 100%;
392
+ margin: 30px auto;
393
+ padding: 0;
394
+ -premailer-width: 100%;
395
+ -premailer-cellpadding: 0;
396
+ -premailer-cellspacing: 0;
397
+ text-align: center;
398
+ }
399
+
400
+ .body-sub {
401
+ margin-top: 25px;
402
+ padding-top: 25px;
403
+ border-top: 1px solid #EAEAEC;
404
+ }
405
+
406
+ .content-cell {
407
+ padding: 35px;
408
+ }
409
+ /*Media Queries ------------------------------ */
410
+
411
+ @media only screen and (max-width: 600px) {
412
+ .email-body_inner,
413
+ .email-footer {
414
+ width: 100% !important;
415
+ }
416
+ }
417
+
418
+ @media (prefers-color-scheme: dark) {
419
+ body {
420
+ background-color: #333333 !important;
421
+ color: #FFF !important;
422
+ }
423
+ p,
424
+ ul,
425
+ ol,
426
+ blockquote,
427
+ h1,
428
+ h2,
429
+ h3,
430
+ span,
431
+ .purchase_item {
432
+ color: #FFF !important;
433
+ }
434
+ .attributes_content,
435
+ .discount {
436
+ background-color: #222 !important;
437
+ }
438
+ .email-masthead_name {
439
+ text-shadow: none !important;
440
+ }
441
+ }
442
+
443
+ :root {
444
+ color-scheme: light dark;
445
+ supported-color-schemes: light dark;
446
+ }
447
+ </style>
448
+ <!--[if mso]>
449
+ <style type="text/css">
450
+ .f-fallback {
451
+ font-family: Arial, sans-serif;
452
+ }
453
+ </style>
454
+ <![endif]-->
455
+ <style type="text/css" rel="stylesheet" media="all">
456
+ body {
457
+ width: 100% !important;
458
+ height: 100%;
459
+ margin: 0;
460
+ -webkit-text-size-adjust: none;
461
+ }
462
+
463
+ body {
464
+ font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
465
+ }
466
+
467
+ body {
468
+ background-color: #FFF;
469
+ color: #333;
470
+ }
471
+ </style>
472
+ </head>
473
+ <body style="width: 100% !important; height: 100%; -webkit-text-size-adjust: none; font-family: &quot;Nunito Sans&quot;, Helvetica, Arial, sans-serif; background-color: #FFF; color: #333; margin: 0;" bgcolor="#FFF">
474
+ <%= yield %>
475
+ </body>
476
+ </html>
@@ -0,0 +1,47 @@
1
+ <%= render Spina::UserInterface::ModalComponent.new(size: "max-w-screen-md h-full md:h-96") do %>
2
+ <div class="h-full" data-controller="embed" data-trix-target="<%= params[:target] %>">
3
+ <%= turbo_frame_tag :trix_attachment_html, class: 'hidden', data: {embeddables_target: "html", action: "embed-tag:embedded->embed#insertEmbeddable embed-tag:embedded->modal#close"} %>
4
+
5
+ <%= turbo_frame_tag :embeddable_form do %>
6
+ <div class="flex h-full">
7
+ <div class="p-4 w-64 bg-gray-100 md:bg-opacity-50">
8
+ <div class="text-xs font-medium text-gray-600 mb-2">
9
+ <%=t "spina.embeds.embed_a_component" %>
10
+ </div>
11
+ <% embeddables.each do |embeddable| %>
12
+ <% if embeddable.name == @embeddable.class.name %>
13
+ <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-900 bg-spina-dark bg-opacity-20" %>
14
+ <% else %>
15
+ <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-600 hover:bg-gray-200 bg-opacity-100 hover:bg-gray-200" %>
16
+ <% end %>
17
+
18
+ <%= link_to spina.new_admin_embed_path(embed_type: embeddable.name), class: classes, data: {turbo_frame: :embeddable_form} do %>
19
+ <%= heroicon(embeddable.icon, style: :solid, class: 'w-5 h-5 mr-2 text-spina-light') %>
20
+ <%= embeddable.model_name.human %>
21
+ <% end %>
22
+ <% end %>
23
+ </div>
24
+
25
+ <div class="bg-white flex-1">
26
+ <%= form_with model: @embeddable, scope: :embeddable, url: spina.admin_embeds_path, class: 'h-full' do |f| %>
27
+ <%= hidden_field_tag :embed_type, @embeddable.class.name %>
28
+
29
+ <div class="h-full relative">
30
+ <div class="flex-1 p-5 h-full pb-20 overflow-scroll">
31
+ <%= render partial: @embeddable.to_fields_path, locals: {f: f} %>
32
+ </div>
33
+
34
+ <div class="w-full flex backdrop-filter backdrop-blur-lg absolute bottom-0 justify-end p-5 py-4 border-t border-gray-200">
35
+ <%= button_tag type: :submit, class: 'btn btn-primary' do %>
36
+ <%= heroicon('plus', style: :solid, class: 'w-6 h-6 -ml-2') %>
37
+ <%=t "spina.embeds.embed_component" %>
38
+ <% end %>
39
+ </div>
40
+ </div>
41
+ <% end %>
42
+ </div>
43
+ </div>
44
+ <% end %>
45
+
46
+ </div>
47
+ <% end %>
@@ -15,7 +15,7 @@
15
15
  <%= Spina::Page.human_attribute_name :view_template %>
16
16
  </label>
17
17
 
18
- <%= f.select :view_template, options_for_select(current_theme.view_templates.map { |template| [template[:title], template[:name], {'data-page-parts' => template[:page_parts]}] }, @page.view_template), {}, class: "mt-1 form-select w-full" %>
18
+ <%= f.select :view_template, current_theme.new_page_templates(resource: @page.resource).map{ |template| [template.title, template.name] }, {}, class: "mt-1 form-select w-full" %>
19
19
  </div>
20
20
  </div>
21
21
  </div>
@@ -8,27 +8,7 @@
8
8
  <% end %>
9
9
 
10
10
  <div class="ml-3">
11
- <%= render Spina::UserInterface::DropdownComponent.new do |dropdown| %>
12
- <% dropdown.button(classes: "btn btn-primary w-full") do %>
13
- <%= heroicon("plus", style: :solid, class: "w-7 h-7 -ml-2") %>
14
- <%=t 'spina.pages.new' %>
15
- <% end %>
16
-
17
- <% dropdown.menu do %>
18
- <% @page_templates.each do |template| %>
19
- <%= link_to spina.new_admin_page_path(view_template: template.name, resource_id: @resource&.id), class: "block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
20
- <div class="font-medium text-gray-700">
21
- <%= template.title %>
22
-
23
- <% if template.recommended %>
24
- <span class="text-green-500 text-xs"><%=t 'spina.pages.recommended' %></span>
25
- <% end %>
26
- </div>
27
- <div class="text-gray-400"><%= template.description %></div>
28
- <% end %>
29
- <% end %>
30
- <% end %>
31
- <% end %>
11
+ <%= render Spina::Pages::NewPageButtonComponent.new(@page_templates, resource: @resource) %>
32
12
  </div>
33
13
  <% end %>
34
14
 
@@ -1,5 +1,5 @@
1
- <div class="fixed bottom-0 left-0 w-full flex justify-center z-50">
1
+ <div class="fixed bottom-0 left-0 w-full flex justify-center z-50 pointer-events-none">
2
2
  <% flash.each do |type, message| %>
3
3
  <%= render Spina::UserInterface::FlashMessageComponent.new(type: type, message: message) %>
4
4
  <% end %>
5
- </div>
5
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= link_to button.url do %>
2
+ <%= button.label %>
3
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <div class="text-xl font-bold mb-3 text-gray-800">
2
+ Button
3
+ <div class="text-sm text-gray-500 font-normal">
4
+ A simple button that links somewhere
5
+ </div>
6
+ </div>
7
+
8
+ <%= render Spina::Forms::LabelComponent.new(f, :url) %>
9
+ <%= render Spina::Forms::TextFieldComponent.new(f, :url, autofocus: true) %>
10
+
11
+ <div class="mt-3">
12
+ <%= render Spina::Forms::LabelComponent.new(f, :label) %>
13
+ <%= render Spina::Forms::TextFieldComponent.new(f, :label) %>
14
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= button_tag type: :button, class: "btn btn-default" do %>
2
+ <%= button.label %>
3
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <div class='border border-blue-600 text-blue-600 rounded-md flex items-center px-1 whitespace-nowrap'>
2
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-1" viewBox="0 0 20 20" fill="currentColor">
3
+ <path d="M2 6a2 2 0 012-2h6a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zM14.553 7.106A1 1 0 0014 8v4a1 1 0 00.553.894l2 1A1 1 0 0018 13V7a1 1 0 00-1.447-.894l-2 1z" />
4
+ </svg>
5
+ <%= vimeo.remote_title %>
6
+ </div>
@@ -0,0 +1 @@
1
+ <iframe src="https://player.vimeo.com/video/<%= vimeo.id %>" width="640" height="475" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
@@ -0,0 +1,9 @@
1
+ <div class="text-xl font-bold mb-3 text-gray-800">
2
+ Vimeo
3
+ <div class="text-sm text-gray-500 font-normal">
4
+ Embed a Vimeo video
5
+ </div>
6
+ </div>
7
+
8
+ <%= render Spina::Forms::LabelComponent.new(f, :url) %>
9
+ <%= render Spina::Forms::TextFieldComponent.new(f, :url, autofocus: true) %>
@@ -0,0 +1,6 @@
1
+ <div class='border border-red-600 text-red-600 rounded-md flex items-center px-1 whitespace-nowrap'>
2
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-1" viewBox="0 0 20 20" fill="currentColor">
3
+ <path d="M2 6a2 2 0 012-2h6a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zM14.553 7.106A1 1 0 0014 8v4a1 1 0 00.553.894l2 1A1 1 0 0018 13V7a1 1 0 00-1.447-.894l-2 1z" />
4
+ </svg>
5
+ <%= youtube.remote_title %>
6
+ </div>
@@ -0,0 +1 @@
1
+ <iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/<%= youtube.id %>" frameborder="0"></iframe>
@@ -0,0 +1,9 @@
1
+ <div class="text-xl font-bold mb-3 text-gray-800">
2
+ Youtube
3
+ <div class="text-sm text-gray-500 font-normal">
4
+ Embed a Youtube video
5
+ </div>
6
+ </div>
7
+
8
+ <%= render Spina::Forms::LabelComponent.new(f, :url) %>
9
+ <%= render Spina::Forms::TextFieldComponent.new(f, :url, autofocus: true) %>