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,14 @@
1
+ %ul.breadcrumb
2
+ %li
3
+ = link_to webui_sequences_mailings_path do
4
+ Sequence
5
+ %li
6
+ = link_to webui_sequence_path do
7
+ = @sequence.title
8
+ %li.active
9
+ Edit
10
+
11
+ %h2.border
12
+ = @sequence.title
13
+
14
+ = render :partial => 'form'
@@ -0,0 +1,13 @@
1
+ .row
2
+ .col-sm-6
3
+ %ul.breadcrumb
4
+ %li
5
+ = link_to do
6
+ Sequence
7
+ %li.active
8
+ New sequence
9
+
10
+ %h2.border
11
+ New sequence
12
+
13
+ = render :partial => 'form'
@@ -0,0 +1,122 @@
1
+ .row
2
+ .col-xs-4
3
+ %ul.breadcrumb
4
+ %li
5
+ %a= link_to 'Sequence', webui_sequences_mailings_path
6
+ %li.active
7
+ = @sequence.title
8
+
9
+ .col-xs-8
10
+ %ul.nav.nav-secondary.pull-right
11
+ %li
12
+ = link_to new_webui_sequence_mailing_path(:sequence_id => @sequence) do
13
+ %span.glyphicon.glyphicon-plus
14
+ New mailing
15
+
16
+ %li
17
+ - if @sequence.enabled?
18
+ %strong.text-success
19
+ Enabled
20
+ = link_to toggle_webui_sequence_path do
21
+ %span.glyphicon.glyphicon-off
22
+ Disable
23
+ - else
24
+ %strong.text-warning
25
+ Disabled
26
+ %span.divider
27
+ = link_to toggle_webui_sequence_path do
28
+ %span.glyphicon.glyphicon-repeat
29
+ Enable
30
+ %li
31
+ = link_to edit_webui_sequence_path do
32
+ %span.glyphicon.glyphicon-pencil
33
+ Edit
34
+ %li
35
+ = link_to webui_sequence_path, :method => :delete, :confirm => 'Are you sure?' do
36
+ %span.glyphicon.glyphicon-trash
37
+ Delete
38
+ .row
39
+ .col-xs-12
40
+ %h2.border= @sequence.title
41
+ .box
42
+ - unless @sequence.enabled?
43
+ .alert
44
+ This sequence
45
+ %strong
46
+ will not be delivered
47
+ because it is disabled.
48
+
49
+ %dl.dl-horizontal
50
+ %dt Name:
51
+ %dd= @sequence.name
52
+ %dt Start:
53
+ %dd= @sequence.start ? "#{@sequence.start_text} #{Time.zone}" : "none"
54
+ %dt Start variable:
55
+ %dd= @sequence.start_var && !@sequence.start_var.empty? ? @sequence.start_var : "none"
56
+ %dt Autosubscribe:
57
+ %dd
58
+ - if @sequence.autosubscribe?
59
+ %span.glyphicon.glyphicon-ok
60
+ - else
61
+ %span.glyphicon.glyphicon-remove
62
+ %dt Subscription group:
63
+ %dd
64
+ - if @sequence.subscription_group
65
+ = @sequence.subscription_group
66
+ - else
67
+ %span.glyphicon.glyphicon-minus
68
+ %dt Subscription override:
69
+ %dd
70
+ - if @sequence.override_subscription?
71
+ %span.glyphicon.glyphicon-ok
72
+ - else
73
+ %span.glyphicon.glyphicon-remove
74
+ %dt Token action
75
+ %dd= @sequence.token_action
76
+
77
+ .row
78
+ .col-xs-12
79
+ %h2.border Context
80
+ .box
81
+ %dl.dl-horizontal
82
+ %dt Name:
83
+ %dd= @sequence.context.name
84
+ %dt Model name:
85
+ %dd= @context.model
86
+ %dt Context attributes:
87
+ %dd
88
+ = context_attributes_link(:context => @sequence.context ? @sequence.context.name : "")
89
+ .row
90
+ .col-xs-12
91
+ %h2.border Entities
92
+ = form_tag({}, :remote => true, :method => :get, :class => 'smart_listing_controls form-inline pull-right', :data => {:smart_listing => "sequence_entities"}) do
93
+ .filter.input-append.filter-search
94
+ = text_field_tag :filter, '', :class => "search", :placeholder => "Type filter here ", :autocomplete => "off"
95
+ %button.btn.disabled{:type => "submit"}
96
+ %span.glyphicon.glyphicon-search
97
+ %p
98
+ List of all
99
+ %strong= @context.model
100
+ entities in the scope
101
+
102
+ = smart_listing_for(:sequence_entities) do |smart_listing|
103
+ = smart_listing.render_list
104
+
105
+ .row
106
+ .col-xs-12
107
+ .row
108
+ .col-xs-10
109
+ %h2.border Mailings
110
+
111
+ .col-xs-2
112
+ %ul.nav.nav-secondary.no-margin.pull-right
113
+ %li
114
+ = link_to new_webui_sequence_mailing_path(:sequence_id => @sequence) do
115
+ %span.glyphicon.glyphicon-plus
116
+ Add mailing
117
+
118
+ .col-xs-12
119
+ = smart_listing_for(:sequence_mailings) do |smart_listing|
120
+ = smart_listing.render_list
121
+
122
+
@@ -0,0 +1,2 @@
1
+ <%= smart_listing_update(:sequence_entities) %>
2
+ <%= smart_listing_update(:sequence_mailings) %>
@@ -0,0 +1,79 @@
1
+ %ul.breadcrumb
2
+ %li
3
+ Sequence
4
+ %em
5
+ = link_to @sequence.title, webui_sequence_path(:id => @sequence)
6
+ %span.divider
7
+ >
8
+ %li
9
+ Entity
10
+ %em
11
+ = @context.model
12
+ = "##{@entity.id}: #{@entity}"
13
+ %li.pull-right
14
+ = link_to toggle_subscription_webui_sequence_path do
15
+ %i.icon.icon-edit
16
+ = @subscription.active? ? "Unsubscribe" : "Subscribe"
17
+ %span.divider
18
+ = link_to webui_sequence_path do
19
+ %i.icon.icon-arrow-left
20
+ Back
21
+
22
+ - unless @subscription.processable?
23
+ .alert
24
+ This sequence
25
+ %strong
26
+ will not be sent
27
+ to this entity. See the status.
28
+
29
+ %h4 Status
30
+
31
+ %dl.dl-horizontal
32
+ %dt Sequence enabled
33
+ %dd
34
+ - if @sequence.enabled?
35
+ %i.icon.icon-ok
36
+ - else
37
+ %i.icon.icon-remove
38
+ %dt Subscription active
39
+ %dd
40
+ - if @subscription.active?
41
+ %i.icon.icon-ok
42
+ - else
43
+ %i.icon.icon-remove
44
+ %dt Last processing:
45
+ - if @subscription.last_processing_time
46
+ %dd= @subscription.last_processing_time
47
+ - else
48
+ %dd Never
49
+ %dt Scheduled processing
50
+ %dd
51
+ = @subscription.next_processing_time || "None"
52
+ - if @subscription.next_processing_time
53
+ = "(#{"in " if @subscription.next_processing_time > Time.now}#{distance_of_time_in_words(@subscription.next_processing_time, Time.now)}#{" ago" if @subscription.next_processing_time < Time.now})"
54
+
55
+ .sequence-mailings
56
+ %h6 Processed mailings
57
+
58
+ = smart_listing_for(:processed_mailings) do |smart_listing|
59
+ = smart_listing.render_list
60
+
61
+ %h6 Pending mailings
62
+
63
+ = smart_listing_for(:pending_mailings) do |smart_listing|
64
+ = smart_listing.render_list
65
+
66
+ %h4 Preview
67
+ .previews
68
+ - @sequence.mailings.each do |m|
69
+ .preview{:id => "mailing-#{m.id}", :data => {:id => m.id}}
70
+ %h6
71
+ Mailing
72
+ %strong= m.title
73
+ %pre= @subscription.render_template m
74
+ %br
75
+
76
+ %h4 Logs
77
+
78
+ = smart_listing_for(:logs) do |smart_listing|
79
+ = smart_listing.render_list
@@ -0,0 +1,39 @@
1
+ = render partial: "header"
2
+
3
+ - if @item.disabled?
4
+ .alert.alert-warning= tw("sequences.infos.disabled")
5
+ - elsif @item.archived?
6
+ .alert.alert-info= tw("sequences.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= tw(:label_list)
16
+ %dd= link_to friendly_name(@item.list), list_path(@item.list)
17
+
18
+
19
+ %p
20
+
21
+ = render_context_attributes_info @item.list
22
+
23
+ %p
24
+
25
+ .dl-horizontal
26
+ %dt= @item.class.human_attribute_name(:start_at)
27
+ %dd= @item.start_at
28
+
29
+
30
+ %p
31
+
32
+ .dl-horizontal
33
+ %dt
34
+ = tw("attributes.override_subscription")
35
+ = display_help_icon("override_subscription", scope: "mailings")
36
+ %dd
37
+ = boolean_icon(@item.override_subscription, text: :yes)
38
+
39
+ %p
@@ -0,0 +1,27 @@
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", help_scope: "sequences", 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
+ - if @item.new_record?
12
+ = f.maily_list_select
13
+
14
+ .form-group
15
+ %label.control-label.col-sm-2= tw("attributes.context")
16
+ .col-sm-5
17
+ %p.help-block.context-name
18
+ = link_to_context_attributes_overview(@item.list, text: true) || tw("dispatches.no_context")
19
+
20
+ = f.maily_start_at_field help: true
21
+
22
+ = f.check_box :override_subscription
23
+
24
+ - if @item.new_record?
25
+ = f.buttons :create
26
+ - else
27
+ = f.buttons :save, :cancel
@@ -0,0 +1 @@
1
+ = render partial: "details_form"
@@ -0,0 +1,11 @@
1
+ %h1
2
+ %span.resource-name= friendly_name @item
3
+ = link_to({action: "toggle", id: @item}, :remote => true, :class => "link link-sm dispatch-state", :confirm => @item.enabled? ? tw("sequences.header.disable_confirm") : tw("sequences.header.enable_confirm"), :method => :post) do
4
+ = display_dispatch_state @item
5
+ = link_to({action: "edit", id: @item}, :remote => true, :class => "link link-sm") do
6
+ = icon(:pencil)
7
+ = tw("commons.edit")
8
+ - unless @item.archived?
9
+ = link_to({action: "destroy", id: @item}, :method => :delete, :remote => true, :data => {:confirm => tw("sequences.header.confirm_archive")}, :class => "link link-sm") do
10
+ = icon(:archive)
11
+ = tw("commons.archive")
@@ -0,0 +1,21 @@
1
+ - unless smart_listing.empty?
2
+ %table.table.table-striped
3
+ %thead
4
+ %tr
5
+ %th.col-md-6= tw("attributes.title")
6
+ %th= tw("attributes.state")
7
+ %th= tw(:label_list)
8
+ %th
9
+ %tbody
10
+ - smart_listing.collection.each do |sequence|
11
+ %tr
12
+ %td= link_to friendly_name(sequence), {:action => :show, :id => sequence}
13
+ %td= display_dispatch_state sequence
14
+ %td= link_to friendly_name(sequence.list), list_path(sequence.list)
15
+ %td.actions
16
+ .action-group= smart_listing_item_actions [{name: :show, url: {action: :show, id: sequence}}]
17
+
18
+ = smart_listing.paginate
19
+ = smart_listing.pagination_per_page_links
20
+ - else
21
+ = t(".no_mailings")
@@ -0,0 +1,21 @@
1
+ - unless smart_listing.empty?
2
+ %table.table.table-striped
3
+ %thead
4
+ %tr
5
+ - content_for_expert do
6
+ %th #
7
+ %th.col-md-6= MailyHerald::SequenceMailing.human_attribute_name(:title)
8
+ %th.col-md-6= MailyHerald::SequenceMailing.human_attribute_name(:absolute_delay)
9
+ %th
10
+ %tbody
11
+ - smart_listing.collection.each do |mailing|
12
+ %tr
13
+ %td= friendly_name mailing
14
+ %td= display_mailing_absolute_delay mailing
15
+ %td.actions
16
+ .action-group= smart_listing_item_actions sequence_mailing_actions(mailing)
17
+
18
+ = smart_listing.paginate
19
+ = smart_listing.pagination_per_page_links
20
+ - else
21
+ = tw("mailings.list.no_mailings")
@@ -0,0 +1,7 @@
1
+ %h2.border
2
+ = tw(:label_sequence_mailing_plural)
3
+ = link_to(new_sequence_mailing_path(sequence_id: @item), :class => "link link-sm") do
4
+ = icon(:plus)
5
+ = tw("sequence_mailings.new.label")
6
+
7
+ = smart_listing_render :mailings
@@ -0,0 +1,14 @@
1
+ <% if @item.list.try(:context_name) %>
2
+ $(".context-name").html("<%= escape_javascript(link_to_context_attributes_overview(@item.list, text: true)) %>");
3
+ var btn = "<%= escape_javascript(link_to_context_attributes_overview(@item.list, class: "btn btn-default")) %>"
4
+ if($(".dispatch-start-at .input-group-btn .btn").length == 2) {
5
+ $(".dispatch-start-at .input-group-btn .btn:last-child").replaceWith(btn);
6
+ } else {
7
+ $(".dispatch-start-at .input-group-btn").append(btn);
8
+ }
9
+ <% else %>
10
+ $(".context-name").html("<%= escape_javascript(tw("mailings.no_context")) %>");
11
+ if($(".dispatch-start-at .input-group-btn .btn").length == 2) {
12
+ $(".dispatch-start-at .input-group-btn .btn:last-child").remove();
13
+ }
14
+ <% end %>
@@ -0,0 +1,11 @@
1
+ .dl-horizontal
2
+ %dt= tw("attributes.context")
3
+ %dd
4
+ = friendly_name list.context
5
+ = link_to_context_attributes_overview list
6
+ - content_for_expert do
7
+ %dt= tw("attributes.context_name")
8
+ %dd= list.context.name
9
+ %dt= tw("attributes.context_model_name")
10
+ %dd
11
+ %code= list.context.model.name
@@ -0,0 +1,8 @@
1
+ - content_for_expert do
2
+ %td= item.id
3
+ %td= item.to_s
4
+ %td= @list.context.destination_for(item)
5
+ %td.actions
6
+ - if @mailing
7
+ .action-group= smart_listing_item_actions mailing_subscriber_actions(@mailing, item)
8
+ .action-group= smart_listing_item_actions subscriber_actions(@list, item)
@@ -0,0 +1,18 @@
1
+ - unless smart_listing.empty?
2
+ %table.table.table-striped
3
+ %thead
4
+ %tr
5
+ - content_for_expert do
6
+ %th #
7
+ %th.col-md-6= t(".name")
8
+ %th.col-md-6= t(".email")
9
+ %th
10
+ %tbody
11
+ - smart_listing.collection.each do |entity|
12
+ %tr.editable{data: {id: entity.id}}
13
+ = smart_listing.render partial: "maily_herald/webui/subscribers/item", locals: {item: entity}
14
+
15
+ = smart_listing.paginate
16
+ = smart_listing.pagination_per_page_links
17
+ - else
18
+ = t(".no_entities")
@@ -0,0 +1,5 @@
1
+ = labelled_form_for @subscription_group, :url => @subscription_group.new_record? ? webui_subscription_groups_path : webui_subscription_group_path(@subscription_group) do |f|
2
+ = f.text_field :title
3
+ - unless f.object.new_record?
4
+ = f.text_field :name
5
+ = f.buttons :submit