nuntius 1.3.4 → 1.3.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcf2eb3ee110dd40c68860c8b1b1351b77558b269ce1921f7f530230c63762ee
4
- data.tar.gz: fe52688abaf148ad6481c66abfec1c22d45335224687f82087f36b5bd995daaf
3
+ metadata.gz: 11b30e0625c1b47a70a22803a0bdec45d92faf881b1e83ae72e00582d95b36f4
4
+ data.tar.gz: ec9251af770d4b3cd4ae58b75968bddc4e4917dc1ba01d8073eb73df56c9fe4e
5
5
  SHA512:
6
- metadata.gz: 56d4e617138d2868119fbb18302c884e30282d309ad77bcd7cbeccf28b430aff49d5af773fcda03c388fd14dc5c3132584fb715cc62fa750148e9aea55b0ed9b
7
- data.tar.gz: 1e91a60fad70aeaade08ae345923340ce0b6d06e2898c4a6abe933c08694d8e32ba6733d72cec63fbc814a36cbc43a831490c1c3ebe20a73fedb081e24e69fd2
6
+ metadata.gz: a8dd4831dcbb7c4e8440e4a1ebf281a712959de7a47323e2590a24d71bf039c5a7c7b5899e3427832949a061f1bed2ac72b3f70acdc86b534aafe16f7d364689
7
+ data.tar.gz: 1c5e6ad9964622533dad4c91df0ff7bcdf05299bbaddcdf81efcfee6eeea02f9b50bc7ad662b174e8433e422d040dda57b8e9f627fd2c8360cc27575653735c8
@@ -43,7 +43,9 @@ module Nuntius
43
43
  private
44
44
 
45
45
  def layout_params
46
- params.require(:layout).permit(:name, :data, :metadata_yaml)
46
+ permitted = %i[name data metadata_yaml]
47
+ permitted += [attachments: []] if params[:layout][:attachments].compact_blank.present?
48
+ params.require(:layout).permit(permitted)
47
49
  end
48
50
  end
49
51
  end
@@ -1,6 +1,8 @@
1
1
  - if @campaign.draft?
2
2
  = sts.form_for [:admin, @campaign] do |f|
3
3
  = sts.card :nuntius_admin_campaigns, icon: 'fal fa-megaphone' do |card|
4
+ - card.with_action
5
+ = f.continue
4
6
  - card.with_action
5
7
  = f.submit
6
8
 
@@ -1,5 +1,7 @@
1
1
  = sts.form_for([:admin, @layout]) do |f|
2
2
  = sts.card :nuntius_admin_layouts, icon: 'fal fa-table-layout' do |card|
3
+ - card.with_action
4
+ = f.continue
3
5
  - card.with_action
4
6
  = f.submit
5
7
 
@@ -17,7 +19,23 @@
17
19
 
18
20
  - if @layout.persisted?
19
21
  - 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) }
22
+ .grid.grid-cols-4.gap-4
23
+ .col-span-4
24
+ = f.input :attachments, as: :file, multiple: true
25
+ ul.col-span-4
26
+ - @layout.attachments.each do |attachment|
27
+ li.col-span-1
28
+ - if attachment.previewable?
29
+ = image_tag attachment.preview(resize_to_limit: [500, 500]).url, class: 'object-cover pointer-events-none'
30
+ - elsif attachment.image?
31
+ = image_tag main_app.url_for(attachment.variant(resize_to_limit: [500, 500])), class: 'object-cover pointer-events-none'
32
+ = (attachment.blob.byte_size / 1048576.0).round(2)
33
+ ' MB
34
+ = link_to admin_layout_attachment_path(@layout, attachment.id), data: { controller: 'attachment-delete', 'action': 'attachment-delete#delete' } do
35
+ i.fal.fa-xmark
36
+ =< link_to(main_app.rails_blob_path(attachment, disposition: 'attachment'),
37
+ title: attachment.filename)
38
+ i.fal.fa-download
21
39
 
22
40
  - if @layout.templates.exists?
23
41
  - card.with_tab :templates, padding: false
@@ -55,16 +55,16 @@
55
55
  .col-span-12
56
56
  = f.association :layout, collection: @layouts, include_blank: true
57
57
  .col-span-12
58
- = f.input :html, as: :editor, mode: 'text/markdown'
58
+ = f.input :html, as: :editor, mode: 'text/markdown', height: '400px'
59
59
 
60
60
  template data-toggle-target='toggleable' data-toggle-value='voice'
61
61
  .col-span-12
62
- = f.input :text, as: :editor, mode: 'text/plain'
62
+ = f.input :text, as: :editor, mode: 'text/plain', height: '400px'
63
63
  template data-toggle-target='toggleable' data-toggle-value='slack'
64
64
  .col-span-12
65
- = f.input :text, as: :editor, mode: 'text/plain'
65
+ = f.input :text, as: :editor, mode: 'text/plain', height: '400px'
66
66
  .col-span-12
67
- = f.input :payload, as: :editor, mode: 'application/yaml', hint: 'See here for more information: https://app.slack.com/block-kit-builder/'
67
+ = f.input :payload, as: :editor, mode: 'application/yaml', hint: 'See here for more information: https://app.slack.com/block-kit-builder/', height: '400px'
68
68
 
69
69
  template data-toggle-target='toggleable' data-toggle-value='sms'
70
70
  .col-span-12
@@ -72,7 +72,11 @@
72
72
  template data-toggle-target='toggleable' data-toggle-value='push'
73
73
  .col-span-12
74
74
  = f.input :text, as: :editor, mode: 'text/plain'
75
- template data-toggle-target='toggleable' data-toggle-value='slack'
75
+ template data-toggle-target='toggleable' data-toggle-value='teams'
76
+ .col-span-12
77
+ = f.input :text, as: :editor, mode: 'text/plain', height: '400px'
78
+ .col-span-12
79
+ = f.input :payload, as: :editor, mode: 'application/yaml', hint: 'See here for more information: https://www.adaptivecards.io/designer/', height: '400px'
76
80
 
77
81
 
78
82
  - if @template.messages.exists?
@@ -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.6"
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.6
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-27 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)}