nuntius 1.0.27 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +77 -18
- data/Rakefile +16 -39
- data/app/controllers/nuntius/admin/campaigns_controller.rb +12 -10
- data/app/controllers/nuntius/admin/layouts/attachments_controller.rb +2 -1
- data/app/controllers/nuntius/admin/layouts_controller.rb +1 -1
- data/app/controllers/nuntius/admin/lists/subscribers_controller.rb +1 -1
- data/app/controllers/nuntius/admin/lists_controller.rb +4 -4
- data/app/controllers/nuntius/admin/locales_controller.rb +3 -2
- data/app/controllers/nuntius/admin/messages_controller.rb +2 -2
- data/app/controllers/nuntius/admin/templates_controller.rb +1 -1
- data/app/controllers/nuntius/api/events_controller.rb +2 -2
- data/app/controllers/nuntius/application_admin_controller.rb +1 -1
- data/app/controllers/nuntius/callbacks_controller.rb +4 -4
- data/app/controllers/nuntius/dashboard_controller.rb +1 -1
- data/app/controllers/nuntius/feedback_controller.rb +1 -2
- data/app/controllers/nuntius/inbound_messages/twilio_inbound_smses_controller.rb +7 -7
- data/app/controllers/nuntius/messages_controller.rb +1 -1
- data/app/controllers/nuntius/subscribers_controller.rb +33 -0
- data/app/drops/nuntius/list_drop.rb +7 -0
- data/app/drops/nuntius/subscriber_drop.rb +7 -0
- data/app/exceptions/nuntius/base_exception.rb +2 -0
- data/app/exceptions/nuntius/missing_messenger_exception.rb +2 -0
- data/app/helpers/nuntius/application_helper.rb +6 -11
- data/app/jobs/nuntius/deliver_inbound_message_job.rb +1 -1
- data/app/jobs/nuntius/purge_message_job.rb +2 -2
- data/app/jobs/nuntius/retrieve_mail_job.rb +2 -2
- data/app/jobs/nuntius/transport_delivery_job.rb +2 -2
- data/app/message_boxes/nuntius/base_message_box.rb +46 -23
- data/app/messengers/nuntius/base_messenger.rb +13 -12
- data/app/models/nuntius/application_record.rb +1 -1
- data/app/models/nuntius/attachment.rb +4 -2
- data/app/models/nuntius/campaign.rb +4 -51
- data/app/models/nuntius/concerns/yamlify.rb +2 -2
- data/app/models/nuntius/inbound_message.rb +2 -0
- data/app/models/nuntius/list.rb +11 -1
- data/app/models/nuntius/message.rb +34 -29
- data/app/models/nuntius/subscriber.rb +21 -1
- data/app/models/nuntius/template.rb +20 -20
- data/app/presenters/application_presenter.rb +1 -1
- data/app/presenters/template_presenter.rb +3 -3
- data/app/providers/nuntius/apnotic_push_provider.rb +17 -17
- data/app/providers/nuntius/base_provider.rb +6 -6
- data/app/providers/nuntius/firebase_push_provider.rb +8 -8
- data/app/providers/nuntius/houston_push_provider.rb +15 -15
- data/app/providers/nuntius/message_bird_sms_provider.rb +7 -7
- data/app/providers/nuntius/slack_slack_provider.rb +7 -7
- data/app/providers/nuntius/smtp_mail_provider.rb +36 -28
- data/app/providers/nuntius/teams_teams_provider.rb +24 -0
- data/app/providers/nuntius/twilio_sms_provider.rb +4 -4
- data/app/providers/nuntius/twilio_voice_provider.rb +13 -13
- data/app/services/nuntius/aws_sns_processor_service.rb +11 -11
- data/app/services/nuntius/deliver_campaign_service.rb +65 -0
- data/app/services/nuntius/deliver_inbound_message_service.rb +3 -2
- data/app/services/nuntius/retrieve_inbound_mail_service.rb +23 -16
- data/app/tables/nuntius_campaigns_table.rb +10 -1
- data/app/tables/nuntius_layouts_table.rb +4 -4
- data/app/tables/nuntius_lists_table.rb +1 -1
- data/app/tables/nuntius_locales_table.rb +1 -1
- data/app/tables/nuntius_messages_table.rb +5 -5
- data/app/tables/nuntius_subscribers_table.rb +3 -2
- data/app/tables/nuntius_templates_table.rb +12 -5
- data/app/transports/nuntius/base_transport.rb +1 -1
- data/app/transports/nuntius/mail_transport.rb +1 -1
- data/app/transports/nuntius/push_transport.rb +1 -1
- data/app/transports/nuntius/teams_transport.rb +6 -0
- data/app/views/nuntius/admin/campaigns/edit.html.slim +12 -16
- data/app/views/nuntius/admin/campaigns/index.html.slim +2 -2
- data/app/views/nuntius/admin/layouts/attachments/create.json.jbuilder +3 -3
- data/app/views/nuntius/admin/layouts/edit.html.slim +18 -19
- data/app/views/nuntius/admin/layouts/index.html.slim +2 -2
- data/app/views/nuntius/admin/lists/edit.html.slim +19 -9
- data/app/views/nuntius/admin/lists/index.html.slim +2 -2
- data/app/views/nuntius/admin/lists/subscribers/edit.html.slim +2 -2
- data/app/views/nuntius/admin/locales/edit.html.slim +3 -3
- data/app/views/nuntius/admin/locales/index.html.slim +2 -2
- data/app/views/nuntius/admin/messages/index.html.slim +2 -2
- data/app/views/nuntius/admin/messages/show.html.slim +12 -12
- data/app/views/nuntius/admin/templates/edit.html.slim +62 -64
- data/app/views/nuntius/admin/templates/index.html.slim +2 -2
- data/app/views/nuntius/dashboard/show.html.slim +2 -6
- data/app/views/nuntius/subscribers/show.html.slim +9 -0
- data/config/locales/en.yml +97 -1
- data/config/routes.rb +18 -8
- data/db/migrate/20190301201541_create_nuntius_templates.rb +5 -5
- data/db/migrate/20190301202436_create_nuntius_messages.rb +4 -4
- data/db/migrate/20190322114340_create_nuntius_campaigns.rb +2 -2
- data/db/migrate/20190322121338_create_nuntius_subscribers.rb +1 -1
- data/db/migrate/20190327124407_create_nuntius_layouts.rb +5 -5
- data/db/migrate/20190327143921_add_campaign_to_message.rb +1 -1
- data/db/migrate/20190417125153_change_message_status_default.rb +2 -2
- data/db/migrate/20190825080757_update_nuntius_message_sending_to_sent.rb +2 -2
- data/db/migrate/20200220154927_change_nuntius_templates_payload_type.rb +1 -1
- data/db/migrate/20200318095339_create_nuntius_attachments.rb +2 -2
- data/db/migrate/20201121185718_create_nuntius_inbound_messages.rb +1 -1
- data/db/migrate/20240205204719_add_description_to_list.rb +5 -0
- data/db/migrate/20240206203019_add_slug_to_nuntius_list.rb +9 -0
- data/lib/nuntius/active_record_helpers.rb +4 -4
- data/lib/nuntius/configuration.rb +64 -27
- data/lib/nuntius/deprecator.rb +2 -0
- data/lib/nuntius/devise.rb +1 -1
- data/lib/nuntius/engine.rb +13 -27
- data/lib/nuntius/i18n_store.rb +6 -5
- data/lib/nuntius/liquid/tags/attach_tag.rb +11 -11
- data/lib/nuntius/mail_allow_list.rb +2 -2
- data/lib/nuntius/nuntiable.rb +3 -1
- data/lib/nuntius/transactio.rb +1 -1
- data/lib/nuntius/version.rb +1 -1
- data/lib/nuntius.rb +13 -27
- data/lib/preamble.rb +18 -18
- data/lib/tasks/nuntius_tasks.rake +4 -4
- metadata +48 -33
- data/app/jobs/nuntius/process_inbound_message_job.rb +0 -10
- data/app/reportlets/nuntius/application_reportlet.rb +0 -35
- data/app/reportlets/nuntius/daily_messages_per_template_reportlet.rb +0 -50
- data/config/webpack/development.js +0 -5
- data/config/webpack/environment.js +0 -4
- data/config/webpack/production.js +0 -5
- data/config/webpack/test.js +0 -5
- data/config/webpacker.yml +0 -119
@@ -3,12 +3,12 @@
|
|
3
3
|
class NuntiusLayoutsTable < ActionTable::ActionTable
|
4
4
|
model Nuntius::Layout
|
5
5
|
|
6
|
-
column(:name)
|
6
|
+
column(:name)
|
7
7
|
column(:metadata) { |layout| Nuntius.config.metadata_humanize(layout.metadata) }
|
8
8
|
|
9
|
-
column :actions, title:
|
10
|
-
content_tag(:span, class:
|
11
|
-
concat link_to(content_tag(:i, nil, class:
|
9
|
+
column :actions, title: "", sortable: false do |layout|
|
10
|
+
content_tag(:span, class: "btn-group btn-group-xs") do
|
11
|
+
concat link_to(content_tag(:i, nil, class: "fa fa-trash"), nuntius.admin_layout_url(layout), data: {turbo_confirm: "Are you sure you want to delete the layout?", turbo_method: :delete}, class: "btn btn-xs btn-danger")
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -5,7 +5,7 @@ class NuntiusListsTable < ActionTable::ActionTable
|
|
5
5
|
|
6
6
|
column(:name)
|
7
7
|
column(:metadata) { |list| Nuntius.config.metadata_humanize(list.metadata) }
|
8
|
-
column(:subscribers) { |list| list.subscribers.count ||
|
8
|
+
column(:subscribers, sort_field: "subscribers_count") { |list| list.subscribers.count || "-" }
|
9
9
|
|
10
10
|
initial_order :name, :asc
|
11
11
|
|
@@ -6,7 +6,7 @@ class NuntiusLocalesTable < ActionTable::ActionTable
|
|
6
6
|
column(:key)
|
7
7
|
column(:metadata) { |locale| Nuntius.config.metadata_humanize(locale.metadata) }
|
8
8
|
|
9
|
-
initial_order :
|
9
|
+
initial_order :key
|
10
10
|
|
11
11
|
row_link { |locale| nuntius.edit_admin_locale_path(locale) }
|
12
12
|
|
@@ -4,9 +4,9 @@ class NuntiusMessagesTable < ActionTable::ActionTable
|
|
4
4
|
model Nuntius::Message
|
5
5
|
|
6
6
|
column(:to)
|
7
|
-
column(:created_at
|
8
|
-
column(:last_sent_at
|
9
|
-
column(:origin) do |message|
|
7
|
+
column(:created_at, html_value: proc { |message| ln(message.created_at) })
|
8
|
+
column(:last_sent_at, html_value: proc { |message| ln(message.last_sent_at) })
|
9
|
+
column(:origin, sort_field: "nuntius_messages.campaign_id, nuntius_messages.template_id") do |message|
|
10
10
|
link_to message.campaign&.name, nuntius.edit_admin_campaign_path(message.campaign) if message.campaign
|
11
11
|
link_to message.template&.description, nuntius.edit_admin_template_path(message.template) if message.template
|
12
12
|
end
|
@@ -14,8 +14,8 @@ class NuntiusMessagesTable < ActionTable::ActionTable
|
|
14
14
|
if message.nuntiable
|
15
15
|
link_to "#{message.nuntiable_type} [#{message.nuntiable}]", begin
|
16
16
|
url_for(message.nuntiable)
|
17
|
-
rescue
|
18
|
-
|
17
|
+
rescue
|
18
|
+
"#"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -3,13 +3,14 @@
|
|
3
3
|
class NuntiusSubscribersTable < ActionTable::ActionTable
|
4
4
|
model Nuntius::Subscriber
|
5
5
|
|
6
|
-
column(:name, sortable: false)
|
6
|
+
column(:name, sortable: false)
|
7
7
|
column(:email)
|
8
8
|
column(:phonenumber)
|
9
|
+
column(:unsubscribed_at) { |subscriber| ln(subscriber.unsubscribed_at) }
|
9
10
|
|
10
11
|
initial_order :name, :asc
|
11
12
|
|
12
|
-
row_link { |subscriber| nuntius.edit_admin_list_subscriber_path(
|
13
|
+
row_link { |subscriber| nuntius.edit_admin_list_subscriber_path(subscriber, list_id: subscriber.list) }
|
13
14
|
|
14
15
|
private
|
15
16
|
|
@@ -7,14 +7,20 @@ class NuntiusTemplatesTable < ActionTable::ActionTable
|
|
7
7
|
column(:enabled, as: :boolean)
|
8
8
|
column(:klass)
|
9
9
|
column(:event)
|
10
|
-
column(:
|
10
|
+
column(:messages, sort_field: "message_count") { |template| link_to template.messages.count, nuntius.admin_messages_path(template_id: template.id) }
|
11
11
|
|
12
12
|
column(:metadata) { |template| Nuntius.config.metadata_humanize(template.metadata) }
|
13
|
-
column(:created_at
|
13
|
+
column(:created_at, html_value: proc { |flow| ln(flow.created_at) })
|
14
14
|
|
15
|
-
column
|
16
|
-
|
17
|
-
|
15
|
+
column(:traffic_light, sortable: false) do |template|
|
16
|
+
color = Nuntius.config.flow_color(template.id).light_color || "green"
|
17
|
+
|
18
|
+
"<span class='traffic-signal-#{color.downcase}'><i class='fa fa-circle fa-xl'></i></span>"
|
19
|
+
end
|
20
|
+
|
21
|
+
column :actions, title: "", sortable: false do |template|
|
22
|
+
content_tag(:span, class: "btn-group btn-group-xs") do
|
23
|
+
concat link_to(content_tag(:i, nil, class: "fa fa-trash"), nuntius.admin_template_path(template), data: {turbo_confirm: "Are you sure you want to delete the template?", turbo_method: :delete}, class: "btn btn-xs btn-danger")
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|
@@ -26,5 +32,6 @@ class NuntiusTemplatesTable < ActionTable::ActionTable
|
|
26
32
|
|
27
33
|
def scope
|
28
34
|
@scope = Nuntius::Template.visible
|
35
|
+
@scope = Nuntius::Template.visible.select("nuntius_templates.*, (select count(id) from nuntius_messages where nuntius_messages.template_id = nuntius_templates.id) as message_count")
|
29
36
|
end
|
30
37
|
end
|
@@ -5,7 +5,7 @@ module Nuntius
|
|
5
5
|
# We split per email address, to allow easy resends
|
6
6
|
def deliver(message)
|
7
7
|
message.request_id = SecureRandom.uuid
|
8
|
-
message.to.split(
|
8
|
+
message.to.split(",").each do |to|
|
9
9
|
new_message = message.dup
|
10
10
|
new_message.to = to
|
11
11
|
super(new_message)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- if @campaign.draft?
|
2
2
|
= sts.form_for [:admin, @campaign] do |f|
|
3
|
-
= sts.card
|
4
|
-
- card.
|
3
|
+
= sts.card :nuntius_admin_campaigns, icon: 'fal fa-megaphone' do |card|
|
4
|
+
- card.with_action
|
5
5
|
= f.submit
|
6
6
|
|
7
7
|
.grid.grid-cols-12.gap-4 data-controller="toggle"
|
@@ -31,19 +31,15 @@
|
|
31
31
|
template data-toggle-target='toggleable' data-toggle-value='voice'
|
32
32
|
.col-span-12
|
33
33
|
= f.input :text, as: :editor, mode: 'text/plain'
|
34
|
-
|
35
|
-
|
36
34
|
- else
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
table.table
|
41
|
-
thead
|
42
|
-
tr
|
43
|
-
th Status
|
44
|
-
th To
|
45
|
-
tbody
|
46
|
-
- for message in @messages
|
35
|
+
= sts.card :nuntius_admin_campaigns, title: @campaign.name, description: 'We are sending this campaign, you can no longer make any changes.', icon: 'fal fa-megaphone', content_padding: false do |card|
|
36
|
+
table.table
|
37
|
+
thead
|
47
38
|
tr
|
48
|
-
|
49
|
-
|
39
|
+
th Status
|
40
|
+
th To
|
41
|
+
tbody
|
42
|
+
- for message in @messages
|
43
|
+
tr
|
44
|
+
td = link_to message.status, admin_message_path(message)
|
45
|
+
td = message.to
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_campaigns, icon: 'fad fa-megaphone', content_padding: false, menu: nuntius_campaigns_menu do |card|
|
2
|
+
= card.table :nuntius_campaigns, custom_views: true
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
json.selector
|
4
|
-
json.html render partial:
|
5
|
-
|
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)}
|
@@ -1,24 +1,23 @@
|
|
1
1
|
= sts.form_for([:admin, @layout]) do |f|
|
2
|
-
= sts.card
|
3
|
-
- card.
|
2
|
+
= sts.card :nuntius_admin_layouts, icon: 'fal fa-table-layout' do |card|
|
3
|
+
- card.with_action
|
4
4
|
= f.submit
|
5
5
|
|
6
|
-
= sts.tabs do |tabs|
|
7
|
-
- tabs.tab :edit
|
8
|
-
.grid.grid-cols-12.gap-4
|
9
|
-
.col-span-12
|
10
|
-
= f.input :name
|
11
|
-
.col-span-12
|
12
|
-
= f.input :data, as: :editor, mode: 'text/html', height: '400px'
|
13
|
-
- tabs.tab :metadata
|
14
|
-
.grid.grid-cols-12.gap-4
|
15
|
-
.col-span-12
|
16
|
-
= f.input :metadata_yaml, as: :editor, mode: 'application/yaml', label: t('.metadata')
|
17
6
|
|
18
|
-
|
19
|
-
|
20
|
-
|
7
|
+
- card.with_tab:edit, padding: true
|
8
|
+
.grid.grid-cols-12.gap-4
|
9
|
+
.col-span-12
|
10
|
+
= f.input :name
|
11
|
+
.col-span-12
|
12
|
+
= f.input :data, as: :editor, mode: 'text/html', height: '400px'
|
13
|
+
- card.with_tab:metadata, padding: true
|
14
|
+
.grid.grid-cols-12.gap-4
|
15
|
+
.col-span-12
|
16
|
+
= f.input :metadata_yaml, as: :editor, mode: 'application/yaml', label: t('.metadata')
|
21
17
|
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
- if @layout.persisted?
|
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) }
|
21
|
+
|
22
|
+
- if @layout.templates.size.positive?
|
23
|
+
= card.table :nuntius_templates, parameters: { layout_id: @layout.id }, custom_views: false, tab: :templates
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_layouts, icon: 'fad fa-table-layout', content_padding: false, menu: nuntius_layouts_menu do |card|
|
2
|
+
= card.table :nuntius_layouts, custom_views: true
|
@@ -1,14 +1,24 @@
|
|
1
1
|
= sts.form_for([:admin, @list]) do |f|
|
2
|
-
= sts.card
|
3
|
-
- card.
|
2
|
+
= sts.card :nuntius_admin_lists, icon: 'fad fa-address-book', menu: nuntius_list_menu do |card|
|
3
|
+
- card.with_action
|
4
4
|
= f.continue
|
5
|
-
- card.
|
5
|
+
- card.with_action
|
6
6
|
= f.submit
|
7
7
|
|
8
|
-
|
9
|
-
.
|
10
|
-
= f.input :name
|
8
|
+
- card.with_tab:edit, padding: true
|
9
|
+
.grid.grid-cols-12.gap-4
|
10
|
+
.col-span-6= f.input :name
|
11
|
+
.col-span-4= f.input :slug
|
12
|
+
.col-span-2= f.input :allow_unsubscribe, as: :switch
|
11
13
|
|
12
|
-
|
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;"
|
19
|
+
|
20
|
+
.col-span-12
|
21
|
+
= f.input :metadata_yaml, as: :editor, mode: 'application/yaml'
|
22
|
+
|
23
|
+
- if @list.subscribers.present?
|
24
|
+
= card.table :nuntius_subscribers, parameters: { list_id: @list.id }, custom_views: false, tab: :nuntius_subscribers
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_lists, icon: 'fad fa-address-book', content_padding: false, menu: nuntius_lists_menu do |card|
|
2
|
+
= card.table :nuntius_lists, custom_views: true
|
@@ -1,6 +1,6 @@
|
|
1
1
|
= sts.form_for(@subscriber, url: @subscriber.new_record? ? admin_list_subscribers_path(@list) : admin_list_subscriber_path(@list, @subscriber), html: {multipart: true}) do |f|
|
2
|
-
= sts.card title: t('.subscribers'), icon: 'fad fa-address-card' do |card|
|
3
|
-
- card.
|
2
|
+
= sts.card :nuntius_admin_lists_subscribers, title: t('.subscribers'), icon: 'fad fa-address-card' do |card|
|
3
|
+
- card.with_action
|
4
4
|
= f.submit
|
5
5
|
|
6
6
|
.grid.grid-cols-12.gap-4
|
@@ -1,8 +1,8 @@
|
|
1
1
|
= sts.form_for([:admin, @locale]) do |f|
|
2
|
-
= sts.card
|
3
|
-
- card.
|
2
|
+
= sts.card :nuntius_admin_locales, icon: 'fal fa-language' do |card|
|
3
|
+
- card.with_action
|
4
4
|
= f.continue
|
5
|
-
- card.
|
5
|
+
- card.with_action
|
6
6
|
= f.submit
|
7
7
|
|
8
8
|
.grid.grid-cols-12.gap-4
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_locales, icon: 'fad fa-language', content_padding: false, menu: nuntius_locales_menu do |card|
|
2
|
+
= card.table :nuntius_locales, custom_views: true
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_messages, icon: 'fad fa-envelope', content_padding: false do |card|
|
2
|
+
= card.table :nuntius_messages, custom_views: true
|
@@ -1,8 +1,8 @@
|
|
1
|
-
= sts.card title: [t('.message'), @message.template&.description], icon: 'fad fa-envelope' do |card|
|
2
|
-
- card.
|
1
|
+
= sts.card :nuntius_admin_messages, title: [t('.message'), @message.template&.description], icon: 'fad fa-envelope' do |card|
|
2
|
+
- card.with_action
|
3
3
|
= button_to(t('nuntius.context_menu.resend'), resend_admin_message_path(@message), class: 'button')
|
4
4
|
|
5
|
-
- card.
|
5
|
+
- card.with_tab:preview, padding: true
|
6
6
|
|
7
7
|
table.table
|
8
8
|
thead
|
@@ -44,13 +44,13 @@
|
|
44
44
|
- if @message.transport == 'mail' && @message.html.present?
|
45
45
|
iframe.border.rounded-lg.border-gray-200 src=message_path(@message.id) style="width: 100%; height: 600px; border: 0px;"
|
46
46
|
|
47
|
-
- card.
|
47
|
+
- card.with_tab:details, padding: true
|
48
48
|
= sts.info class: "grid grid-cols-1 gap-4 sm:grid-cols-3" do |info|
|
49
|
-
= info.
|
50
|
-
= info.
|
51
|
-
= info.
|
52
|
-
= info.
|
53
|
-
= info.
|
54
|
-
= info.
|
55
|
-
= info.
|
56
|
-
= info.
|
49
|
+
= info.with_item :status, content: @message.status, class: "sm:col-span-1"
|
50
|
+
= info.with_item :transport, content: @message.transport, class: "sm:col-span-1"
|
51
|
+
= info.with_item :provider, content: @message.provider, class: "sm:col-span-1"
|
52
|
+
= info.with_item :provider_id, content: @message.provider_id, class: "sm:col-span-1"
|
53
|
+
= info.with_item :request_id, content: @message.request_id, class: "sm:col-span-1"
|
54
|
+
= info.with_item :refreshes, content: @message.refreshes, class: "sm:col-span-1"
|
55
|
+
= info.with_item :last_sent_at, content: ln(@message.last_sent_at), class: "sm:col-span-1", icon: 'fal fa-envelope'
|
56
|
+
= info.with_item :created_at, content: ln(@message.created_at), class: "sm:col-span-1", icon: 'fal fa-calendar'
|
@@ -1,81 +1,79 @@
|
|
1
1
|
|
2
2
|
- present(@template, TemplatePresenter) do |template|
|
3
3
|
= sts.form_for([:admin, @template]) do |f|
|
4
|
-
= sts.card
|
5
|
-
- card.
|
4
|
+
= sts.card :nuntius_admin_templates, icon: 'fal fa-file' do |card|
|
5
|
+
- card.with_action
|
6
6
|
= f.continue
|
7
|
-
- card.
|
7
|
+
- card.with_action
|
8
8
|
= f.submit
|
9
9
|
|
10
|
-
|
11
|
-
-
|
12
|
-
.
|
13
|
-
.
|
14
|
-
|
15
|
-
.
|
16
|
-
|
17
|
-
|
18
|
-
.
|
10
|
+
- card.with_tab:edit, padding: true
|
11
|
+
.grid.grid-cols-12.gap-4
|
12
|
+
.col-span-1
|
13
|
+
= f.input :enabled, as: :switch
|
14
|
+
.col-span-11
|
15
|
+
= f.input :description
|
16
|
+
|
17
|
+
.grid.grid-cols-12.gap-4 data-controller='toggle'
|
18
|
+
.col-span-6
|
19
|
+
= f.input :klass, collection: Nuntius.config.nuntiable_class_names.sort, selected: @template.klass, input_html: { data: { 'toggle-target' => 'input' } }
|
20
|
+
|
21
|
+
.col-span-6 data-toggle-target="insertion"
|
22
|
+
|
23
|
+
template data-toggle-target='toggleable' data-toggle-not-value='Custom'
|
24
|
+
.col-span-6.deze data-controller='toggle' data-toggle-attr='data-timebased'
|
25
|
+
.grid.grid-cols-12.gap-4
|
26
|
+
.col-span-6
|
27
|
+
= f.input :event, collection: template.all_events, include_blank: false, chain_to: 'template[klass]', input_html: { data: { 'toggle-target' => 'input' } }, as: :dropdown
|
28
|
+
.col-span-6 data-toggle-target="insertion"
|
29
|
+
template data-toggle-target='toggleable' data-toggle-value='true'
|
30
|
+
= f.input :interval
|
31
|
+
|
32
|
+
template data-toggle-target='toggleable' data-toggle-value='Custom'
|
19
33
|
.col-span-6
|
20
|
-
= f.input :
|
34
|
+
= f.input :event, input_html: { placeholder: 'scope#event' }
|
21
35
|
|
22
|
-
|
36
|
+
.grid.grid-cols-12.gap-4 data-controller='toggle'
|
23
37
|
|
24
|
-
|
25
|
-
|
26
|
-
.grid.grid-cols-12.gap-4
|
27
|
-
.col-span-6
|
28
|
-
= f.input :event, collection: template.all_events, include_blank: false, chain_to: 'template[klass]', input_html: { data: { 'toggle-target' => 'input' } }, as: :dropdown
|
29
|
-
.col-span-6 data-toggle-target="insertion"
|
30
|
-
template data-toggle-target='toggleable' data-toggle-value='true'
|
31
|
-
= f.input :interval
|
38
|
+
.col-span-12
|
39
|
+
= f.input :transport, collection: Nuntius.config.transports, include_blank: false, input_html: { "data-toggle-target" => 'input' }
|
32
40
|
|
33
|
-
|
34
|
-
|
35
|
-
|
41
|
+
.col-span-6
|
42
|
+
= f.input :from
|
43
|
+
.col-span-6
|
44
|
+
= f.input :to
|
36
45
|
|
37
|
-
.
|
46
|
+
.col-span-12
|
47
|
+
.grid.grid-cols-12.gap-4 data-toggle-target="insertion"
|
38
48
|
|
39
|
-
|
40
|
-
|
49
|
+
.col-span-12
|
50
|
+
= f.input :metadata_yaml, as: :editor, mode: 'application/yaml', label: t('.metadata')
|
41
51
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
template data-toggle-target='toggleable' data-toggle-value='mail'
|
53
|
+
.col-span-12
|
54
|
+
= f.input :subject, as: :editor, mode: 'text/plain'
|
55
|
+
.col-span-12
|
56
|
+
= f.association :layout, collection: @layouts, include_blank: true
|
57
|
+
.col-span-12
|
58
|
+
= f.input :html, as: :editor, mode: 'text/markdown'
|
46
59
|
|
60
|
+
template data-toggle-target='toggleable' data-toggle-value='voice'
|
61
|
+
.col-span-12
|
62
|
+
= f.input :text, as: :editor, mode: 'text/plain'
|
63
|
+
template data-toggle-target='toggleable' data-toggle-value='slack'
|
64
|
+
.col-span-12
|
65
|
+
= f.input :text, as: :editor, mode: 'text/plain'
|
47
66
|
.col-span-12
|
48
|
-
.
|
67
|
+
= f.input :payload, as: :editor, mode: 'application/yaml', hint: 'See here for more information: https://app.slack.com/block-kit-builder/'
|
49
68
|
|
69
|
+
template data-toggle-target='toggleable' data-toggle-value='sms'
|
50
70
|
.col-span-12
|
51
|
-
= f.input :
|
52
|
-
|
53
|
-
|
54
|
-
.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
template data-toggle-target='toggleable' data-toggle-value='voice'
|
62
|
-
.col-span-12
|
63
|
-
= f.input :text, as: :editor, mode: 'text/plain'
|
64
|
-
template data-toggle-target='toggleable' data-toggle-value='slack'
|
65
|
-
.col-span-12
|
66
|
-
= f.input :text, as: :editor, mode: 'text/plain'
|
67
|
-
.col-span-12
|
68
|
-
= f.input :payload, as: :editor, mode: 'application/yaml'
|
69
|
-
|
70
|
-
template data-toggle-target='toggleable' data-toggle-value='sms'
|
71
|
-
.col-span-12
|
72
|
-
= f.input :text, as: :editor, mode: 'text/plain'
|
73
|
-
template data-toggle-target='toggleable' data-toggle-value='push'
|
74
|
-
.col-span-12
|
75
|
-
= f.input :text, as: :editor, mode: 'text/plain'
|
76
|
-
template data-toggle-target='toggleable' data-toggle-value='slack'
|
77
|
-
|
78
|
-
|
79
|
-
- if @template.messages.size.positive?
|
80
|
-
- tabs.tab :nuntius_messages, badge: @template.messages.size, padding: false
|
81
|
-
= sts.table :nuntius_messages, parameters: { template_id: @template.id }
|
71
|
+
= f.input :text, as: :editor, mode: 'text/plain'
|
72
|
+
template data-toggle-target='toggleable' data-toggle-value='push'
|
73
|
+
.col-span-12
|
74
|
+
= f.input :text, as: :editor, mode: 'text/plain'
|
75
|
+
template data-toggle-target='toggleable' data-toggle-value='slack'
|
76
|
+
|
77
|
+
|
78
|
+
- if @template.messages.size.positive?
|
79
|
+
= card.table :nuntius_messages, parameters: { template_id: @template.id }, custom_views: false, tab: :nuntius_messages
|
@@ -1,2 +1,2 @@
|
|
1
|
-
= sts.card
|
2
|
-
=
|
1
|
+
= sts.card :nuntius_admin_templates, icon: 'fad fa-language', content_padding: false, menu: nuntius_templates_menu do |card|
|
2
|
+
= card.table :nuntius_templates, custom_views: true
|
@@ -1,7 +1,3 @@
|
|
1
|
-
|
1
|
+
/.grid.grid-cols-1.gap-4.sm:grid-cols-3
|
2
2
|
.col-span-3.sm:col-span-3
|
3
|
-
= reportlet(:'nuntius/daily_messages_per_template', parameters: {
|
4
|
-
|
5
|
-
.col-span-3.sm:col-span-3
|
6
|
-
= sts.card title: t('.messages'), icon: 'fad fa-envelope', content_padding: false, menu: nuntius_dashboard_menu do |card|
|
7
|
-
= sts.table :nuntius_messages, parameters: {template_id: params[:template_id]}
|
3
|
+
= reportlet(:'nuntius/daily_messages_per_template', parameters: { template_ids: @templates.map(&:id) })
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
= sts.card :subscriber, title: @list.name do |card|
|
3
|
+
- card.with_action
|
4
|
+
- if @subscriber.unsubscribed_at.present?
|
5
|
+
= link_to 'Resubscribe', subscribe_subscriber_path(@subscriber), data: { turbo_method: :post }, class: 'button'
|
6
|
+
- else
|
7
|
+
= link_to 'Unsubscribe', unsubscribe_subscriber_path(@subscriber), data: { turbo_method: :post }, class: 'button primary'
|
8
|
+
|
9
|
+
p== sanitize @list.description
|