maily_herald-webui 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +5 -0
  4. data/Gemfile +15 -0
  5. data/Gemfile.lock +250 -0
  6. data/Guardfile +23 -0
  7. data/LICENSE +11 -0
  8. data/README.md +62 -0
  9. data/Rakefile +30 -0
  10. data/app/assets/images/maily_herald/.gitkeep +0 -0
  11. data/app/assets/images/maily_herald/webui/arrow-bottom.png +0 -0
  12. data/app/assets/images/maily_herald/webui/arrow-left.png +0 -0
  13. data/app/assets/images/maily_herald/webui/arrow-right.png +0 -0
  14. data/app/assets/images/maily_herald/webui/arrow-top.png +0 -0
  15. data/app/assets/images/maily_herald/webui/logo.svg +38 -0
  16. data/app/assets/images/maily_herald/webui/sprite-dropdown.png +0 -0
  17. data/app/assets/images/maily_herald/webui/sprite-form.png +0 -0
  18. data/app/assets/images/maily_herald/webui/sprite.png +0 -0
  19. data/app/assets/images/maily_herald/webui/user.png +0 -0
  20. data/app/assets/javascripts/maily_herald/webui/application.js +20 -0
  21. data/app/assets/javascripts/maily_herald/webui/dispatches.coffee +58 -0
  22. data/app/assets/javascripts/maily_herald/webui/webui.coffee +209 -0
  23. data/app/assets/stylesheets/maily_herald/webui/application.css +18 -0
  24. data/app/assets/stylesheets/maily_herald/webui/webui-bootstrap.scss +0 -0
  25. data/app/assets/stylesheets/maily_herald/webui/webui.sass +846 -0
  26. data/app/controllers/maily_herald/webui/application_controller.rb +19 -0
  27. data/app/controllers/maily_herald/webui/dashboard_controller.rb +65 -0
  28. data/app/controllers/maily_herald/webui/dispatches_controller.rb +42 -0
  29. data/app/controllers/maily_herald/webui/lists_controller.rb +69 -0
  30. data/app/controllers/maily_herald/webui/logs_controller.rb +20 -0
  31. data/app/controllers/maily_herald/webui/mailings_controller.rb +68 -0
  32. data/app/controllers/maily_herald/webui/one_time_mailings_controller.rb +32 -0
  33. data/app/controllers/maily_herald/webui/periodical_mailings_controller.rb +25 -0
  34. data/app/controllers/maily_herald/webui/resources_controller.rb +144 -0
  35. data/app/controllers/maily_herald/webui/sequence_mailings_controller.rb +43 -0
  36. data/app/controllers/maily_herald/webui/sequences_controller.rb +56 -0
  37. data/app/controllers/maily_herald/webui/sessions_controller.rb +11 -0
  38. data/app/controllers/maily_herald/webui/subscriptions_controller.rb +33 -0
  39. data/app/helpers/maily_herald/webui/application_helper.rb +157 -0
  40. data/app/helpers/maily_herald/webui/dispatches_helper.rb +18 -0
  41. data/app/helpers/maily_herald/webui/logs_helper.rb +37 -0
  42. data/app/helpers/maily_herald/webui/mailings_helper.rb +64 -0
  43. data/app/helpers/maily_herald/webui/sequence_mailings_helper.rb +13 -0
  44. data/app/helpers/maily_herald/webui/sequences_helper.rb +6 -0
  45. data/app/helpers/maily_herald/webui/subscribers_helper.rb +25 -0
  46. data/app/helpers/maily_herald/webui/subscriptions_helper.rb +11 -0
  47. data/app/helpers/maily_herald_helper.rb +151 -0
  48. data/app/views/layouts/maily_herald/webui/application.html.haml +58 -0
  49. data/app/views/layouts/maily_herald/webui/modal.html.haml +6 -0
  50. data/app/views/maily_herald/webui/dashboard/_log.html.haml +20 -0
  51. data/app/views/maily_herald/webui/dashboard/_log_list.html.haml +19 -0
  52. data/app/views/maily_herald/webui/dashboard/_logs.html.haml +15 -0
  53. data/app/views/maily_herald/webui/dashboard/index.html.haml +43 -0
  54. data/app/views/maily_herald/webui/dashboard/index.js.erb +15 -0
  55. data/app/views/maily_herald/webui/dispatches/_entities.html.haml +7 -0
  56. data/app/views/maily_herald/webui/dispatches/_logs.html.haml +4 -0
  57. data/app/views/maily_herald/webui/dispatches/_schedules.html.haml +4 -0
  58. data/app/views/maily_herald/webui/dispatches/_toggle.js.erb +1 -0
  59. data/app/views/maily_herald/webui/lists/_details.html.haml +14 -0
  60. data/app/views/maily_herald/webui/lists/_details_form.html.haml +14 -0
  61. data/app/views/maily_herald/webui/lists/_form.html.haml +1 -0
  62. data/app/views/maily_herald/webui/lists/_header.html.haml +13 -0
  63. data/app/views/maily_herald/webui/lists/_items.html.haml +24 -0
  64. data/app/views/maily_herald/webui/lists/_opt_outs.html.haml +7 -0
  65. data/app/views/maily_herald/webui/lists/_potential_subscribers.html.haml +7 -0
  66. data/app/views/maily_herald/webui/lists/_subscribers.html.haml +7 -0
  67. data/app/views/maily_herald/webui/lists/context_variables.html.haml +15 -0
  68. data/app/views/maily_herald/webui/lists/subscribe.js.erb +10 -0
  69. data/app/views/maily_herald/webui/lists/unsubscribe.js.erb +7 -0
  70. data/app/views/maily_herald/webui/logs/_items.html.haml +34 -0
  71. data/app/views/maily_herald/webui/logs/preview.html.haml +22 -0
  72. data/app/views/maily_herald/webui/mailings-old/_entity.html.haml +17 -0
  73. data/app/views/maily_herald/webui/mailings-old/_entity_list.html.haml +26 -0
  74. data/app/views/maily_herald/webui/mailings-old/_form.html.haml +32 -0
  75. data/app/views/maily_herald/webui/mailings-old/_print.html.haml +123 -0
  76. data/app/views/maily_herald/webui/mailings-old/create.js.erb +1 -0
  77. data/app/views/maily_herald/webui/mailings-old/destroy.js.erb +1 -0
  78. data/app/views/maily_herald/webui/mailings-old/edit.html.haml +16 -0
  79. data/app/views/maily_herald/webui/mailings-old/edit.js.erb +2 -0
  80. data/app/views/maily_herald/webui/mailings-old/index.html.haml +9 -0
  81. data/app/views/maily_herald/webui/mailings-old/index.js.erb +1 -0
  82. data/app/views/maily_herald/webui/mailings-old/new.html.haml +16 -0
  83. data/app/views/maily_herald/webui/mailings-old/new.js.erb +1 -0
  84. data/app/views/maily_herald/webui/mailings-old/preview.js.erb +2 -0
  85. data/app/views/maily_herald/webui/mailings-old/refresh_list.js.erb +1 -0
  86. data/app/views/maily_herald/webui/mailings-old/show.html.haml +135 -0
  87. data/app/views/maily_herald/webui/mailings-old/show.js.erb +1 -0
  88. data/app/views/maily_herald/webui/mailings-old/update.js.erb +1 -0
  89. data/app/views/maily_herald/webui/mailings/_deliver.js.erb +1 -0
  90. data/app/views/maily_herald/webui/mailings/_details.html.haml +65 -0
  91. data/app/views/maily_herald/webui/mailings/_details_form.html.haml +39 -0
  92. data/app/views/maily_herald/webui/mailings/_form.html.haml +1 -0
  93. data/app/views/maily_herald/webui/mailings/_form_periodical.html.haml +2 -0
  94. data/app/views/maily_herald/webui/mailings/_form_sequence.html.haml +1 -0
  95. data/app/views/maily_herald/webui/mailings/_form_template_generic.html.haml +7 -0
  96. data/app/views/maily_herald/webui/mailings/_form_template_mailer.html.haml +4 -0
  97. data/app/views/maily_herald/webui/mailings/_header.html.haml +24 -0
  98. data/app/views/maily_herald/webui/mailings/_list.html.haml +27 -0
  99. data/app/views/maily_herald/webui/mailings/_template.html.haml +16 -0
  100. data/app/views/maily_herald/webui/mailings/_template_form.html.haml +7 -0
  101. data/app/views/maily_herald/webui/mailings/nav_secondary/_index.html.haml +3 -0
  102. data/app/views/maily_herald/webui/mailings/preview.html.haml +13 -0
  103. data/app/views/maily_herald/webui/mailings/update_form.js.erb +33 -0
  104. data/app/views/maily_herald/webui/resources/edit.js.erb +2 -0
  105. data/app/views/maily_herald/webui/resources/index.html.haml +11 -0
  106. data/app/views/maily_herald/webui/resources/index.js.erb +1 -0
  107. data/app/views/maily_herald/webui/resources/new.html.haml +5 -0
  108. data/app/views/maily_herald/webui/resources/show.html.haml +4 -0
  109. data/app/views/maily_herald/webui/resources/show.js.erb +3 -0
  110. data/app/views/maily_herald/webui/resources/update.js.erb +18 -0
  111. data/app/views/maily_herald/webui/sequences-old/_entity.html.haml +11 -0
  112. data/app/views/maily_herald/webui/sequences-old/_entity_list.html.haml +23 -0
  113. data/app/views/maily_herald/webui/sequences-old/_form.html.haml +17 -0
  114. data/app/views/maily_herald/webui/sequences-old/_log.html.haml +7 -0
  115. data/app/views/maily_herald/webui/sequences-old/_logs.html.haml +16 -0
  116. data/app/views/maily_herald/webui/sequences-old/_mailing.html.haml +4 -0
  117. data/app/views/maily_herald/webui/sequences-old/_mailing_list.html.haml +19 -0
  118. data/app/views/maily_herald/webui/sequences-old/edit.html.haml +14 -0
  119. data/app/views/maily_herald/webui/sequences-old/new.html.haml +13 -0
  120. data/app/views/maily_herald/webui/sequences-old/show.html.haml +122 -0
  121. data/app/views/maily_herald/webui/sequences-old/show.js.erb +2 -0
  122. data/app/views/maily_herald/webui/sequences-old/subscription.html.haml +79 -0
  123. data/app/views/maily_herald/webui/sequences/_details.html.haml +39 -0
  124. data/app/views/maily_herald/webui/sequences/_details_form.html.haml +27 -0
  125. data/app/views/maily_herald/webui/sequences/_form.html.haml +1 -0
  126. data/app/views/maily_herald/webui/sequences/_header.html.haml +11 -0
  127. data/app/views/maily_herald/webui/sequences/_list.html.haml +21 -0
  128. data/app/views/maily_herald/webui/sequences/_mailing_list.html.haml +21 -0
  129. data/app/views/maily_herald/webui/sequences/_mailings.html.haml +7 -0
  130. data/app/views/maily_herald/webui/sequences/update_form.js.erb +14 -0
  131. data/app/views/maily_herald/webui/shared/_context_attributes.html.haml +11 -0
  132. data/app/views/maily_herald/webui/subscribers/_item.html.haml +8 -0
  133. data/app/views/maily_herald/webui/subscribers/_list.html.haml +18 -0
  134. data/app/views/maily_herald/webui/subscription_groups/_form.html.haml +5 -0
  135. data/app/views/maily_herald/webui/subscription_groups/_subscription.html.haml +8 -0
  136. data/app/views/maily_herald/webui/subscription_groups/_subscription_list.html.haml +19 -0
  137. data/app/views/maily_herald/webui/subscription_groups/edit.html.haml +16 -0
  138. data/app/views/maily_herald/webui/subscription_groups/index.html.haml +35 -0
  139. data/app/views/maily_herald/webui/subscription_groups/new.html.haml +11 -0
  140. data/app/views/maily_herald/webui/subscription_groups/show.html.haml +42 -0
  141. data/app/views/maily_herald/webui/subscription_groups/show.js.erb +1 -0
  142. data/app/views/maily_herald/webui/subscriptions/show.html.haml +21 -0
  143. data/app/views/maily_herald/webui/subscriptions/toggle.js.erb +1 -0
  144. data/app/views/maily_herald/webui/webui/index.html.haml +136 -0
  145. data/app/views/maily_herald/webui/webui/show.html.haml +0 -0
  146. data/config/database.yml +5 -0
  147. data/config/initializers/smart_listing.rb +77 -0
  148. data/config/locales/en.yml +237 -0
  149. data/config/routes.rb +103 -0
  150. data/config/spring.rb +1 -0
  151. data/lib/maily_herald/webui.rb +15 -0
  152. data/lib/maily_herald/webui/breadcrumbs.rb +50 -0
  153. data/lib/maily_herald/webui/engine.rb +18 -0
  154. data/lib/maily_herald/webui/form_builder.rb +285 -0
  155. data/lib/maily_herald/webui/menu_manager.rb +66 -0
  156. data/lib/maily_herald/webui/version.rb +5 -0
  157. data/maily_herald-webui.gemspec +40 -0
  158. data/script/rails +8 -0
  159. data/spec/dummy/Guardfile +35 -0
  160. data/spec/dummy/README.rdoc +261 -0
  161. data/spec/dummy/Rakefile +7 -0
  162. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  163. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  164. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  165. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  166. data/spec/dummy/app/mailers/.gitkeep +0 -0
  167. data/spec/dummy/app/mailers/test_mailer.rb +11 -0
  168. data/spec/dummy/app/models/.gitkeep +0 -0
  169. data/spec/dummy/app/models/user.rb +7 -0
  170. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  171. data/spec/dummy/app/views/test_mailer/sample_mail.text.erb +1 -0
  172. data/spec/dummy/bin/rails +10 -0
  173. data/spec/dummy/bin/rake +7 -0
  174. data/spec/dummy/bin/rspec +7 -0
  175. data/spec/dummy/bin/spring +18 -0
  176. data/spec/dummy/config.ru +4 -0
  177. data/spec/dummy/config/application.rb +65 -0
  178. data/spec/dummy/config/boot.rb +10 -0
  179. data/spec/dummy/config/database.yml +25 -0
  180. data/spec/dummy/config/environment.rb +5 -0
  181. data/spec/dummy/config/environments/development.rb +38 -0
  182. data/spec/dummy/config/environments/production.rb +67 -0
  183. data/spec/dummy/config/environments/test.rb +37 -0
  184. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  185. data/spec/dummy/config/initializers/inflections.rb +15 -0
  186. data/spec/dummy/config/initializers/maily_herald.rb +101 -0
  187. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  188. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  189. data/spec/dummy/config/initializers/session_store.rb +8 -0
  190. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  191. data/spec/dummy/config/locales/en.yml +5 -0
  192. data/spec/dummy/config/locales/maily_herald.en.yml +28 -0
  193. data/spec/dummy/config/routes.rb +4 -0
  194. data/spec/dummy/db/migrate/20130723074347_create_users.rb +11 -0
  195. data/spec/dummy/db/migrate/20140804152249_create_maily_herald_tables.maily_herald.rb +68 -0
  196. data/spec/dummy/db/migrate/20140804152250_create_lists.maily_herald.rb +33 -0
  197. data/spec/dummy/db/schema.rb +79 -0
  198. data/spec/dummy/lib/assets/.gitkeep +0 -0
  199. data/spec/dummy/lib/tasks/dummy.rb +8 -0
  200. data/spec/dummy/log/.gitkeep +0 -0
  201. data/spec/dummy/public/404.html +26 -0
  202. data/spec/dummy/public/422.html +26 -0
  203. data/spec/dummy/public/500.html +25 -0
  204. data/spec/dummy/public/favicon.ico +0 -0
  205. data/spec/dummy/script/rails +6 -0
  206. data/spec/spec_helper.rb +46 -0
  207. data/vendor/assets/fonts/maily_herald/webui/FontAwesome.otf +0 -0
  208. data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.eot +0 -0
  209. data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.svg +1816 -0
  210. data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.ttf +0 -0
  211. data/vendor/assets/fonts/maily_herald/webui/Nexa_Free_Bold-webfont.woff +0 -0
  212. data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.eot +0 -0
  213. data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.svg +520 -0
  214. data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.ttf +0 -0
  215. data/vendor/assets/fonts/maily_herald/webui/fontawesome-webfont.woff +0 -0
  216. data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.eot +0 -0
  217. data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.svg +1825 -0
  218. data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.ttf +0 -0
  219. data/vendor/assets/fonts/maily_herald/webui/opensans-bold-webfont.woff +0 -0
  220. data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.eot +0 -0
  221. data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.svg +1825 -0
  222. data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.ttf +0 -0
  223. data/vendor/assets/fonts/maily_herald/webui/opensans-italic-webfont.woff +0 -0
  224. data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.eot +0 -0
  225. data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.svg +1825 -0
  226. data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.ttf +0 -0
  227. data/vendor/assets/fonts/maily_herald/webui/opensans-regular-webfont.woff +0 -0
  228. data/vendor/assets/javascripts/maily_herald/webui/bootstrap-datepicker.js +1681 -0
  229. data/vendor/assets/javascripts/maily_herald/webui/bootstrap.min.js +6 -0
  230. data/vendor/assets/javascripts/maily_herald/webui/d3.v3.js +5 -0
  231. data/vendor/assets/javascripts/maily_herald/webui/rickshaw.js +4067 -0
  232. data/vendor/assets/stylesheets/maily_herald/webui/bootstrap-datepicker.css +786 -0
  233. data/vendor/assets/stylesheets/maily_herald/webui/bootstrap.min.css +5 -0
  234. data/vendor/assets/stylesheets/maily_herald/webui/font-awesome.min.css +4 -0
  235. data/vendor/assets/stylesheets/maily_herald/webui/rickshaw.css +355 -0
  236. metadata +564 -0
@@ -0,0 +1 @@
1
+ <%= smart_listing_update(:entities) %>
@@ -0,0 +1 @@
1
+ <%= smart_listing_item :mailings, :update, @mailing, @mailing.valid? ? "/maily_herald/webui/mailings/mailing" : "/maily_herald/webui/mailings/form" %>
@@ -0,0 +1 @@
1
+ $("#entities").smart_listing().fadeLoaded();
@@ -0,0 +1,65 @@
1
+ = render partial: "header"
2
+
3
+ - if @item.disabled?
4
+ .alert.alert-warning= tw("mailings.infos.disabled")
5
+ - elsif @item.archived?
6
+ .alert.alert-info= tw("mailings.infos.archived")
7
+
8
+ .dl-horizontal
9
+ - content_for_expert do
10
+ %dt= tw("attributes.name")
11
+ %dd= @item.name
12
+ %dt= tw("attributes.title")
13
+ %dd= @item.title
14
+
15
+ %dt
16
+ = tw("attributes.mailer")
17
+ = display_help_icon :mailer_name, scope: "mailings"
18
+ %dd= display_mailing_mailer @item.mailer_name
19
+
20
+ %dt
21
+ = @item.class.human_attribute_name(:from)
22
+ = display_help_icon "from", scope: "mailings"
23
+ %dd= display_mailing_from @item
24
+
25
+ %dt= tw(:label_list)
26
+ %dd= link_to friendly_name(@item.list), list_path(@item.list)
27
+
28
+
29
+ %p
30
+
31
+ = render_context_attributes_info @item.list
32
+
33
+ - if @item.periodical?
34
+ %p
35
+
36
+ .dl-horizontal
37
+ %dt= @item.class.human_attribute_name(:start_at)
38
+ %dd= @item.start_at
39
+
40
+ %dt= @item.class.human_attribute_name(:period)
41
+ %dd= display_mailing_period @item
42
+ - elsif @item.sequence?
43
+ %p
44
+
45
+ .dl-horizontal
46
+ %dt= @item.class.human_attribute_name(:absolute_delay)
47
+ %dd= display_mailing_absolute_delay @item
48
+
49
+
50
+ %p
51
+
52
+ .dl-horizontal
53
+ %dt= tw("attributes.conditions")
54
+ %dd
55
+ - if @item.conditions.present?
56
+ %code= @item.conditions
57
+ - else
58
+ = tw(:label_no_conditions)
59
+ %dt
60
+ = tw("attributes.override_subscription")
61
+ = display_help_icon("override_subscription", scope: "mailings")
62
+ %dd
63
+ = boolean_icon(@item.override_subscription, text: :yes)
64
+
65
+ %p
@@ -0,0 +1,39 @@
1
+ - unless @item.new_record?
2
+ = render partial: "header"
3
+
4
+ = form_for(@item, :url => {:action => "update"}, :as => :item, :layout => :horizontal, :remote => !@item.new_record?, :control_col => "col-sm-5", help_scope: "mailings", html: {class: "dispatch-form"}, data: {update_form_path: url_for(action: "update_form") }) do |f|
5
+ - if f.object.new_record?
6
+ %h2= tw("dispatches.general")
7
+
8
+ - content_for_expert do
9
+ = f.text_field :name
10
+ = f.text_field :title
11
+ = f.maily_mailer_select help: true
12
+ = f.maily_from_field help: true
13
+ - if @item.new_record? && !@item.sequence?
14
+ = f.maily_list_select
15
+
16
+ .form-group
17
+ %label.control-label.col-sm-2= tw("attributes.context")
18
+ .col-sm-5
19
+ %p.help-block.context-name
20
+ = link_to_context_attributes_overview(@item.list, text: true) || tw("dispatches.no_context")
21
+
22
+ - if @item.periodical?
23
+ = render partial: "form_periodical", locals: {f: f}
24
+ - elsif @item.sequence?
25
+ = render partial: "form_sequence", locals: {f: f}
26
+
27
+ = f.text_area :conditions
28
+ = f.check_box :override_subscription
29
+
30
+ - if f.object.new_record?
31
+ .template-generic
32
+ = render partial: "form_template_generic", locals: {f: f}
33
+ .template-mailer
34
+ = render partial: "form_template_mailer", locals: {f: f}
35
+
36
+ - if @item.new_record?
37
+ = f.buttons :create
38
+ - else
39
+ = f.buttons :save, :cancel
@@ -0,0 +1 @@
1
+ = render partial: "details_form"
@@ -0,0 +1,2 @@
1
+ = f.maily_start_at_field help: true
2
+ = f.maily_period_field
@@ -0,0 +1 @@
1
+ = f.maily_absolute_delay_field
@@ -0,0 +1,7 @@
1
+ %h2
2
+ = tw("mailings.template")
3
+ = link_to_context_attributes_overview f.object.list
4
+
5
+ = f.text_field :subject
6
+ -#= f.text_field :sender
7
+ = f.text_area :template, rows: 15, control_col: "col-sm-10"
@@ -0,0 +1,4 @@
1
+ %h2
2
+ = tw("mailings.template")
3
+
4
+ %p= tw("mailings.infos.non_generic_mailer", mailer: display_mailing_mailer(@item.mailer_name).html_safe, generic_mailer: display_mailing_mailer(:generic)).html_safe
@@ -0,0 +1,24 @@
1
+ %h1
2
+ - if @item.sequence?
3
+ = link_to @item.sequence do
4
+ %span.resource-name= friendly_name @item.sequence
5
+ &raquo;
6
+ %span.resource-name= friendly_name @item
7
+ - unless @item.locked?
8
+ = link_to({action: "toggle", id: @item}, :remote => true, :class => "link link-sm dispatch-state", :confirm => @item.enabled? ? t(".disable_confirm") : t(".enable_confirm"), :method => :post) do
9
+ = display_dispatch_state @item
10
+ = link_to({action: "edit", id: @item}, :remote => true, :class => "link link-sm") do
11
+ = icon(:pencil)
12
+ = tw("commons.edit")
13
+ - else
14
+ %a.link.link-sm.text-warning{:data => {:toggle => "tooltip", :placement => "top"}, :title => tw("dispatches.locked_info")}
15
+ = icon(:lock)
16
+ = tw("commons.locked")
17
+ - if @item.enabled? && @item.one_time?
18
+ = link_to({action: "deliver", id: @item}, :method => :post, :remote => true, :data => {:confirm => tw("one_time_mailings.header.confirm_run")}, :class => "link link-sm") do
19
+ = icon(:send)
20
+ = tw("commons.run")
21
+ - unless @item.locked? || @item.archived?
22
+ = link_to({action: "destroy", id: @item}, :method => :delete, :remote => true, :data => {:confirm => t(".confirm_archive")}, :class => "link link-sm") do
23
+ = icon(:archive)
24
+ = tw("commons.archive")
@@ -0,0 +1,27 @@
1
+ - unless smart_listing.empty?
2
+ %table.table.table-striped
3
+ %thead
4
+ %tr
5
+ %th.col-md-3= tw("attributes.title")
6
+ - if @sequence
7
+ %th= MailyHerald::SequenceMailing.human_attribute_name(:absolute_delay)
8
+ %th= tw("attributes.state")
9
+ %th= tw(:label_list)
10
+ %th= tw("attributes.mailer")
11
+ %th
12
+ %tbody
13
+ - smart_listing.collection.each do |mailing|
14
+ %tr
15
+ %td= link_to_mailing mailing
16
+ - if @sequence
17
+ %td= distance_of_time_in_words(mailing.absolute_delay)
18
+ %td= display_dispatch_state mailing
19
+ %td= link_to friendly_name(mailing.list), list_path(mailing.list)
20
+ %td= display_mailing_mailer mailing.mailer_name
21
+ %td.actions
22
+ .action-group= smart_listing_item_actions [{name: :show, url: url_for_mailing(mailing)}]
23
+
24
+ = smart_listing.paginate
25
+ = smart_listing.pagination_per_page_links
26
+ - else
27
+ = t(".no_mailings")
@@ -0,0 +1,16 @@
1
+ - if @item.generic_mailer?
2
+ %h2.border
3
+ = tw("mailings.template")
4
+ = link_to({action: "edit", id: @item, :edited_container => "template"}, :remote => true, :class => "link link-sm") do
5
+ = icon(:pencil)
6
+ = tw("commons.edit")
7
+ .dl-horizontal
8
+ %dt= tw("attributes.subject")
9
+ %dd= @item.subject
10
+ %br
11
+ %pre= @item.template
12
+ %br
13
+ - else
14
+ %h2.border
15
+ = tw("mailings.template")
16
+ %p= tw("mailings.infos.non_generic_mailer", mailer: display_mailing_mailer(@item.mailer_name).html_safe, generic_mailer: display_mailing_mailer(:generic)).html_safe
@@ -0,0 +1,7 @@
1
+ = form_for @item, :as => :item, :layout => :horizontal, :remote => !@item.new_record?, :control_col => "col-sm-5", html: {class: "edit-mailing-template-form"} do |f|
2
+ = hidden_field_tag :edited_container, "template"
3
+ - if @item.generic_mailer?
4
+ = render partial: "form_template_generic", locals: {f: f}
5
+ - else
6
+ = render partial: "form_template_mailer", locals: {f: f}
7
+ = f.buttons :save, :cancel
@@ -0,0 +1,3 @@
1
+ %li
2
+ = link_to archived_one_time_mailings_path do
3
+ = icon :archive, tw("mailings.archived.label")
@@ -0,0 +1,13 @@
1
+ - content_for :modal_title do
2
+ = t(".title")
3
+
4
+ .box.noborder
5
+ .dl-horizontal
6
+ %dt= tw("attributes.mailing")
7
+ %dd= friendly_name @item
8
+ %dt= tw("attributes.entity")
9
+ %dd= @e
10
+
11
+ .alert.alert-info= t(".info")
12
+
13
+ %pre= @mail
@@ -0,0 +1,33 @@
1
+ <% if @item.generic_mailer? %>
2
+ $(".template-generic").show();
3
+ $(".template-mailer").hide();
4
+ var link = "<%= escape_javascript(link_to_context_attributes_overview(@item.list)) %>";
5
+ if(link) {
6
+ if($(".template-generic h2 a").length == 1) {
7
+ $(".template-generic h2 a").replaceWith(link);
8
+ } else {
9
+ $(".template-generic h2").append(link);
10
+ }
11
+ } else {
12
+ $(".template-generic h2 a").remove();
13
+ }
14
+ <% else %>
15
+ $(".template-generic").hide();
16
+ $(".template-mailer").show();
17
+ $(".template-mailer p code:first-child").replaceWith("<%= escape_javascript(display_mailing_mailer(@item.mailer_name)) %>");
18
+ <% end %>
19
+
20
+ <% if @item.list.try(:context_name) %>
21
+ $(".context-name").html("<%= escape_javascript(link_to_context_attributes_overview(@item.list, text: true)) %>");
22
+ var btn = "<%= escape_javascript(link_to_context_attributes_overview(@item.list, class: "btn btn-default")) %>"
23
+ if($(".mailing-start-at .input-group-btn .btn").length == 2) {
24
+ $(".mailing-start-at .input-group-btn .btn:last-child").replaceWith(btn);
25
+ } else {
26
+ $(".mailing-start-at .input-group-btn").append(btn);
27
+ }
28
+ <% else %>
29
+ $(".context-name").html("<%= escape_javascript(tw("mailings.no_context")) %>");
30
+ if($(".mailing-start-at .input-group-btn .btn").length == 2) {
31
+ $(".mailing-start-at .input-group-btn .btn:last-child").remove();
32
+ }
33
+ <% end %>
@@ -0,0 +1,2 @@
1
+ $(".container-<%= @edited_container %>").editable("<%= escape_javascript(render(:partial => "#{@edited_container}_form")) %>");
2
+ $(".container-<%= @edited_container %>").find(".dispatch-form").handleDispatchForm();
@@ -0,0 +1,11 @@
1
+ = smart_listing_controls_for :items, :class => "context-menu" do
2
+ %ul.nav.nav-secondary
3
+ %li
4
+ = link_to(controller: controller_name, action: :new) do
5
+ = icon :plus
6
+ = tw("#{controller_name}.new.label")
7
+ = render :partial => "maily_herald/webui/#{controller_name}/nav_secondary/#{action_name}" rescue nil
8
+ %form{:action => ""}= filter_box
9
+
10
+
11
+ = smart_listing_render :items
@@ -0,0 +1 @@
1
+ <%= smart_listing_update(:items) %>
@@ -0,0 +1,5 @@
1
+ %h1
2
+ = link_to "<<", :action => :index
3
+ = tw("#{controller_name}.new.label", :action => :new)
4
+
5
+ = render :partial => "form"
@@ -0,0 +1,4 @@
1
+ - resource_spec.containers_order.each do |container|
2
+ - opts = resource_spec.update_containers[container]
3
+ %div{class: ["container-#{container}", ("resource-editable" if opts.try(:[], :editable))]}
4
+ = render partial: container
@@ -0,0 +1,3 @@
1
+ <% resource_spec.containers_order.each do |container| %>
2
+ <%= smart_listing_update(container.to_sym) if @smart_listings[container.to_sym] %>
3
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <% if @item.valid? %>
2
+ <% @rendered_containers.each do |name, opts| %>
3
+ <% opts = resource_spec.update_containers[name] %>
4
+ <% editable = opts.is_a?(Hash) ? opts[:editable] : false %>
5
+
6
+ <% if editable %>
7
+ $(".container-<%= name %>").editable("<%= escape_javascript(render(:partial => name)) %>");
8
+ <% else %>
9
+ $(".container-<%= name %>").html("<%= escape_javascript(render(:partial => name)) %>");
10
+ <% end %>
11
+ <% end %>
12
+
13
+ $(".resource-name").html("<%= friendly_name(@item) %>");
14
+ <% else %>
15
+ $(".container-<%= @edited_container %>").editable("<%= escape_javascript(render(:partial => "#{@edited_container}_form")) %>");
16
+ <% end %>
17
+
18
+ <%= render(partial: action_name) rescue nil %>
@@ -0,0 +1,11 @@
1
+ %td= object.id
2
+ %td= object.to_s
3
+ %td= @sequence.destination_for object
4
+ %td= @sequence.subscription_for(object).logs.length
5
+ %td
6
+ - if @sequence.subscription_for(object).active?
7
+ %span.glyphicon.glyphicon-ok
8
+ - else
9
+ %span.glyphicon.glyphicon-remove
10
+ %td.actions
11
+ = smart_listing_item_actions sequence_entity_list_actions(object)
@@ -0,0 +1,23 @@
1
+ - unless smart_listing.collection.empty?
2
+ %table.table.table-listing
3
+ %thead
4
+ %tr
5
+ %th Id
6
+ %th Name
7
+ %th Destination
8
+ %th.span2.span1
9
+ %span.glyphicon.glyphicon-download-alt{:title => "Deliveries count"}
10
+ %th.span2.span1
11
+ %span.glyphicon.glyphicon-book{:title => "Subscription active?"}
12
+ %th.span1
13
+
14
+ %tbody
15
+ - smart_listing.collection.each do |entity|
16
+ %tr.editable{:data => {"id" => entity.id}}
17
+ = render :partial => "maily_herald/webui/sequences/entity", :locals => {:object => entity}
18
+
19
+ .row
20
+ .col-xs-6= smart_listing.paginate
21
+ .col-xs-6= smart_listing.pagination_per_page_links
22
+ - else
23
+ %p.alert No entities in the scope
@@ -0,0 +1,17 @@
1
+ = labelled_form_for @sequence, :url => @sequence.new_record? ? webui_sequences_path : webui_sequence_path(@sequence) do |f|
2
+ = f.text_field :title
3
+ %hr
4
+ = f.check_box :autosubscribe, :help => "Check this if you want new entities within the scope to be automatically subscribed"
5
+ = f.check_box :override_subscription, :help => "Check this if you want to send this mailing regardless of entity subscription"
6
+ = f.select :subscription_group, maily_herald_subscription_group_options_for_select
7
+ = f.select :token_action, maily_herald_token_action_options_for_select
8
+ %hr
9
+ = f.select :context_name, maily_herald_context_options_for_select
10
+ %hr
11
+ %p
12
+ %em Please supply here sequence start date. You can specify this either as an absolute date or evaluated context variable. If both specified, absolute start date will be taken under consideration.
13
+ = f.datetime :start_text, :comment => Time.zone
14
+ = f.text_field :start_var, :comment => context_attributes_link(:notext => true, :context => @sequence.context ? @sequence.context.name : ""), :help => "Type here valid context variable that will be evaluated into start date (i.e. 'user.activated_at')"
15
+ %hr
16
+ -#= f.text_field :delay
17
+ = f.buttons :submit
@@ -0,0 +1,7 @@
1
+ %td= object.id
2
+ %td= object.processed_at
3
+ %td= object.mailing.title
4
+ %td
5
+ %em ...
6
+ %td
7
+ %em ...
@@ -0,0 +1,16 @@
1
+ - unless @logs.empty?
2
+ %table.table.table-striped
3
+ %thead
4
+ %tr
5
+ %th Id
6
+ %th Delivery date
7
+ %th Mailing
8
+ %th Opened
9
+ %th Opened at
10
+
11
+ %tbody
12
+ - @logs.each do |log|
13
+ %tr
14
+ = render :partial => "maily_herald/webui/sequences/log", :locals => {:object => log}
15
+ - else
16
+ %p.alert No delivery logs
@@ -0,0 +1,4 @@
1
+ %td= object.title
2
+ %td= distance_of_time_in_words object.absolute_delay
3
+ %td.actions
4
+ = smart_listing_item_actions sequence_mailing_list_actions(object)
@@ -0,0 +1,19 @@
1
+ - unless smart_listing.collection.empty?
2
+ %table.table.table-listing
3
+ %thead
4
+ %tr
5
+ %th Title
6
+ %th.span2 Absolute Delay
7
+ %th.span1
8
+
9
+ %tbody
10
+ - smart_listing.collection.each do |mailing|
11
+ %tr.editable{:data => {"id" => mailing.id}}
12
+ = render :partial => "maily_herald/webui/sequences/mailing", :locals => {:object => mailing}
13
+
14
+ .row
15
+ .col-xs-6= smart_listing.paginate
16
+ .col-xs-6= smart_listing.pagination_per_page_links
17
+
18
+ - else
19
+ %p.alert No mailings