maily_herald-webui 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/.rspec +5 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +250 -0
- data/Guardfile +23 -0
- data/LICENSE +11 -0
- data/README.md +62 -0
- data/Rakefile +30 -0
- data/app/assets/images/maily_herald/.gitkeep +0 -0
- data/app/assets/images/maily_herald/webui/arrow-bottom.png +0 -0
- data/app/assets/images/maily_herald/webui/arrow-left.png +0 -0
- data/app/assets/images/maily_herald/webui/arrow-right.png +0 -0
- data/app/assets/images/maily_herald/webui/arrow-top.png +0 -0
- data/app/assets/images/maily_herald/webui/logo.svg +38 -0
- data/app/assets/images/maily_herald/webui/sprite-dropdown.png +0 -0
- data/app/assets/images/maily_herald/webui/sprite-form.png +0 -0
- data/app/assets/images/maily_herald/webui/sprite.png +0 -0
- data/app/assets/images/maily_herald/webui/user.png +0 -0
- data/app/assets/javascripts/maily_herald/webui/application.js +20 -0
- data/app/assets/javascripts/maily_herald/webui/dispatches.coffee +58 -0
- data/app/assets/javascripts/maily_herald/webui/webui.coffee +209 -0
- data/app/assets/stylesheets/maily_herald/webui/application.css +18 -0
- data/app/assets/stylesheets/maily_herald/webui/webui-bootstrap.scss +0 -0
- data/app/assets/stylesheets/maily_herald/webui/webui.sass +846 -0
- data/app/controllers/maily_herald/webui/application_controller.rb +19 -0
- data/app/controllers/maily_herald/webui/dashboard_controller.rb +65 -0
- data/app/controllers/maily_herald/webui/dispatches_controller.rb +42 -0
- data/app/controllers/maily_herald/webui/lists_controller.rb +69 -0
- data/app/controllers/maily_herald/webui/logs_controller.rb +20 -0
- data/app/controllers/maily_herald/webui/mailings_controller.rb +68 -0
- data/app/controllers/maily_herald/webui/one_time_mailings_controller.rb +32 -0
- data/app/controllers/maily_herald/webui/periodical_mailings_controller.rb +25 -0
- data/app/controllers/maily_herald/webui/resources_controller.rb +144 -0
- data/app/controllers/maily_herald/webui/sequence_mailings_controller.rb +43 -0
- data/app/controllers/maily_herald/webui/sequences_controller.rb +56 -0
- data/app/controllers/maily_herald/webui/sessions_controller.rb +11 -0
- data/app/controllers/maily_herald/webui/subscriptions_controller.rb +33 -0
- data/app/helpers/maily_herald/webui/application_helper.rb +157 -0
- data/app/helpers/maily_herald/webui/dispatches_helper.rb +18 -0
- data/app/helpers/maily_herald/webui/logs_helper.rb +37 -0
- data/app/helpers/maily_herald/webui/mailings_helper.rb +64 -0
- data/app/helpers/maily_herald/webui/sequence_mailings_helper.rb +13 -0
- data/app/helpers/maily_herald/webui/sequences_helper.rb +6 -0
- data/app/helpers/maily_herald/webui/subscribers_helper.rb +25 -0
- data/app/helpers/maily_herald/webui/subscriptions_helper.rb +11 -0
- data/app/helpers/maily_herald_helper.rb +151 -0
- data/app/views/layouts/maily_herald/webui/application.html.haml +58 -0
- data/app/views/layouts/maily_herald/webui/modal.html.haml +6 -0
- data/app/views/maily_herald/webui/dashboard/_log.html.haml +20 -0
- data/app/views/maily_herald/webui/dashboard/_log_list.html.haml +19 -0
- data/app/views/maily_herald/webui/dashboard/_logs.html.haml +15 -0
- data/app/views/maily_herald/webui/dashboard/index.html.haml +43 -0
- data/app/views/maily_herald/webui/dashboard/index.js.erb +15 -0
- data/app/views/maily_herald/webui/dispatches/_entities.html.haml +7 -0
- data/app/views/maily_herald/webui/dispatches/_logs.html.haml +4 -0
- data/app/views/maily_herald/webui/dispatches/_schedules.html.haml +4 -0
- data/app/views/maily_herald/webui/dispatches/_toggle.js.erb +1 -0
- data/app/views/maily_herald/webui/lists/_details.html.haml +14 -0
- data/app/views/maily_herald/webui/lists/_details_form.html.haml +14 -0
- data/app/views/maily_herald/webui/lists/_form.html.haml +1 -0
- data/app/views/maily_herald/webui/lists/_header.html.haml +13 -0
- data/app/views/maily_herald/webui/lists/_items.html.haml +24 -0
- data/app/views/maily_herald/webui/lists/_opt_outs.html.haml +7 -0
- data/app/views/maily_herald/webui/lists/_potential_subscribers.html.haml +7 -0
- data/app/views/maily_herald/webui/lists/_subscribers.html.haml +7 -0
- data/app/views/maily_herald/webui/lists/context_variables.html.haml +15 -0
- data/app/views/maily_herald/webui/lists/subscribe.js.erb +10 -0
- data/app/views/maily_herald/webui/lists/unsubscribe.js.erb +7 -0
- data/app/views/maily_herald/webui/logs/_items.html.haml +34 -0
- data/app/views/maily_herald/webui/logs/preview.html.haml +22 -0
- data/app/views/maily_herald/webui/mailings-old/_entity.html.haml +17 -0
- data/app/views/maily_herald/webui/mailings-old/_entity_list.html.haml +26 -0
- data/app/views/maily_herald/webui/mailings-old/_form.html.haml +32 -0
- data/app/views/maily_herald/webui/mailings-old/_print.html.haml +123 -0
- data/app/views/maily_herald/webui/mailings-old/create.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/destroy.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/edit.html.haml +16 -0
- data/app/views/maily_herald/webui/mailings-old/edit.js.erb +2 -0
- data/app/views/maily_herald/webui/mailings-old/index.html.haml +9 -0
- data/app/views/maily_herald/webui/mailings-old/index.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/new.html.haml +16 -0
- data/app/views/maily_herald/webui/mailings-old/new.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/preview.js.erb +2 -0
- data/app/views/maily_herald/webui/mailings-old/refresh_list.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/show.html.haml +135 -0
- data/app/views/maily_herald/webui/mailings-old/show.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings-old/update.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings/_deliver.js.erb +1 -0
- data/app/views/maily_herald/webui/mailings/_details.html.haml +65 -0
- data/app/views/maily_herald/webui/mailings/_details_form.html.haml +39 -0
- data/app/views/maily_herald/webui/mailings/_form.html.haml +1 -0
- data/app/views/maily_herald/webui/mailings/_form_periodical.html.haml +2 -0
- data/app/views/maily_herald/webui/mailings/_form_sequence.html.haml +1 -0
- data/app/views/maily_herald/webui/mailings/_form_template_generic.html.haml +7 -0
- data/app/views/maily_herald/webui/mailings/_form_template_mailer.html.haml +4 -0
- data/app/views/maily_herald/webui/mailings/_header.html.haml +24 -0
- data/app/views/maily_herald/webui/mailings/_list.html.haml +27 -0
- data/app/views/maily_herald/webui/mailings/_template.html.haml +16 -0
- data/app/views/maily_herald/webui/mailings/_template_form.html.haml +7 -0
- data/app/views/maily_herald/webui/mailings/nav_secondary/_index.html.haml +3 -0
- data/app/views/maily_herald/webui/mailings/preview.html.haml +13 -0
- data/app/views/maily_herald/webui/mailings/update_form.js.erb +33 -0
- data/app/views/maily_herald/webui/resources/edit.js.erb +2 -0
- data/app/views/maily_herald/webui/resources/index.html.haml +11 -0
- data/app/views/maily_herald/webui/resources/index.js.erb +1 -0
- data/app/views/maily_herald/webui/resources/new.html.haml +5 -0
- data/app/views/maily_herald/webui/resources/show.html.haml +4 -0
- data/app/views/maily_herald/webui/resources/show.js.erb +3 -0
- data/app/views/maily_herald/webui/resources/update.js.erb +18 -0
- data/app/views/maily_herald/webui/sequences-old/_entity.html.haml +11 -0
- data/app/views/maily_herald/webui/sequences-old/_entity_list.html.haml +23 -0
- data/app/views/maily_herald/webui/sequences-old/_form.html.haml +17 -0
- data/app/views/maily_herald/webui/sequences-old/_log.html.haml +7 -0
- data/app/views/maily_herald/webui/sequences-old/_logs.html.haml +16 -0
- data/app/views/maily_herald/webui/sequences-old/_mailing.html.haml +4 -0
- data/app/views/maily_herald/webui/sequences-old/_mailing_list.html.haml +19 -0
- data/app/views/maily_herald/webui/sequences-old/edit.html.haml +14 -0
- data/app/views/maily_herald/webui/sequences-old/new.html.haml +13 -0
- data/app/views/maily_herald/webui/sequences-old/show.html.haml +122 -0
- data/app/views/maily_herald/webui/sequences-old/show.js.erb +2 -0
- data/app/views/maily_herald/webui/sequences-old/subscription.html.haml +79 -0
- data/app/views/maily_herald/webui/sequences/_details.html.haml +39 -0
- data/app/views/maily_herald/webui/sequences/_details_form.html.haml +27 -0
- data/app/views/maily_herald/webui/sequences/_form.html.haml +1 -0
- data/app/views/maily_herald/webui/sequences/_header.html.haml +11 -0
- data/app/views/maily_herald/webui/sequences/_list.html.haml +21 -0
- data/app/views/maily_herald/webui/sequences/_mailing_list.html.haml +21 -0
- data/app/views/maily_herald/webui/sequences/_mailings.html.haml +7 -0
- data/app/views/maily_herald/webui/sequences/update_form.js.erb +14 -0
- data/app/views/maily_herald/webui/shared/_context_attributes.html.haml +11 -0
- data/app/views/maily_herald/webui/subscribers/_item.html.haml +8 -0
- data/app/views/maily_herald/webui/subscribers/_list.html.haml +18 -0
- data/app/views/maily_herald/webui/subscription_groups/_form.html.haml +5 -0
- data/app/views/maily_herald/webui/subscription_groups/_subscription.html.haml +8 -0
- data/app/views/maily_herald/webui/subscription_groups/_subscription_list.html.haml +19 -0
- data/app/views/maily_herald/webui/subscription_groups/edit.html.haml +16 -0
- data/app/views/maily_herald/webui/subscription_groups/index.html.haml +35 -0
- data/app/views/maily_herald/webui/subscription_groups/new.html.haml +11 -0
- data/app/views/maily_herald/webui/subscription_groups/show.html.haml +42 -0
- data/app/views/maily_herald/webui/subscription_groups/show.js.erb +1 -0
- data/app/views/maily_herald/webui/subscriptions/show.html.haml +21 -0
- data/app/views/maily_herald/webui/subscriptions/toggle.js.erb +1 -0
- data/app/views/maily_herald/webui/webui/index.html.haml +136 -0
- data/app/views/maily_herald/webui/webui/show.html.haml +0 -0
- data/config/database.yml +5 -0
- data/config/initializers/smart_listing.rb +77 -0
- data/config/locales/en.yml +237 -0
- data/config/routes.rb +103 -0
- data/config/spring.rb +1 -0
- data/lib/maily_herald/webui.rb +15 -0
- data/lib/maily_herald/webui/breadcrumbs.rb +50 -0
- data/lib/maily_herald/webui/engine.rb +18 -0
- data/lib/maily_herald/webui/form_builder.rb +285 -0
- data/lib/maily_herald/webui/menu_manager.rb +66 -0
- data/lib/maily_herald/webui/version.rb +5 -0
- data/maily_herald-webui.gemspec +40 -0
- data/script/rails +8 -0
- data/spec/dummy/Guardfile +35 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/mailers/test_mailer.rb +11 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/user.rb +7 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/test_mailer/sample_mail.text.erb +1 -0
- data/spec/dummy/bin/rails +10 -0
- data/spec/dummy/bin/rake +7 -0
- data/spec/dummy/bin/rspec +7 -0
- data/spec/dummy/bin/spring +18 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +65 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +38 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/maily_herald.rb +101 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/locales/maily_herald.en.yml +28 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/migrate/20130723074347_create_users.rb +11 -0
- data/spec/dummy/db/migrate/20140804152249_create_maily_herald_tables.maily_herald.rb +68 -0
- data/spec/dummy/db/migrate/20140804152250_create_lists.maily_herald.rb +33 -0
- data/spec/dummy/db/schema.rb +79 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/dummy.rb +8 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/spec_helper.rb +46 -0
- data/vendor/assets/fonts/maily_herald/webui/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.eot +0 -0
- data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.svg +1816 -0
- data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.woff +0 -0
- data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.svg +520 -0
- data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.eot +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.svg +1825 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.woff +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.eot +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.svg +1825 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.ttf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.woff +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.eot +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.svg +1825 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.ttf +0 -0
- data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.woff +0 -0
- data/vendor/assets/javascripts/maily_herald/webui/bootstrap-datepicker.js +1681 -0
- data/vendor/assets/javascripts/maily_herald/webui/bootstrap.min.js +6 -0
- data/vendor/assets/javascripts/maily_herald/webui/d3.v3.js +5 -0
- data/vendor/assets/javascripts/maily_herald/webui/rickshaw.js +4067 -0
- data/vendor/assets/stylesheets/maily_herald/webui/bootstrap-datepicker.css +786 -0
- data/vendor/assets/stylesheets/maily_herald/webui/bootstrap.min.css +5 -0
- data/vendor/assets/stylesheets/maily_herald/webui/font-awesome.min.css +4 -0
- data/vendor/assets/stylesheets/maily_herald/webui/rickshaw.css +355 -0
- metadata +564 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
module MailyHerald
|
2
|
+
module Webui
|
3
|
+
module SubscribersHelper
|
4
|
+
def subscriber_actions list, entity
|
5
|
+
actions = []
|
6
|
+
subscription = list.subscription_for(entity)
|
7
|
+
actions << {
|
8
|
+
name: :custom,
|
9
|
+
url: subscription_path(subscription),
|
10
|
+
icon: "fa fa-book",
|
11
|
+
title: tw("label_subscription")
|
12
|
+
} if subscription
|
13
|
+
actions << {
|
14
|
+
name: :custom,
|
15
|
+
url: !list.subscribed?(entity) ? subscribe_to_list_path(list, entity) : unsubscribe_from_list_path(list, entity),
|
16
|
+
method: :post,
|
17
|
+
icon: !list.subscribed?(entity) ? "fa fa-square-o" : "fa fa-check-square-o",
|
18
|
+
remote: true,
|
19
|
+
title: !list.subscribed?(entity) ? tw("subscribers.item.subscribe") : tw("subscribers.item.unsubscribe"),
|
20
|
+
confirm: tw("subscriptions.show.toggle_confirm")
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
module MailyHeraldHelper
|
2
|
+
def sequence_mailing_list_actions mailing
|
3
|
+
actions = [
|
4
|
+
{
|
5
|
+
:name => :custom,
|
6
|
+
:url => webui_mailing_path(mailing),
|
7
|
+
:icon => "glyphicon glyphicon-hand-right",
|
8
|
+
:title => "Show"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
:name => :custom,
|
12
|
+
:url => edit_webui_mailing_path(mailing),
|
13
|
+
:icon => "glyphicon glyphicon-pencil",
|
14
|
+
:title => "Edit"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
:name => :custom,
|
18
|
+
:url => webui_mailing_path(mailing),
|
19
|
+
:method => :delete,
|
20
|
+
:confirm => "Are you sure you want to remove this mailing?",
|
21
|
+
:icon => "glyphicon glyphicon-trash",
|
22
|
+
:title => "Remove"
|
23
|
+
}
|
24
|
+
]
|
25
|
+
actions.insert(0, {
|
26
|
+
:name => :custom,
|
27
|
+
:url => "#mailing-#{mailing.id}",
|
28
|
+
:class => "show-preview",
|
29
|
+
:icon => "glyphicon glyphicon-search",
|
30
|
+
:title => "Preview"
|
31
|
+
}) if @sequence && @subscription
|
32
|
+
actions
|
33
|
+
end
|
34
|
+
|
35
|
+
def sequence_entity_list_actions entity
|
36
|
+
[
|
37
|
+
{
|
38
|
+
:name => :custom,
|
39
|
+
:url => subscription_webui_sequence_path(:entity_id => entity),
|
40
|
+
:icon => "glyphicon glyphicon-hand-right",
|
41
|
+
:title => "Show"
|
42
|
+
}
|
43
|
+
]
|
44
|
+
end
|
45
|
+
def mailing_entity_list_actions mailing, entity
|
46
|
+
actions = []
|
47
|
+
actions.push({
|
48
|
+
:name => :custom,
|
49
|
+
:url => preview_webui_mailing_path(:subscription_id => mailing.subscription_for(entity)),
|
50
|
+
:icon => "glyphicon glyphicon-search",
|
51
|
+
:title => "Preview template below",
|
52
|
+
:remote => true
|
53
|
+
})
|
54
|
+
actions.push({
|
55
|
+
:name => :custom,
|
56
|
+
:url => mailing.sequence? ? subscription_webui_sequence_path(:id => mailing.sequence, :entity_id => entity) : subscription_webui_mailing_path(:entity_id => entity),
|
57
|
+
:icon => "glyphicon glyphicon-hand-right",
|
58
|
+
:title => "Show"
|
59
|
+
})
|
60
|
+
actions
|
61
|
+
end
|
62
|
+
|
63
|
+
def time_tag(time)
|
64
|
+
return unless time
|
65
|
+
text = distance_of_time_in_words(Time.now, time)
|
66
|
+
content_tag('abbr', text, :title => format_time(time))
|
67
|
+
end
|
68
|
+
|
69
|
+
def time_tag_ago(time)
|
70
|
+
return unless time
|
71
|
+
text = distance_of_time_in_words(Time.now, time)
|
72
|
+
content_tag('abbr', t('time_distance.ago', :text => text), :title => time)
|
73
|
+
end
|
74
|
+
|
75
|
+
def time_tag_to(time)
|
76
|
+
return unless time
|
77
|
+
text = distance_of_time_in_words(Time.now, time)
|
78
|
+
content_tag('abbr', t('time_distance.in', :text => text), :title => time)
|
79
|
+
end
|
80
|
+
|
81
|
+
def delivery_log_list_actions delivery_log
|
82
|
+
mailing = delivery_log.mailing
|
83
|
+
entity = delivery_log.entity
|
84
|
+
|
85
|
+
actions = []
|
86
|
+
actions.push({
|
87
|
+
:name => :custom,
|
88
|
+
:url => webui_dashboard_path(delivery_log),
|
89
|
+
:icon => "icon-search",
|
90
|
+
:title => "Show log details"
|
91
|
+
})
|
92
|
+
actions.push({
|
93
|
+
:name => :custom,
|
94
|
+
:url => mailing.sequence? ? subscription_webui_sequence_path(:id => mailing.sequence, :entity_id => entity) : subscription_webui_mailing_path(:id => mailing, :entity_id => entity),
|
95
|
+
:icon => "icon-hand-right",
|
96
|
+
:title => "Subscription"
|
97
|
+
}) unless @subscription
|
98
|
+
actions
|
99
|
+
end
|
100
|
+
|
101
|
+
def subscription_group_subscription_actions subscription
|
102
|
+
[{
|
103
|
+
:name => :custom,
|
104
|
+
:url => toggle_subscription_webui_subscription_group_path(:subscription_id => subscription),
|
105
|
+
:method => :get,
|
106
|
+
:confirm => "Are you sure you want to change this subscription?",
|
107
|
+
:icon => "icon-refresh",
|
108
|
+
:title => "Toggle subscription"
|
109
|
+
}]
|
110
|
+
end
|
111
|
+
|
112
|
+
def time_tag_relative(time)
|
113
|
+
if time > Time.now
|
114
|
+
time_tag_to time
|
115
|
+
else
|
116
|
+
time_tag_ago time
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def context_attributes_link options = {}
|
121
|
+
link_to context_attributes_webui_mailings_path(:context_name => options[:context]), :role => "button", :data => {:toggle => "modal", :target => "#context-attributes"}, :class => "show-context-attributes" do
|
122
|
+
concat(content_tag(:i, "", :class => "glyphicon glyphicon-th-list"))
|
123
|
+
concat(" show") unless options[:notext]
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def maily_herald_context_options_for_select selected = nil, options = {}
|
128
|
+
MailyHerald.contexts.keys.collect {|c| [c, c] }
|
129
|
+
end
|
130
|
+
|
131
|
+
def maily_herald_mailer_options_for_select selected = nil, options = {}
|
132
|
+
[
|
133
|
+
['generic', 'generic']
|
134
|
+
]
|
135
|
+
end
|
136
|
+
|
137
|
+
def maily_herald_context_attributes_list name
|
138
|
+
MailyHerald.context(name).each
|
139
|
+
end
|
140
|
+
|
141
|
+
def maily_herald_token_action_options_for_select selected = nil, options = {}
|
142
|
+
[
|
143
|
+
['Unsubscribe', 'unsubscribe'],
|
144
|
+
['Custom', 'custom'],
|
145
|
+
]
|
146
|
+
end
|
147
|
+
|
148
|
+
def maily_herald_subscription_group_options_for_select selected = nil, options = {}
|
149
|
+
[["none", ""]] + MailyHerald::SubscriptionGroup.all.collect {|sg| [sg.title, sg.name] }
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title MailyHerald
|
5
|
+
= stylesheet_link_tag "maily_herald/webui/application", :media => "all"
|
6
|
+
= javascript_include_tag "maily_herald/webui/application"
|
7
|
+
= csrf_meta_tags
|
8
|
+
%body{data: {smart_listing_config: SmartListing.config(:maily_herald).to_json}}
|
9
|
+
.container
|
10
|
+
.hero
|
11
|
+
.row
|
12
|
+
.col-sm-3.text-center
|
13
|
+
%h1= link_to image_tag("maily_herald/webui/logo.svg", :class => "img-responsive logo"), root_path
|
14
|
+
.col-sm-6= render_breadcrumbs
|
15
|
+
.col-sm-3
|
16
|
+
.dropdown.pull-right
|
17
|
+
%a{:href => '#', :data => { toggle: 'dropdown'}, :class => 'account'}
|
18
|
+
%span= work_mode_t(work_mode)
|
19
|
+
%ul.dropdown-menu{'role' => 'menu'}
|
20
|
+
- if work_mode == :expert
|
21
|
+
%li= link_to work_mode_t(:regular), switch_mode_path(:regular), :method => :post
|
22
|
+
- else
|
23
|
+
%li= link_to work_mode_t(:expert), switch_mode_path(:expert), :method => :post
|
24
|
+
|
25
|
+
.section-wrapper
|
26
|
+
= render_main_menu
|
27
|
+
|
28
|
+
.content-container
|
29
|
+
= yield
|
30
|
+
|
31
|
+
.footer
|
32
|
+
.pull-right
|
33
|
+
= t(".created_by")
|
34
|
+
= link_to "Sology", "http://www.sology.eu"
|
35
|
+
%div
|
36
|
+
%span
|
37
|
+
%strong= link_to "MailyHerald", "https://github.com/Sology/maily_herald"
|
38
|
+
= "v#{::MailyHerald::VERSION}"
|
39
|
+
%span
|
40
|
+
%strong= link_to "WebUI", "https://github.com/Sology/maily_herald-webui"
|
41
|
+
= "v#{::MailyHerald::Webui::VERSION}"
|
42
|
+
%span
|
43
|
+
%strong Redis:
|
44
|
+
= MailyHerald.redis.client.id
|
45
|
+
- if MailyHerald.redis.respond_to?(:namespace)
|
46
|
+
%span
|
47
|
+
%strong Namespace:
|
48
|
+
= MailyHerald.redis.respond_to?(:namespace) ? MailyHerald.redis.namespace : nil
|
49
|
+
.hidden
|
50
|
+
#popover-confirmation.fade{data: {title: t(".confirm")}}
|
51
|
+
%p.popover-msg
|
52
|
+
.popover-footer
|
53
|
+
%button.btn.btn-webui.confirm{:data => {:dismiss => "modal"}} OK
|
54
|
+
%button.btn.btn-link.cancel{:data => {:dismiss => "modal"}} Cancel
|
55
|
+
.modal#modal-generic.fade
|
56
|
+
.modal-dialog
|
57
|
+
.modal-content
|
58
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
%td
|
2
|
+
= time_tag_relative(object.processed_at)
|
3
|
+
%td
|
4
|
+
= object.entity
|
5
|
+
= "<#{object.entity.email}>"
|
6
|
+
%td
|
7
|
+
- if object.mailing.sequence?
|
8
|
+
= link_to object.mailing.sequence.title, webui_sequence_path(object.mailing.sequence)
|
9
|
+
»
|
10
|
+
= link_to object.mailing.title, webui_mailing_path(object.mailing)
|
11
|
+
%td
|
12
|
+
- case object.status
|
13
|
+
- when :delivered
|
14
|
+
%span.glyphicon.glyphicon-ok{:title => "Delivered"}
|
15
|
+
- when :skipped
|
16
|
+
%span.glyphicon.glyphicon-warning-sign{:title => "Skipped"}
|
17
|
+
- when :error
|
18
|
+
%span.glyphicon.glyphicon-remove{:title => "ERROR"}
|
19
|
+
%td.actions
|
20
|
+
= smart_listing_item_actions delivery_log_list_actions(object)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- unless smart_listing.collection.empty?
|
2
|
+
%table.table.table-striped
|
3
|
+
%thead
|
4
|
+
%tr
|
5
|
+
%th Processed at
|
6
|
+
%th Entity
|
7
|
+
%th Mailing
|
8
|
+
%th Status
|
9
|
+
%th.span1
|
10
|
+
|
11
|
+
%tbody
|
12
|
+
- smart_listing.collection.each do |log|
|
13
|
+
%tr
|
14
|
+
= render :partial => "maily_herald/webui/dashboard/log", :locals => {:object => log}
|
15
|
+
|
16
|
+
= smart_listing.paginate
|
17
|
+
= smart_listing.pagination_per_page_links
|
18
|
+
- else
|
19
|
+
%p.alert No delivery logs
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- unless @logs.empty?
|
2
|
+
%table.table.table-striped
|
3
|
+
%thead
|
4
|
+
%tr
|
5
|
+
%th Id
|
6
|
+
%th Delivery date
|
7
|
+
%th Opened
|
8
|
+
%th Opened at
|
9
|
+
|
10
|
+
%tbody
|
11
|
+
- @logs.each do |log|
|
12
|
+
%tr
|
13
|
+
= render :partial => "maily_herald/webui/dashboard/log", :locals => {:object => log}
|
14
|
+
- else
|
15
|
+
%p.alert No delivery logs
|
@@ -0,0 +1,43 @@
|
|
1
|
+
%h2.border
|
2
|
+
= t(".history")
|
3
|
+
%span.dashboard-periods
|
4
|
+
= link_to({period: "week"}, :remote => true, :class => ["link link-sm period-week", ("active" if @period == 1.week)]) do
|
5
|
+
= t(".week")
|
6
|
+
= link_to({period: "month"}, :remote => true, :class => ["link link-sm period-month", ("active" if @period == 1.month)]) do
|
7
|
+
= t(".month")
|
8
|
+
= link_to({period: "6months"}, :remote => true, :class => ["link link-sm period-6months", ("active" if @period == 6.months)]) do
|
9
|
+
= t(".6months")
|
10
|
+
= link_to({period: "year"}, :remote => true, :class => ["link link-sm period-year", ("active" if @period == 1.year)]) do
|
11
|
+
= t(".year")
|
12
|
+
|
13
|
+
.history-graph{data: {delivered: @delivered.to_json, failed: @failed.to_json, skipped: @skipped.to_json}}
|
14
|
+
|
15
|
+
%p
|
16
|
+
|
17
|
+
.container-fluid
|
18
|
+
.well.row.statusbox
|
19
|
+
.col-sm-12.clearfix
|
20
|
+
.col-sm-3
|
21
|
+
%strong.text-muted.processed-count= @processed_count
|
22
|
+
%br
|
23
|
+
%span= tw("logs.status.processed")
|
24
|
+
.col-sm-3
|
25
|
+
%strong.delivered-count= @delivered_count
|
26
|
+
%br
|
27
|
+
%span= tw("logs.status.delivered")
|
28
|
+
.col-sm-3
|
29
|
+
%strong.text-warning.skipped-count= @skipped_count
|
30
|
+
%br
|
31
|
+
%span= tw("logs.status.skipped")
|
32
|
+
.col-sm-3
|
33
|
+
%strong.text-danger.failed-count= @failed_count
|
34
|
+
%br
|
35
|
+
%span= tw("logs.status.failed")
|
36
|
+
|
37
|
+
%p
|
38
|
+
|
39
|
+
= smart_listing_render :logs
|
40
|
+
|
41
|
+
%h2.border
|
42
|
+
= tw("logs.scheduled_deliveries")
|
43
|
+
= smart_listing_render :scheduled_logs
|
@@ -0,0 +1,15 @@
|
|
1
|
+
$(".dashboard-periods a").removeClass("active");
|
2
|
+
$(".period-<%= params[:period] || "month" %>").addClass("active");
|
3
|
+
|
4
|
+
<%= smart_listing_update(:logs) %>
|
5
|
+
<%= smart_listing_update(:scheduled_logs) %>
|
6
|
+
|
7
|
+
$(".processed-count").html(<%= @processed_count %>);
|
8
|
+
$(".delivered-count").html(<%= @delivered_count %>);
|
9
|
+
$(".skipped-count").html(<%= @skipped_count %>);
|
10
|
+
$(".failed-count").html(<%= @failed_count %>);
|
11
|
+
|
12
|
+
$(".history-graph").data("delivered", <%= @delivered.to_json.html_safe %>);
|
13
|
+
$(".history-graph").data("failed", <%= @failed.to_json.html_safe %>);
|
14
|
+
$(".history-graph").data("skipped", <%= @skipped.to_json.html_safe %>);
|
15
|
+
$(".history-graph").historyGraph();
|
@@ -0,0 +1 @@
|
|
1
|
+
$(".dispatch-state").html("<%= escape_javascript(display_mailing_state(@item)) %>");
|
@@ -0,0 +1,14 @@
|
|
1
|
+
- unless @item.new_record?
|
2
|
+
= render partial: "header"
|
3
|
+
|
4
|
+
= form_for @item, :as => :item, :layout => :horizontal, :remote => !@item.new_record?, :control_col => "col-sm-5" do |f|
|
5
|
+
- content_for_expert do
|
6
|
+
= f.text_field :name
|
7
|
+
= f.text_field :title
|
8
|
+
- if @item.new_record?
|
9
|
+
= f.maily_context_select
|
10
|
+
|
11
|
+
- if @item.new_record?
|
12
|
+
= f.buttons :create
|
13
|
+
- else
|
14
|
+
= f.buttons :save, :cancel
|
@@ -0,0 +1 @@
|
|
1
|
+
= render partial: "details_form"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
%h1
|
2
|
+
= friendly_name @item
|
3
|
+
- unless @item.locked?
|
4
|
+
= link_to edit_list_path(@item), :remote => true, :class => "link link-sm" do
|
5
|
+
= icon(:pencil)
|
6
|
+
= tw("commons.edit")
|
7
|
+
= link_to list_path(@item), :method => :delete, :data => {:confirm => t(".confirm_delete")}, :class => "link link-sm" do
|
8
|
+
= icon(:"trash-o")
|
9
|
+
= tw("commons.remove")
|
10
|
+
- else
|
11
|
+
%a.link.link-sm.text-warning{:data => {:toggle => "tooltip", :placement => "top"}, :title => tw("lists.locked_info")}
|
12
|
+
= icon(:lock)
|
13
|
+
= tw("commons.locked")
|