nuntius 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcf2eb3ee110dd40c68860c8b1b1351b77558b269ce1921f7f530230c63762ee
4
- data.tar.gz: fe52688abaf148ad6481c66abfec1c22d45335224687f82087f36b5bd995daaf
3
+ metadata.gz: b0dd9ea6a32009f0a48a394de12275c119aa73c5dc72a4b21f749867b89797a1
4
+ data.tar.gz: 01f2c695d6487875583d1e08f239beb110bf196dcc0820c13e48b97f7a6cef19
5
5
  SHA512:
6
- metadata.gz: 56d4e617138d2868119fbb18302c884e30282d309ad77bcd7cbeccf28b430aff49d5af773fcda03c388fd14dc5c3132584fb715cc62fa750148e9aea55b0ed9b
7
- data.tar.gz: 1e91a60fad70aeaade08ae345923340ce0b6d06e2898c4a6abe933c08694d8e32ba6733d72cec63fbc814a36cbc43a831490c1c3ebe20a73fedb081e24e69fd2
6
+ metadata.gz: 9c46fcdb21224720c3df7cc4d6c12a45a0a76a40d188a5f44bceafe75e56e476407d8e60d87bee00688010aea0385ac7dcd0c846efa04823caf60ec5251658de
7
+ data.tar.gz: 1418023705add396e631737b239e4da268e3dc81d8bea01b5679520036868fb42da0f15a9f0632c9560a2d1da49aa65cbbc76e2b97d794752e0cbf5d3dfae6b2
@@ -43,7 +43,7 @@ module Nuntius
43
43
  private
44
44
 
45
45
  def layout_params
46
- params.require(:layout).permit(:name, :data, :metadata_yaml)
46
+ params.require(:layout).permit(:name, :data, :metadata_yaml, attachments: [])
47
47
  end
48
48
  end
49
49
  end
@@ -17,7 +17,23 @@
17
17
 
18
18
  - if @layout.persisted?
19
19
  - card.with_tab:media, padding: true
20
- = render partial: 'nuntius/admin/layouts/attachments/index', locals: { attachments: @layout.attachments, upload_url: nuntius.admin_layout_attachments_path(@layout) }
20
+ .grid.grid-cols-4.gap-4
21
+ .col-span-4
22
+ = f.input :attachments, as: :file, multiple: true
23
+ ul.col-span-4
24
+ - @layout.attachments.each do |attachment|
25
+ li.col-span-1
26
+ - if attachment.previewable?
27
+ = image_tag attachment.preview(resize_to_limit: [500, 500]).url, class: 'object-cover pointer-events-none'
28
+ - elsif attachment.image?
29
+ = image_tag main_app.url_for(attachment.variant(resize_to_limit: [500, 500])), class: 'object-cover pointer-events-none'
30
+ = (attachment.blob.byte_size / 1048576.0).round(2)
31
+ ' MB
32
+ = link_to admin_layout_attachment_path(@layout, attachment.id), data: { controller: 'attachment-delete', 'action': 'attachment-delete#delete' } do
33
+ i.fal.fa-xmark
34
+ =< link_to(main_app.rails_blob_path(attachment, disposition: 'attachment'),
35
+ title: attachment.filename)
36
+ i.fal.fa-download
21
37
 
22
38
  - if @layout.templates.exists?
23
39
  - card.with_tab :templates, padding: false
@@ -1,4 +1,5 @@
1
1
  en:
2
+ choose_files: Choose files
2
3
  activerecord:
3
4
  attributes:
4
5
  nuntius/campaign:
@@ -1,4 +1,5 @@
1
1
  nl:
2
+ choose_files: Kies bestanden
2
3
  activerecord:
3
4
  attributes:
4
5
  nuntius/campaign:
@@ -72,6 +73,7 @@ nl:
72
73
  edit: Edit
73
74
  media: Media
74
75
  metadata: Metadata
76
+ templates: Templates
75
77
  index:
76
78
  card:
77
79
  nuntius_admin_layouts:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.3.4"
4
+ VERSION = "1.3.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-19 00:00:00.000000000 Z
11
+ date: 2024-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apnotic
@@ -514,9 +514,6 @@ files:
514
514
  - app/validators/liquid_validator.rb
515
515
  - app/views/nuntius/admin/campaigns/edit.html.slim
516
516
  - app/views/nuntius/admin/campaigns/index.html.slim
517
- - app/views/nuntius/admin/layouts/attachments/_attachments.html.slim
518
- - app/views/nuntius/admin/layouts/attachments/_index.html.slim
519
- - app/views/nuntius/admin/layouts/attachments/create.json.jbuilder
520
517
  - app/views/nuntius/admin/layouts/edit.html.slim
521
518
  - app/views/nuntius/admin/layouts/index.html.slim
522
519
  - app/views/nuntius/admin/lists/edit.html.slim
@@ -1,28 +0,0 @@
1
- - attachments.each do |attachment|
2
- li.relative
3
- /! Current: "ring-2 ring-offset-2 ring-indigo-500", Default: "focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-gray-100 focus-within:ring-indigo-500"
4
- .group.block.w-full.aspect-w-10.aspect-h-7.rounded-lg.bg-gray-100.overflow-hidden
5
- /! Current: "", Default: "group-hover:opacity-75"
6
- - if attachment.previewable?
7
- = image_tag attachment.preview(resize_to_limit: [500, 500]).url, class: 'object-cover pointer-events-none'
8
- - elsif attachment.image?
9
- = image_tag main_app.url_for(attachment.variant(resize_to_limit: [500, 500])), class: 'object-cover pointer-events-none'
10
- p.mt-2.block.text-sm.font-medium.text-gray-900.truncate.pointer-events-none = attachment.filename
11
- p.block.text-sm.font-medium.text-gray-500
12
- = (attachment.blob.byte_size / 1048576.0).round(2)
13
- ' MB
14
- = link_to admin_layout_attachment_path(@layout, attachment.id), data: { controller: 'attachment-delete', 'action': 'attachment-delete#delete' } do
15
- i.fal.fa-xmark
16
- =< link_to(main_app.rails_blob_path(attachment, disposition: 'attachment'),
17
- title: attachment.filename)
18
- i.fal.fa-download
19
-
20
- / This controller comes from papyrus
21
- li.relative.attachment-upload data-controller="attachment-upload" data-attachment-upload-url="#{upload_url}" data-attachment-upload-param-name="attachments[]" data-attachment-upload-extra-data='{}'
22
- .group.block.w-full.aspect-w-10.aspect-h-7.rounded-lg.bg-gray-100.overflow-hidden.text-center.align-middle style="height: 200px;"
23
- span.icon.upload
24
- i.fal.fa-4x.fa-upload.pt-16
25
- span.icon.uploading
26
- i.fal.fa-4x.fa-circle-notch.fa-spin.pt-16
27
-
28
- p.mt-2.block.text-sm.font-medium.text-gray-500.truncate.pointer-events-none Drag or click to attach files
@@ -1,2 +0,0 @@
1
- ul.attachments.grid.grid-cols-2.gap-x-4.gap-y-8.sm:grid-cols-3.sm:gap-x-6.md:grid-cols-4.lg:grid-cols-3.xl:grid-cols-4.xl:gap-x-8 role="list"
2
- = render partial: 'nuntius/admin/layouts/attachments/attachments', locals: { attachments: @layout.attachments, upload_url: admin_layout_attachments_path(@layout) }
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- json.selector "ul.attachments"
4
- json.html render partial: "nuntius/admin/layouts/attachments/attachments", layout: false, formats: [:html],
5
- locals: {attachments: @layout.attachments, upload_url: admin_layout_attachments_path(@layout)}