nuntius 1.3.2 → 1.3.4

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: 36d46202837a34ff0d400afc96a903aed10b2b46ad7d6bede57498f46f784a33
4
- data.tar.gz: 1e7cb04b9662c6e1aa5e12cbee17e2ba0f5fec1c29483b802bd1bb372da67077
3
+ metadata.gz: bcf2eb3ee110dd40c68860c8b1b1351b77558b269ce1921f7f530230c63762ee
4
+ data.tar.gz: fe52688abaf148ad6481c66abfec1c22d45335224687f82087f36b5bd995daaf
5
5
  SHA512:
6
- metadata.gz: 8da8d020db852a34e22b10ef09bae1e1b4f2d99b687ce77d834f769cae723458b0ed251fe0333a8cba9f11484c845d4dc057f292f756761b5c270293203efdc9
7
- data.tar.gz: 9548dec8eb79e8d6bffd934b695a9801c5a7692359ab83708f4c2055fc6d01c9fa92c5e0e87165a0e146340a2cbfa16ed6d8aa82c6429734950bf80339894601
6
+ metadata.gz: 56d4e617138d2868119fbb18302c884e30282d309ad77bcd7cbeccf28b430aff49d5af773fcda03c388fd14dc5c3132584fb715cc62fa750148e9aea55b0ed9b
7
+ data.tar.gz: 1e91a60fad70aeaade08ae345923340ce0b6d06e2898c4a6abe933c08694d8e32ba6733d72cec63fbc814a36cbc43a831490c1c3ebe20a73fedb081e24e69fd2
@@ -0,0 +1,14 @@
1
+
2
+ span.traffic-signal {
3
+ &-red {
4
+ @apply text-red-600;
5
+ }
6
+
7
+ &-green {
8
+ @apply text-green-600;
9
+ }
10
+
11
+ &-orange {
12
+ @apply text-orange-400;
13
+ }
14
+ }
@@ -12,10 +12,7 @@
12
12
  .col-span-2= f.input :allow_unsubscribe, as: :switch
13
13
 
14
14
  .col-span-12.mt-4.mb-4
15
- h4 = t('nuntius.admin.lists.edit.description')
16
- p.mb-4 = t('nuntius.admin.lists.edit.description_hint')
17
- = f.input :description, as: :hidden
18
- trix-editor input="list_description" style="background-color: #fff; height: 400px; margin-bottom: 20px;"
15
+ = f.rich_text :description, hint: t('nuntius.admin.lists.edit.description_hint')
19
16
 
20
17
  .col-span-12
21
18
  = f.input :metadata_yaml, as: :editor, mode: 'application/yaml'
@@ -3,46 +3,26 @@
3
3
  = button_to(t('nuntius.context_menu.resend'), resend_admin_message_path(@message), class: 'button')
4
4
 
5
5
  - card.with_tab:preview, padding: true
6
-
7
- table.table
8
- thead
9
- tr
10
- th Name
11
- th Value
12
- tbody
13
- tr
14
- td To
15
- td = @message.to
16
-
17
- - if @message.transport == 'mail'
18
- tr
19
- td Subject
20
- td = @message.subject
21
- tr
22
- td Attachments
23
- td
24
- - @message.attachments.each do |attachment|
25
- = link_to(main_app.rails_blob_path(attachment, disposition: "attachment"), title: attachment.filename) do
26
- i.far.fa-paperclip
27
- span=attachment.filename
28
- br
29
-
30
- - if @message.transport == 'sms'
31
- tr
32
- td Text
33
- td = @message.text
34
-
35
- - if @message.transport == 'slack'
36
- tr
37
- td Text
38
- td = @message.text
39
- tr
40
- td Payload
41
- td
42
- pre = YAML.dump(@message.payload)
43
-
44
- - if @message.transport == 'mail' && @message.html.present?
45
- iframe.border.rounded-lg.border-gray-200 src=message_path(@message.id) style="width: 100%; height: 600px; border: 0px;"
6
+ = sts.info class: "grid grid-cols-1 gap-4 sm:grid-cols-3" do |info|
7
+ = info.with_item :to, content: @message.to, class: "sm:col-span-1"
8
+ = info.with_item :from, content: @message.from, class: "sm:col-span-1"
9
+ - if @message.transport == 'mail'
10
+ = info.with_item :subject, content: @message.subject, class: "sm:col-span-4"
11
+ = info.with_item :attachments, class: "sm:col-span-4"
12
+ - @message.attachments.each do |attachment|
13
+ = link_to(main_app.rails_blob_path(attachment, disposition: "attachment"), title: attachment.filename) do
14
+ i.far.fa-paperclip
15
+ span=attachment.filename
16
+ br
17
+ - if @message.transport == 'sms'
18
+ = info.with_item :text, content: @message.text, class: "sm:col-span-4"
19
+ - if @message.transport == 'slack'
20
+ = info.with_item :text, content: @message.text, class: "sm:col-span-4"
21
+ = info.with_item :payload, content: @message.text, class: "sm:col-span-4"
22
+ pre = YAML.dump(@message.payload)
23
+ - if @message.transport == 'mail' && @message.html.present?
24
+ = info.with_item :html, class: "sm:col-span-4"
25
+ iframe.border.rounded-lg.border-gray-200 src=message_path(@message.id) style="width: 100%; height: 600px; border: 0px;"
46
26
 
47
27
  - card.with_tab:details, padding: true
48
28
  = sts.info class: "grid grid-cols-1 gap-4 sm:grid-cols-3" do |info|
@@ -1,133 +1,164 @@
1
1
  en:
2
+ activerecord:
3
+ attributes:
4
+ nuntius/campaign:
5
+ from: From
6
+ layout: Layout
7
+ list: List
8
+ name: Name
9
+ state: Staat
10
+ subject: Subject
11
+ transport: Transport
12
+ nuntius/layout:
13
+ name: Name
14
+ nuntius/list:
15
+ allow_unsubscribe: unsubscribe allowed
16
+ description: Description
17
+ name: Name
18
+ slug: Slug
19
+ subscribers_count: Subscriber count
20
+ nuntius/template:
21
+ description: Description
22
+ enabled: Enabled
23
+ event: Event
24
+ from: From
25
+ klass: Klass
26
+ subject: Subject
27
+ to: To
28
+ transport: Transport
29
+ models:
30
+ campaign: Campaign
31
+ layout: Layout
32
+ list: List
33
+ message: Message
34
+ subscriber: Subscriber
35
+ template: Template
2
36
  menu:
3
37
  nuntius:
4
- templates:
5
- new: New template
6
- layouts:
7
- new: New layout
8
- locales:
9
- new: New locale
10
38
  campaigns:
11
- new: New campaign
12
39
  lists: Lists
40
+ new: New campaign
41
+ layouts:
42
+ new: New layout
13
43
  lists:
14
44
  new: New list
15
45
  new_subscriber: New subscriber
46
+ locales:
47
+ new: New locale
48
+ templates:
49
+ new: New template
16
50
  nuntius:
17
- flash:
18
- error: There were problems saving the %{model}
19
- notice: The %{model} was saved successfully
20
- context_menu:
21
- root: Root
22
- resend: Resend
23
51
  admin:
24
- messages:
25
- resend:
26
- resend_success: Resent message
27
- resend_error: Failed to resend message
28
- index:
29
- card:
30
- nuntius_admin_messages:
31
- title: Messages
32
- tab:
33
- Nuntius messages: Messages
34
- show:
35
- message: Message
52
+ campaigns:
53
+ edit:
36
54
  card:
37
- nuntius_admin_messages:
38
- tab:
39
- preview: Preview
40
- details: Details
41
- info_item:
42
- main:
43
- status: Status
44
- transport: Transport
45
- provider: Provider
46
- provider_id: Provider ID
47
- request_id: Request ID
48
- refreshes: Refreshes
49
- last_sent_at: Last Sent At
50
- created_at: Created At
51
- templates:
55
+ nuntius_admin_campaigns:
56
+ title: Campaigns
52
57
  index:
53
58
  card:
54
- nuntius_admin_templates:
55
- title: Templates
59
+ nuntius_admin_campaigns:
56
60
  tab:
57
- Nuntius templates: Templates
61
+ Nuntius campaigns: Campaigns
62
+ title: Campaigns
63
+ layouts:
58
64
  edit:
59
65
  card:
60
- nuntius_admin_templates:
61
- title: Template
66
+ nuntius_admin_layouts:
67
+ title: Layouts
68
+ metadata: Metadata
69
+ tabs:
70
+ main:
62
71
  tab:
63
72
  edit: Edit
64
- messages: Messages
65
- metadata: Metadata
66
- layouts:
73
+ media: Media
74
+ metadata: Metadata
67
75
  index:
68
76
  card:
69
77
  nuntius_admin_layouts:
70
- title: Layouts
71
78
  tab:
72
79
  Nuntius layouts: Layouts
80
+ title: Layouts
81
+ lists:
73
82
  edit:
74
83
  card:
75
- nuntius_admin_layouts:
76
- title: Layouts
84
+ nuntius_admin_lists:
85
+ title: Lists
86
+ description_hint: Describe the list in detail for the subscribers, explain if they can unsubscribe, how often they will receive messages, etc.
87
+ tabs:
88
+ main:
77
89
  tab:
78
90
  edit: Edit
79
- metadata: Metadata
80
- media: Media
81
- metadata: Metadata
82
- locales:
91
+ subscribers: Abonnees
83
92
  index:
84
93
  card:
85
- nuntius_admin_locales:
86
- title: Locales
87
- tab:
88
- Nuntius locales: Locales
94
+ nuntius_admin_lists:
95
+ title: Lists
96
+ subscribers:
97
+ edit:
98
+ subscribers: Subscribers
99
+ locales:
89
100
  edit:
90
101
  card:
91
102
  nuntius_admin_locales:
92
103
  title: Locales
93
104
  data: Data
94
105
  metadata: Metadata
95
- campaigns:
96
106
  index:
97
107
  card:
98
- nuntius_admin_campaigns:
99
- title: Campaigns
108
+ nuntius_admin_locales:
100
109
  tab:
101
- Nuntius campaigns: Campaigns
102
- edit:
103
- card:
104
- nuntius_admin_campaigns:
105
- title: Campaigns
106
- lists:
107
- subscribers:
108
- edit:
109
- subscribers: Subscribers
110
+ Nuntius locales: Locales
111
+ title: Locales
112
+ messages:
110
113
  index:
111
114
  card:
112
- nuntius_admin_lists:
113
- title: Lists
115
+ nuntius_admin_messages:
116
+ tab:
117
+ Nuntius messages: Messages
118
+ title: Messages
119
+ resend:
120
+ resend_error: Failed to resend message
121
+ resend_success: Resent message
122
+ show:
123
+ card:
124
+ nuntius_admin_messages:
125
+ info_item:
126
+ main:
127
+ created_at: Created At
128
+ from: From
129
+ html: HTML
130
+ last_sent_at: Last Sent At
131
+ provider: Provider
132
+ provider_id: Provider ID
133
+ refreshes: Refreshes
134
+ request_id: Request ID
135
+ status: Status
136
+ subject: Subject
137
+ to: To
138
+ transport: Transport
139
+ message:
140
+ tabs:
141
+ main:
114
142
  tab:
115
- Nuntius lists: Lists
143
+ details: Details
144
+ preview: Preview
145
+ templates:
116
146
  edit:
117
- description: List description
118
- description_hint: Describe the list in detail for the subscribers, explain if they can unsubscribe, how often they will receive messages, etc.
119
147
  card:
120
- nuntius_admin_lists:
121
- title: Lists
148
+ nuntius_admin_templates:
149
+ title: Template
150
+ metadata: Metadata
151
+ tabs:
152
+ main:
122
153
  tab:
123
154
  edit: Edit
124
- nuntius_subscribers: Subscribers
125
- breadcrumbs:
126
- nuntius: Nuntius
127
- dashboard: Dashboard
128
- admin:
129
- campaigns: Campaigns
130
- messages: Messages
131
- layouts: Layouts
132
- lists: Lists
133
- templates: Templates
155
+ messages: Messages
156
+ index:
157
+ card:
158
+ nuntius_admin_templates:
159
+ tab:
160
+ Nuntius templates: Templates
161
+ title: Templates
162
+ context_menu:
163
+ resend: Resend
164
+ root: Root
@@ -1,133 +1,164 @@
1
1
  nl:
2
+ activerecord:
3
+ attributes:
4
+ nuntius/campaign:
5
+ from: Van
6
+ layout: Layout
7
+ list: Lijst
8
+ name: Naam
9
+ state: Staat
10
+ subject: Onderwerp
11
+ transport: Transport
12
+ nuntius/layout:
13
+ name: Naam
14
+ nuntius/list:
15
+ allow_unsubscribe: Uitschrijven toestaan
16
+ description: Omschrijving
17
+ name: Naam
18
+ slug: Slug
19
+ subscribers_count: Aantal abonnees
20
+ nuntius/template:
21
+ description: Omschrijving
22
+ enabled: Ingeschakeld
23
+ event: Gebeurtenis
24
+ from: Van
25
+ klass: Klasse
26
+ subject: Onderwerp
27
+ to: Aan
28
+ transport: Transport
29
+ models:
30
+ campaign: Campagne
31
+ layout: Layout
32
+ list: Lijst
33
+ message: Bericht
34
+ subscriber: Abonnee
35
+ template: Template
2
36
  menu:
3
37
  nuntius:
4
- templates:
5
- new: Nieuwe template
6
- layouts:
7
- new: Nieuwe layout
8
- locales:
9
- new: Nieuwe locale
10
38
  campaigns:
11
- new: Nieuwe campagne
12
39
  lists: Lijsten
40
+ new: Nieuwe campagne
41
+ layouts:
42
+ new: Nieuwe layout
13
43
  lists:
14
44
  new: Nieuwe lijst
15
45
  new_subscriber: Nieuwe abonnee
46
+ locales:
47
+ new: Nieuwe locale
48
+ templates:
49
+ new: Nieuwe template
16
50
  nuntius:
17
- flash:
18
- error: Er waren problem om %{model} op te slaan
19
- notice: De %{model} is sucesvol opgeslagen
20
- context_menu:
21
- root: Root
22
- resend: Verstuur opnieuw
23
51
  admin:
24
- messages:
25
- resend:
26
- resend_success: Bericht opnieuw verstuurd
27
- resend_error: Het is niet gelukt het bericht opnieuw te sturen
28
- index:
29
- card:
30
- nuntius_admin_messages:
31
- title: Berichten
32
- tab:
33
- Nuntius messages: Berichten
34
- show:
35
- message: Message
52
+ campaigns:
53
+ edit:
36
54
  card:
37
- nuntius_admin_messages:
38
- tabs:
39
- main:
40
- tab:
41
- preview: Preview
42
- details: Details
43
- info_item:
44
- main:
45
- status: Status
46
- transport: Transport
47
- provider: Provider
48
- provider_id: Provider ID
49
- request_id: Request ID
50
- refreshes: Refreshes
51
- last_sent_at: Last Sent At
52
- created_at: Created At
53
- templates:
55
+ nuntius_admin_campaigns:
56
+ title: Campagne
54
57
  index:
55
58
  card:
56
- nuntius_admin_templates:
57
- title: Templates
59
+ nuntius_admin_campaigns:
58
60
  tab:
59
- Nuntius templates: Templates
61
+ Nuntius campaigns: Campagnes
62
+ title: Campagnes
63
+ layouts:
60
64
  edit:
61
65
  card:
62
- nuntius_admin_templates:
63
- title: Template
66
+ nuntius_admin_layouts:
67
+ title: Layouts
68
+ metadata: Metadata
64
69
  tabs:
65
70
  main:
66
71
  tab:
67
- edit: Bewerk
68
- messages: Berichten
69
- metadata: Metadata
70
- layouts:
72
+ edit: Edit
73
+ media: Media
74
+ metadata: Metadata
71
75
  index:
72
76
  card:
73
77
  nuntius_admin_layouts:
74
- title: Layouts
75
78
  tab:
76
79
  Nuntius layouts: Layouts
80
+ title: Layouts
81
+ lists:
77
82
  edit:
78
83
  card:
79
- nuntius_admin_layouts:
80
- title: Layouts
84
+ nuntius_admin_lists:
85
+ title: Lijsten
86
+ description_hint: Omschrijf de list in detail voor abonnees, leg uit of ze kunnen uitschrijven, hoe veel en hoe vaak berichten ze berichten ontvangen, etc.
81
87
  tabs:
82
88
  main:
83
89
  tab:
84
90
  edit: Edit
85
- metadata: Metadata
86
- media: Media
87
-
88
- metadata: Metadata
89
- locales:
91
+ subscribers: Abonnees
90
92
  index:
91
93
  card:
92
- nuntius_admin_locales:
93
- title: Locales
94
- tab:
95
- Nuntius locales: Locales
94
+ nuntius_admin_lists:
95
+ title: Lijsten
96
+ subscribers:
97
+ edit:
98
+ subscribers: Abonnees
99
+ locales:
96
100
  edit:
97
101
  card:
98
102
  nuntius_admin_locales:
99
103
  title: Locales
100
104
  data: Data
101
105
  metadata: Metadata
102
- campaigns:
103
106
  index:
104
107
  card:
105
- nuntius_admin_campaigns:
106
- title: Campaigns
108
+ nuntius_admin_locales:
107
109
  tab:
108
- Nuntius campaigns: Campaigns
109
- edit:
110
- card:
111
- nuntius_admin_campaigns:
112
- title: Campaigns
113
- lists:
114
- subscribers:
115
- edit:
116
- subscribers: Subscribers
110
+ Nuntius locales: Locales
111
+ title: Locales
112
+ messages:
117
113
  index:
118
114
  card:
119
- nuntius_admin_lists:
120
- title: Lists
115
+ nuntius_admin_messages:
121
116
  tab:
122
- Nuntius lists: Lists
117
+ Nuntius messages: Berichten
118
+ title: Berichten
119
+ resend:
120
+ resend_error: Het is niet gelukt het bericht opnieuw te sturen
121
+ resend_success: Bericht opnieuw verstuurd
122
+ show:
123
+ card:
124
+ nuntius_admin_messages:
125
+ info_item:
126
+ main:
127
+ created_at: Created At
128
+ from: Van
129
+ html: HTML
130
+ last_sent_at: Last Sent At
131
+ provider: Provider
132
+ provider_id: Provider ID
133
+ refreshes: Refreshes
134
+ request_id: Request ID
135
+ status: Status
136
+ subject: Onderwerp
137
+ to: Aan
138
+ transport: Transport
139
+ message: Message
140
+ tabs:
141
+ main:
142
+ tab:
143
+ details: Details
144
+ preview: Preview
145
+ templates:
123
146
  edit:
124
- description: List description
125
- description_hint: Describe the list in detail for the subscibers, explain if they can unsubscribe, how often they will receive messages, etc.
126
147
  card:
127
- nuntius_admin_lists:
128
- title: Lists
148
+ nuntius_admin_templates:
149
+ title: Template
150
+ metadata: Metadata
129
151
  tabs:
130
152
  main:
131
153
  tab:
132
- edit: Edit
133
- nuntius_subscribers: Subscribers
154
+ edit: Bewerk
155
+ messages: Berichten
156
+ index:
157
+ card:
158
+ nuntius_admin_templates:
159
+ tab:
160
+ Nuntius templates: Templates
161
+ title: Templates
162
+ context_menu:
163
+ resend: Verstuur opnieuw
164
+ root: Root
@@ -7,16 +7,18 @@ module Nuntius
7
7
  included do
8
8
  raise "#{name} must be nuntiable" unless nuntiable?
9
9
 
10
- after_commit do
11
- if previously_persisted?
12
- Nuntius.event(:destroy, self)
13
- elsif previously_new_record?
14
- Nuntius.event(:create, self)
15
- Nuntius.event(:save, self)
16
- else
17
- Nuntius.event(:update, self)
18
- Nuntius.event(:save, self)
19
- end
10
+ after_create_commit do
11
+ Nuntius.event(:create, self)
12
+ Nuntius.event(:save, self)
13
+ end
14
+
15
+ after_update_commit do
16
+ Nuntius.event(:update, self)
17
+ Nuntius.event(:save, self)
18
+ end
19
+
20
+ after_destroy_commit do
21
+ Nuntius.event(:destroy, self)
20
22
  end
21
23
 
22
24
  %i[create destroy update save].each do |event_name|
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
-
5
4
  module StateMachine
6
5
  extend ActiveSupport::Concern
7
6
 
@@ -9,17 +8,17 @@ module Nuntius
9
8
  raise "#{name} must be nuntiable" unless nuntiable?
10
9
 
11
10
  state_machine.events.map(&:name)
12
- .reject { |event_name| messenger.method_defined?(event_name) }
13
- .each do |event_name|
11
+ .reject { |event_name| messenger.method_defined?(event_name) }
12
+ .each do |event_name|
14
13
  messenger.send(:define_method, event_name) { |object, options = {}| }
15
14
  end
16
15
 
17
16
  after_commit do
18
- Thread.current['___nuntius_state_machine_events']&.each do |event|
17
+ Thread.current["___nuntius_state_machine_events"]&.each do |event|
19
18
  Nuntius.event(event[:event], event[:object])
20
19
  end
21
20
  # After events are fired we can clear the events
22
- Thread.current['___nuntius_state_machine_events'] = []
21
+ Thread.current["___nuntius_state_machine_events"] = []
23
22
  end
24
23
 
25
24
  state_machine do
@@ -32,8 +31,8 @@ module Nuntius
32
31
  end
33
32
 
34
33
  def ___record__nuntius_state_machine_event(event, object)
35
- Thread.current['___nuntius_state_machine_events'] ||= []
36
- Thread.current['___nuntius_state_machine_events'] << { event: event, object: object }
34
+ Thread.current["___nuntius_state_machine_events"] ||= []
35
+ Thread.current["___nuntius_state_machine_events"] << {event: event, object: object}
37
36
  end
38
37
  end
39
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.3.2"
4
+ VERSION = "1.3.4"
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.2
4
+ version: 1.3.4
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-17 00:00:00.000000000 Z
11
+ date: 2024-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apnotic