ish_manager 0.1.8.354 → 0.1.8.356

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +105 -10
  3. data/app/assets/javascripts/ish_manager/email_contexts.js +1 -1
  4. data/app/assets/javascripts/ish_manager/email_templates.js +20 -0
  5. data/app/assets/stylesheets/ish_manager/application.scss +91 -8
  6. data/app/assets/stylesheets/ish_manager/email.scss +44 -0
  7. data/app/assets/stylesheets/ish_manager/email_contexts.scss +84 -0
  8. data/app/assets/stylesheets/ish_manager/email_conversations.scss +143 -0
  9. data/app/assets/stylesheets/ish_manager/email_iframe.css +4 -0
  10. data/app/assets/stylesheets/ish_manager/email_messages.scss +15 -0
  11. data/app/assets/stylesheets/ish_manager/email_templates.scss +33 -53
  12. data/app/assets/stylesheets/ish_manager/leads_leadsets.scss +114 -0
  13. data/app/assets/stylesheets/ish_manager/scheduled_actions_emails.scss +25 -0
  14. data/app/assets/stylesheets/ish_manager/tags.scss +5 -0
  15. data/app/controllers/ish_manager/application_controller.rb +17 -2
  16. data/app/controllers/ish_manager/categories_controller.rb +14 -0
  17. data/app/controllers/ish_manager/email_actions_controller.rb +80 -0
  18. data/app/controllers/ish_manager/email_campaigns_controller.rb +13 -0
  19. data/app/controllers/ish_manager/email_contexts_controller.rb +41 -48
  20. data/app/controllers/ish_manager/email_conversations_controller.rb +20 -0
  21. data/app/controllers/ish_manager/email_filters_controller.rb +47 -0
  22. data/app/controllers/ish_manager/email_messages_controller.rb +21 -3
  23. data/app/controllers/ish_manager/email_templates_controller.rb +23 -10
  24. data/app/controllers/ish_manager/leads_controller.rb +3 -9
  25. data/app/controllers/ish_manager/leadset_tags_controller.rb +18 -0
  26. data/app/controllers/ish_manager/leadsets_controller.rb +28 -1
  27. data/app/controllers/ish_manager/scheduled_email_actions_controller.rb +38 -0
  28. data/app/helpers/ish_manager/application_helper.rb +17 -11
  29. data/app/mailers/ish_manager/office_mailer.rb +10 -9
  30. data/app/views/ish_manager/application/_alerts_notices.haml +18 -0
  31. data/app/views/ish_manager/application/_debug.haml +5 -4
  32. data/app/views/ish_manager/application/_main_footer.haml +1 -0
  33. data/app/views/ish_manager/application/_main_header_admin.haml +48 -59
  34. data/app/views/ish_manager/application/home.haml +1 -1
  35. data/app/views/ish_manager/categories/_subtree.haml +12 -0
  36. data/app/views/ish_manager/categories/index.haml +11 -0
  37. data/app/views/ish_manager/email_actions/_form.haml +42 -0
  38. data/app/views/ish_manager/email_actions/edit.haml +7 -0
  39. data/app/views/ish_manager/email_actions/index.haml +24 -0
  40. data/app/views/ish_manager/email_actions/new.haml +7 -0
  41. data/app/views/ish_manager/email_contexts/_form.haml +32 -30
  42. data/app/views/ish_manager/email_contexts/edit.haml +1 -1
  43. data/app/views/ish_manager/email_contexts/index.haml +27 -22
  44. data/app/views/ish_manager/email_contexts/show.haml +26 -15
  45. data/app/views/ish_manager/email_conversations/index.haml +49 -0
  46. data/app/views/ish_manager/email_conversations/show.haml +62 -0
  47. data/app/views/ish_manager/email_filters/_form.haml +12 -0
  48. data/app/views/ish_manager/email_filters/edit.haml +5 -0
  49. data/app/views/ish_manager/email_filters/index.haml +24 -0
  50. data/app/views/ish_manager/email_filters/new.haml +5 -0
  51. data/app/views/ish_manager/email_messages/_show_iframe.haml +8 -0
  52. data/app/views/ish_manager/email_messages/index.haml +2 -2
  53. data/app/views/ish_manager/email_messages/show.haml +28 -1
  54. data/app/views/ish_manager/email_messages/show_iframe.haml +6 -0
  55. data/app/views/ish_manager/email_messages/show_source.haml +5 -0
  56. data/app/views/ish_manager/email_messages/show_stripped.haml +2 -0
  57. data/app/views/ish_manager/email_templates/_form.haml +30 -14
  58. data/app/views/ish_manager/email_templates/_form_reply_2_mini.haml +15 -0
  59. data/app/views/ish_manager/email_templates/_form_reply_mini.haml +8 -0
  60. data/app/views/ish_manager/email_templates/_form_schedule_mini.haml +11 -0
  61. data/app/views/ish_manager/email_templates/_index.haml +24 -11
  62. data/app/views/ish_manager/email_templates/_piousbox_roundborders.html.erb +4 -1
  63. data/app/views/ish_manager/email_templates/done/_form.haml +22 -0
  64. data/app/views/ish_manager/email_templates/done/_form2.haml +26 -0
  65. data/app/views/ish_manager/email_templates/edit.haml +2 -1
  66. data/app/views/ish_manager/email_templates/iframe_src.haml +4 -3
  67. data/app/views/ish_manager/email_templates/new.haml +5 -0
  68. data/app/views/ish_manager/email_templates/show.haml +9 -3
  69. data/app/views/ish_manager/leads/_form.haml +11 -6
  70. data/app/views/ish_manager/leads/_form_import.haml +3 -3
  71. data/app/views/ish_manager/leads/edit.haml +19 -16
  72. data/app/views/ish_manager/leads/index.haml +25 -16
  73. data/app/views/ish_manager/leads/new.haml +8 -7
  74. data/app/views/ish_manager/leadsets/index.haml +67 -13
  75. data/app/views/ish_manager/leadsets/index_dataTables.haml +33 -0
  76. data/app/views/ish_manager/scheduled_actions/_form_mini.haml +16 -0
  77. data/app/views/ish_manager/scheduled_email_actions/_form.haml +26 -0
  78. data/app/views/ish_manager/scheduled_email_actions/index.haml +15 -0
  79. data/app/views/ish_manager/scheduled_email_actions/new.haml +4 -0
  80. data/app/views/ish_manager/scheduled_email_actions/show.haml +0 -0
  81. data/app/views/layouts/ish_manager/application.haml +2 -2
  82. data/app/views/layouts/ish_manager/application_fullwidth.haml +45 -0
  83. data/app/views/layouts/ish_manager/email_iframe.haml +6 -0
  84. data/config/routes.rb +18 -2
  85. data/lib/ish_manager/engine.rb +1 -0
  86. metadata +48 -6
  87. data/app/assets/stylesheets/ish_manager/leads.scss +0 -10
  88. data/app/controllers/ish_manager/office_actions_controller.rb +0 -59
  89. data/app/views/ish_manager/office_actions/_form.haml +0 -83
  90. data/app/views/ish_manager/office_actions/index.haml +0 -9
@@ -1,3 +1,3 @@
1
1
 
2
2
  .email-contexts-edit
3
- = render 'ish_manager/email_contexts/form', template: @template, email_ctx: @email_ctx
3
+ = render 'ish_manager/email_contexts/form', ctx: @ctx, tmpl: @tmpl
@@ -1,31 +1,36 @@
1
1
 
2
- .email-contexts-index
2
+ .email-contexts-index.padded
3
3
 
4
4
  .collapse-expand#emailContextsIndex
5
5
  %h2.header
6
- Paginated Email Contexts (aka emails)
6
+ Paginated Email Contexts (#{@ctxs.length})
7
+ - if @lead
8
+ For lead `#{@lead.name}`
7
9
  = link_to '+', new_email_context_path
8
- = link_to 'to-send', notsent_email_contexts_path
9
-
10
- %ul.meta
11
- %li= params[:type]
10
+ = link_to 'unsent', notsent_email_contexts_path
12
11
 
13
12
  .W0
14
- = render 'paginate', resource: @email_ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
13
+ = render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
14
+
15
+ %table.bordered
16
+ %tr
17
+ %th.actions Actions
18
+ %th.to To
19
+ %th.subject Subject
20
+ %th.template Template
21
+ - @ctxs.each do |ctx|
22
+ %tr
23
+ %td
24
+ - if ctx.sent_at
25
+ [~]
26
+ - else
27
+ = link_to '[~]', edit_email_context_path(ctx)
28
+ = button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
29
+ %td= ctx.to_email
30
+ %td
31
+ = link_to ctx.subject, email_context_path(ctx)
32
+ -# = link_to 'iframe', email_context_iframe_path(ctx), target: :_blank do
33
+ %td= ctx.email_template.slug
15
34
 
16
- %ul.main
17
- - @email_ctxs.each do |ctx|
18
- %li
19
- - if ctx.sent_at
20
- \----
21
- - else
22
- = link_to '~', edit_email_context_path(ctx)
23
- = link_to email_context_path(ctx) do
24
- view
25
- = ctx.title
26
- = button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
27
- -# = link_to 'iframe', email_context_iframe_path(ctx), target: :_blank do
28
35
 
29
- [ <b>tmpl:</b> #{ctx.email_template.slug} ]
30
- [ <b>To:</b> #{ctx.to_email} ]
31
- <u>#{ctx.subject}</u>
36
+ = render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
@@ -1,21 +1,32 @@
1
1
 
2
2
  .email-contexts-show
3
+ .header
4
+ %h2.title Email Context
3
5
 
4
- %ul
5
- %li <b>Title:</b> #{@email_ctx.title}
6
- %li <b>From:</b> #{@email_ctx.from_email}
7
- %li <b>Subject:</b> #{@email_ctx.subject}
8
- %li <b>To:</b> #{@email_ctx.to_email}
9
- %li <b>Template:</b> #{@email_ctx.email_template.slug} <b>Type:</b> #{@email_ctx.email_template.type}
10
- %li <b>Send at:</b> #{@email_ctx.send_at&.strftime('%Y-%m-%d %l:%M%P')}
11
- %li <b>Sent at:</b> #{@email_ctx.sent_at&.strftime('%Y-%m-%d %l:%M%P')}
12
- %li
13
- = button_to 'Send', email_context_send_path(@email_ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
14
- = link_to '[~]', edit_email_context_path(@email_ctx)
6
+ .row
7
+ .col-md-4
8
+ %ul
9
+ %li <b>From:</b> #{@ctx.from_email}
10
+ %li <b>To Lead:</b> #{@ctx.lead.email}
11
+ %li <b>Subject:</b> #{@ctx.subject}
15
12
 
16
- - if @email_ctx.sent_at
17
- = raw @email_ctx.rendered_str
18
- = @email_ctx.tmpl
13
+ .col-md-4
14
+ %ul
15
+ %li <b>Template:</b> #{link_to @ctx.email_template.slug, email_template_path(@ctx.email_template), target: :_blank }
16
+ %li <b>Layout:</b> #{@ctx.email_template.layout}
17
+
18
+ .col-md-4
19
+ %ul
20
+ %li <b>Send at:</b> #{@ctx.send_at&.strftime('%Y-%m-%d %l:%M%P')}
21
+ %li <b>Sent at:</b> #{@ctx.sent_at&.strftime('%Y-%m-%d %l:%M%P')}
22
+ %li
23
+ = button_to 'Send', email_context_send_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
24
+ = link_to '[~]', edit_email_context_path(@ctx)
25
+
26
+ - if @ctx.sent_at
27
+ = raw @ctx.rendered_str
28
+ = @ctx.tmpl
19
29
 
20
30
  - else
21
- %iframe{ src: email_context_iframe_path(@email_ctx), width: '100%', height: '100%' }
31
+ = link_to 'i-src', email_context_iframe_path(@ctx), target: :_blank
32
+ %iframe{ src: email_context_iframe_path(@ctx), width: '100%', height: '100%' }
@@ -0,0 +1,49 @@
1
+
2
+ .email-conversations-index
3
+
4
+ .header
5
+ %i.material-icons mail
6
+ Inbox (#{Office::EmailConversation.all.length})
7
+
8
+ .actions
9
+
10
+ %a.btn.delete-btn{ href: "javascript: void(0)", data: { url: '/api/email_conversations' } }
11
+ %i.material-icons delete
12
+ %a.btn.reload-btn{ href: "javascript: location.reload()" }
13
+ %i.material-icons refresh
14
+
15
+ %table.conversations
16
+ %tr
17
+ %th
18
+ .chip.select-all
19
+ = check_box_tag :select_all
20
+ .n-selected -
21
+ %th Msgs
22
+ %th Leads
23
+ %th Subject
24
+ %th Datetime
25
+ %th Tags
26
+
27
+ - @email_conversations.each do |conv|
28
+ %tr{ class: [ conv.state ] }
29
+ .item
30
+ %td= check_box_tag 'email_conversation_ids[]', conv.id.to_s, nil, { class: 'i-sel' }
31
+ %td.count
32
+ (#{conv.email_messages.count})
33
+
34
+ %td.leads
35
+ = conv.leads.map { |lead| lead.email }.join(", ")
36
+
37
+ %td.subject
38
+ = link_to conv.subject, email_conversation_path( conv )
39
+
40
+ %td.datetime
41
+ .date= conv.latest_at.strftime('%Y-%m-%d')
42
+ .time= conv.latest_at.strftime('%l:%M%P')
43
+
44
+ %td
45
+ .tags
46
+ - conv.tags.each do |tag|
47
+ .chip
48
+ = tag.name
49
+
@@ -0,0 +1,62 @@
1
+
2
+ .email-conversations-show
3
+
4
+ .header.max-width
5
+ %i.material-icons mail
6
+ Inbox (#{Office::EmailConversation.all.length})
7
+
8
+ = link_to '[<<-]', email_conversations_path
9
+ -# = link_to '[<-]', email_conversations_path
10
+ #{@email_conversation.subject}
11
+ (#{@email_conversation.email_messages.all.count})
12
+
13
+ .leads.max-width
14
+ Leads (#{@email_conversation.leads.length}):
15
+ %ul
16
+ - @email_conversation.leads.each do |p|
17
+ %li
18
+ = p.email
19
+ [existing actions?]
20
+ = render 'ish_manager/email_templates/form_reply_2_mini'
21
+ = render 'ish_manager/scheduled_actions/form_mini'
22
+
23
+
24
+ .messages.max-width
25
+ - @email_messages.each do |m|
26
+ - lead = m.lead || Lead.new(email: 'NO LEAD!', id: 'no lead')
27
+
28
+ .item
29
+ .row-1
30
+ .gray= m.id
31
+
32
+ .chip.from
33
+ -# = m.from
34
+ = lead.email
35
+
36
+ .relative
37
+ %a.chip{ href: email_contexts_for_lead_path( lead ) }
38
+ \(
39
+ = lead.email_contexts.count
40
+ %i.fa.fa-envelope
41
+ \)
42
+
43
+ .relative
44
+ %i.fa.fa-clock-o.expand-next
45
+ = render 'ish_manager/scheduled_email_actions/form', scheduled_email_action: Sch.new({ lead_id: lead.id })
46
+
47
+ .datetime
48
+ .date= m.date&.strftime('%Y-%m-%d')
49
+ .time= m.date&.strftime('%l:%M%P')
50
+
51
+ .row-2
52
+ %a.preview{ href: "javascript: void(0)", data: { id: m.id.to_s } }
53
+ = (ActionView::Base.full_sanitizer.sanitize( m.part_html )||'<no-info>')[0..300]
54
+ .expand
55
+
56
+ .my-actions.hide
57
+ = render 'ish_manager/email_templates/form_reply_2_mini'
58
+ -# = button_to 'Reply'
59
+ -# = button_to 'Reply All'
60
+ -# = button_to 'New Template'
61
+ -# = button_to 'Schedule Reply'
62
+ -# = render 'ish_manager/email_templates/form_schedule_mini'
@@ -0,0 +1,12 @@
1
+
2
+ - url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
3
+ .email-filters--from
4
+ = form_for email_filter, url: url, as: :email_filter do |f|
5
+ .field
6
+ %label From Regex
7
+ = f.text_field :from_regex
8
+ .field
9
+ %label Kind
10
+ = f.select :kind, options_for_select( ::Office::EmailFilter::KINDS, selected: email_filter.kind )
11
+ .actions
12
+ = f.submit
@@ -0,0 +1,5 @@
1
+
2
+ .emails-ns.email-filters-new
3
+ .header
4
+ %h2.title Edit Email Filter
5
+ = render 'form', email_filter: @email_filter
@@ -0,0 +1,24 @@
1
+
2
+ .email-filters-index
3
+ .header
4
+ %h2.title
5
+ Email Filters (#{@email_filters.length})
6
+ = link_to '[+]', new_email_filter_path
7
+
8
+ %table.bordered
9
+ %tr
10
+ %th &nbsp;
11
+ %th &nbsp;
12
+ %th From Regex
13
+ %th Body Regex
14
+ %th Kind
15
+ - @email_filters.each do |ef|
16
+
17
+ %tr
18
+ %td= check_box_tag 'checked'
19
+ %td= link_to '[~]', edit_email_filter_path(ef)
20
+ %td= ef.from_regex
21
+ %td= ef.body_regex
22
+ %td= ef.kind
23
+
24
+
@@ -0,0 +1,5 @@
1
+
2
+ .emails-ns.email-filters-new
3
+ .header
4
+ %h2.title New Email Filter
5
+ = render 'form', email_filter: @email_filter
@@ -0,0 +1,8 @@
1
+
2
+ -# receives local vars: email_message
3
+
4
+ .email-messages-show-iframe
5
+
6
+ .body
7
+ = raw email_message.part_html
8
+
@@ -1,8 +1,8 @@
1
1
 
2
2
  %h2 Email Messages
3
3
 
4
- %ol
4
+ %ul
5
5
  - @email_messages.each do |msg|
6
6
  %li
7
- From: #{msg.from}
7
+ #{msg.subject}
8
8
  = link_to 'view', email_message_path(msg)
@@ -1,4 +1,31 @@
1
1
 
2
+ .email-messages-show
3
+
4
+ .main-actions
5
+ .left
6
+ = link_to '[<<-]', email_conversations_path
7
+ = link_to '[<- Conversation]', email_conversation_path( @email_message.email_conversation )
8
+ Message
9
+ .right
10
+ = link_to 'source', email_message_source_path( @email_message ), target: :_blank
11
+ -# = link_to 'stripped', email_message_stripped_path( @email_message ), target: :_blank
12
+
13
+ %ul.headers
14
+ %li
15
+ <b>From:</b> #{@email_message.from}
16
+ = render 'ish_manager/email_templates/form_reply_mini'
17
+ = render 'ish_manager/email_templates/form_schedule_mini'
18
+ %li <b>To:</b> #{@email_message.to}
19
+ %li <b>Subj:</b> #{@email_message.subject}
20
+ %li <b>Date:</b> #{@email_message.date}
21
+ - if @email_message.ccs.present?
22
+ %li <b>CC:</b> #{@email_message.ccs}
23
+ - if @email_message.bccs.present?
24
+ %li <b>BCC:</b> #{@email_message.bccs}
25
+
26
+ %iframe{ src: email_message_iframe_path(@email_message), width: '100%', height: '800px' }
27
+
28
+ -# %hr
29
+ -# = ActionView::Base.full_sanitizer.sanitize( @email_message.part_html )
2
30
 
3
- = raw @email_message.part_html
4
31
 
@@ -0,0 +1,6 @@
1
+
2
+ .email-messages-show-iframe
3
+
4
+ .body
5
+ = raw @email_message.part_html
6
+
@@ -0,0 +1,5 @@
1
+
2
+
3
+ <pre>
4
+ = Nokogiri::HTML( @email_message.part_html ).to_xhtml(indent: 2)
5
+ </pre>
@@ -0,0 +1,2 @@
1
+
2
+ = ActionView::Base.full_sanitizer.sanitize( @email_message.part_html )
@@ -1,22 +1,38 @@
1
1
 
2
- - url = %w| index new create |.include?( params[:action] ) ? email_templates_path : email_template_path(email_template.id)
2
+ - url = email_template.new_record? ? email_templates_path : email_template_path(email_template.id)
3
3
 
4
4
  .email-templates--form
5
+
6
+ .header
7
+ %h2 Email Template
8
+
5
9
  = form_for email_template, url: url do |f|
6
- .field
7
- = f.label :type
8
- = f.select :type, options_for_select(Ish::EmailTemplate.type_list, selected: email_template.type)
9
- .field
10
- = f.label :slug
11
- = f.text_field :slug
12
- .field
13
- = f.label :from_email
14
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
10
+ .row
11
+ .col-md-4
12
+ .field
13
+ = f.label :slug
14
+ = f.text_field :slug
15
+ .col-md-4
16
+ .field
17
+ = f.label :layout
18
+ = f.select :layout, options_for_select(Ish::EmailTemplate::LAYOUTS, selected: email_template.layout)
19
+ .col-md-4
20
+ .field
21
+ = f.label "From"
22
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
15
23
  .field.field-subject
16
24
  = f.label :subject
17
25
  = f.text_field :subject
18
- .field
19
- = f.label :body
20
- = f.text_area :body, class: 'tinymce'
26
+
27
+ .tab-labels
28
+ %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
29
+ %a.label-preview.active{ href: "javascript: void(0)", data: { ref: '.tab-preview' } } Preview
30
+ .label-save-preview= f.submit 'Save & Preview'
31
+ .tabs
32
+ .tab-raw
33
+ = f.text_area :body
34
+ .tab-preview
35
+ -# .descr= render "ish_manager/email_templates/#{email_template.layout}", ctx: Ish::EmailContext.new, tmpl: email_template
36
+ %iframe{ src: email_template_iframe_path(email_template), width: '100%', height: '100%' }
21
37
  .actions
22
- = f.submit 'Submit'
38
+ = f.submit 'Save'
@@ -0,0 +1,15 @@
1
+
2
+ .email-templates--form-reply-2-mini.form-mini
3
+ = form_for ::Ish::EmailContext.new, url: email_contexts_path do |f|
4
+ .field
5
+ -# = f.label :template
6
+ = f.select :email_template_id, options_for_select( @email_templates_list )
7
+ .action
8
+ = f.submit 'Reply'
9
+
10
+ .field.send-at
11
+ -# = f.label :send_at
12
+ = f.text_field :send_at, placeholder: 'YYYY-MM-DD', size: 10, class: 'input-date'
13
+
14
+ .action
15
+ = f.submit 'Schedule'
@@ -0,0 +1,8 @@
1
+
2
+ .email-templates--form-reply-mini.form-mini
3
+ = form_for ::Ish::EmailContext.new, url: email_contexts_path do |f|
4
+ .field
5
+ -# = f.label :template
6
+ = f.select :email_template_id, options_for_select( @email_templates_list )
7
+ .actions
8
+ = f.submit 'Reply'
@@ -0,0 +1,11 @@
1
+
2
+ .email-templates--form-schedule-mini.form-mini
3
+ = form_for ::Ish::EmailContext.new, url: email_contexts_path do |f|
4
+ .field
5
+ -# = f.label :template
6
+ = f.select :email_template_id, options_for_select([ ['abba', 'abba'], ['zetta', 'zetta'] ])
7
+ .field.send-at
8
+ -# = f.label :send_at
9
+ = f.text_field :send_at, placeholder: 'YYYY-MM-DD'
10
+ .actions
11
+ = f.submit 'Schedule'
@@ -1,16 +1,29 @@
1
1
 
2
- %h3.collapse-expand#emailTemplatesIndex
3
- Email Templates
2
+ %h3.center.collapse-expand#emailTemplatesIndex
3
+ Email Templates (#{Ish::EmailTemplate.all.count})
4
4
  .email-templates-index
5
5
 
6
- = render 'ish_manager/email_templates/form_mini'
7
- %ul
6
+ -# = render 'ish_manager/email_templates/form_mini'
7
+
8
+ %table.bordered
9
+ %tr
10
+ %th Actions
11
+ %th Slug
12
+ %th Created
13
+ %th Updated
14
+
15
+
8
16
  - @templates.each do |tmpl|
9
- %li
10
- = link_to 'Use', new_email_context_path({ email_template_id: tmpl.id })
11
- = link_to 'Edit', edit_email_template_path({ id: tmpl })
12
- = link_to 'View', email_template_path({ id: tmpl })
13
- = link_to 'iFrame', email_template_iframe_path({ id: tmpl }), target: :_blank
14
- = tmpl.slug
15
- = button_to '[x]', email_template_path({ id: tmpl }), method: :delete, :data => { :confirm => 'Are you sure?' }, form_class: 'inline'
17
+ %tr
18
+ %td
19
+ = link_to '[use]', new_email_context_path({ email_template_id: tmpl.id })
20
+ = link_to '[~]', edit_email_template_path({ id: tmpl })
21
+ = button_to '[x]', email_template_path({ id: tmpl }), method: :delete, :data => { :confirm => 'Are you sure?' }, form_class: 'inline'
22
+ %td= link_to tmpl.slug, email_template_path({ id: tmpl })
23
+ %td= tmpl.created_at
24
+ %td= tmpl.updated_at
25
+
26
+ -# = link_to 'iFrame', email_template_iframe_path({ id: tmpl }), target: :_blank
27
+
28
+ %hr
16
29
 
@@ -1,3 +1,4 @@
1
+
1
2
  <!doctype html>
2
3
  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
3
4
  <head>
@@ -907,7 +908,9 @@ h4 {
907
908
  <![endif]-->
908
909
 
909
910
  <div style="border: 2px solid #999; border-radius: 4px; padding: 1em; margin-bottom: 1em;">
910
- <%== @email_ctx.body %>
911
+ <!-- herehere -->
912
+ <%== ERB.new(@tmpl.body).result((@ctx||@tmpl).get_binding) %>
913
+
911
914
  </div>
912
915
 
913
916
  <!--[if mso]>
@@ -0,0 +1,22 @@
1
+
2
+ - url = %w| index new create |.include?( params[:action] ) ? email_templates_path : email_template_path(email_template.id)
3
+
4
+ .email-templates--form
5
+ = form_for email_template, url: url do |f|
6
+ .field
7
+ = f.label :type
8
+ = f.select :type, options_for_select(Ish::EmailTemplate.type_list, selected: email_template.type)
9
+ .field
10
+ = f.label :slug
11
+ = f.text_field :slug
12
+ .field
13
+ = f.label :from_email
14
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
15
+ .field.field-subject
16
+ = f.label :subject
17
+ = f.text_field :subject
18
+ .field
19
+ = f.label :body
20
+ = f.text_area :body, class: 'tinymce'
21
+ .actions
22
+ = f.submit 'Submit'
@@ -0,0 +1,26 @@
1
+
2
+ - url = email_template.new_record? ? email_templates_path : email_template_path(email_template.id)
3
+
4
+ .email-templates--form
5
+ = form_for email_template, url: url do |f|
6
+ .row
7
+ .col-md-4
8
+ .field
9
+ = f.label :slug
10
+ = f.text_field :slug
11
+ .col-md-4
12
+ .field
13
+ = f.label :layout
14
+ = f.select :layout, options_for_select(Ish::EmailTemplate::LAYOUTS, selected: email_template.layout)
15
+ .col-md-4
16
+ .field
17
+ = f.label "From"
18
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_template.from_email)
19
+ .field.field-subject
20
+ = f.label :subject
21
+ = f.text_field :subject
22
+ .field
23
+ -# = f.label :body
24
+ = f.text_area :body, class: 'tinymce'
25
+ .actions
26
+ = f.submit 'Submit'
@@ -1,2 +1,3 @@
1
1
 
2
- = render 'form', email_template: @template
2
+ .email-templates-edit.max-width
3
+ = render 'form', email_template: @email_template
@@ -1,4 +1,5 @@
1
1
 
2
- -# = @email_template.inspect
3
-
4
- = render "ish_manager/email_templates/#{@email_template.slug}", ctx: @email_ctx
2
+ - if @email_template.layout == 'plain'
3
+ = raw @email_template.body
4
+ - else
5
+ = render "ish_manager/email_templates/#{@email_template.layout}", ctx: @email_ctx
@@ -0,0 +1,5 @@
1
+
2
+
3
+ %h1 New Email Template
4
+
5
+ = render 'form', email_template: @new_email_template
@@ -1,7 +1,13 @@
1
1
 
2
- = render 'index'
3
- %hr
2
+ -# = render 'index'
3
+
4
4
  .email-templates-show
5
- %h4.center= @email_template.slug
5
+ .header
6
+ %h2.title
7
+ = @email_template.slug
8
+ = link_to '[~]', edit_email_template_path( @email_template )
9
+ = link_to '[src ^]', '#'
10
+ = link_to '[preview ^]', '#'
11
+ = link_to '[use]', '#'
6
12
 
7
13
  %iframe{ src: email_template_iframe_path(@email_template.slug), width: '100%', height: '100%' }
@@ -1,19 +1,24 @@
1
1
 
2
- - url = lead.persisted? ? lead_path( lead.id ) : leads_path
2
+ - url = lead.new_record? ? leads_path : lead_path( lead.id )
3
3
 
4
4
  = form_for lead, :as => :lead, :url => url do |f|
5
+
5
6
  .field
6
7
  = f.label :name
7
8
  = f.text_field :name
9
+
8
10
  .field
9
11
  = f.label :email
10
12
  = f.text_field :email
13
+
11
14
  .field
12
- = f.label :company
13
- = f.select :m3_leadset_id, options_for_select(@leadsets_list, selected: lead.m3_leadset_id), { include_blank: true }, {class: 'select2' }
14
- .field
15
- = f.label :tag
16
- = f.text_field :tag
15
+ = f.label "Leadset (company)"
16
+ = f.select :m3_leadset_id, options_for_select(@leadsets_list, selected: lead.m3_leadset_id), { include_blank: true }, { class: 'select2' }
17
+
18
+ -# .field
19
+ -# = f.label "Tags"
20
+ -# = f.text_field :wp_tags
21
+
17
22
  .actions
18
23
  = f.submit
19
24
 
@@ -11,9 +11,9 @@
11
11
  -# %label Leadset
12
12
  -# = select_tag :leadset_id, options_for_select(@leadsets_list), class: 'select2'
13
13
 
14
- .field
15
- %label Campaign
16
- = select_tag :email_campaign_id, options_for_select(@email_campaigns_list), class: 'select2'
14
+ -# .field
15
+ -# %label Campaign
16
+ -# = select_tag :email_campaign_id, options_for_select(@email_campaigns_list), class: 'select2'
17
17
 
18
18
  .actions
19
19
  = submit_tag 'Submit'