ish_manager 0.1.8.355 → 0.1.8.356

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +67 -15
  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 +48 -9
  6. data/app/assets/stylesheets/ish_manager/email.scss +44 -0
  7. data/app/assets/stylesheets/ish_manager/{email_contexts_templates.scss → email_contexts.scss} +29 -49
  8. data/app/assets/stylesheets/ish_manager/email_conversations.scss +99 -21
  9. data/app/assets/stylesheets/ish_manager/email_templates.scss +59 -0
  10. data/app/assets/stylesheets/ish_manager/leads_leadsets.scss +96 -3
  11. data/app/assets/stylesheets/ish_manager/scheduled_actions_emails.scss +25 -0
  12. data/app/assets/stylesheets/ish_manager/tags.scss +5 -0
  13. data/app/controllers/ish_manager/application_controller.rb +15 -0
  14. data/app/controllers/ish_manager/email_actions_controller.rb +80 -0
  15. data/app/controllers/ish_manager/email_campaigns_controller.rb +13 -0
  16. data/app/controllers/ish_manager/email_contexts_controller.rb +41 -48
  17. data/app/controllers/ish_manager/email_conversations_controller.rb +6 -2
  18. data/app/controllers/ish_manager/email_filters_controller.rb +47 -0
  19. data/app/controllers/ish_manager/email_messages_controller.rb +1 -1
  20. data/app/controllers/ish_manager/email_templates_controller.rb +23 -10
  21. data/app/controllers/ish_manager/leads_controller.rb +3 -9
  22. data/app/controllers/ish_manager/leadset_tags_controller.rb +18 -0
  23. data/app/controllers/ish_manager/leadsets_controller.rb +13 -0
  24. data/app/controllers/ish_manager/scheduled_email_actions_controller.rb +38 -0
  25. data/app/helpers/ish_manager/application_helper.rb +4 -0
  26. data/app/mailers/ish_manager/office_mailer.rb +10 -9
  27. data/app/views/ish_manager/application/_debug.haml +2 -1
  28. data/app/views/ish_manager/application/_main_header_admin.haml +47 -60
  29. data/app/views/ish_manager/email_actions/_form.haml +42 -0
  30. data/app/views/ish_manager/email_actions/edit.haml +7 -0
  31. data/app/views/ish_manager/email_actions/index.haml +24 -0
  32. data/app/views/ish_manager/email_actions/new.haml +7 -0
  33. data/app/views/ish_manager/email_contexts/_form.haml +32 -30
  34. data/app/views/ish_manager/email_contexts/edit.haml +1 -1
  35. data/app/views/ish_manager/email_contexts/index.haml +27 -22
  36. data/app/views/ish_manager/email_contexts/show.haml +26 -15
  37. data/app/views/ish_manager/email_conversations/index.haml +46 -9
  38. data/app/views/ish_manager/email_conversations/show.haml +56 -21
  39. data/app/views/ish_manager/email_filters/_form.haml +12 -0
  40. data/app/views/ish_manager/email_filters/edit.haml +5 -0
  41. data/app/views/ish_manager/email_filters/index.haml +24 -0
  42. data/app/views/ish_manager/email_filters/new.haml +5 -0
  43. data/app/views/ish_manager/email_templates/_form.haml +30 -14
  44. data/app/views/ish_manager/email_templates/_form_reply_2_mini.haml +15 -0
  45. data/app/views/ish_manager/email_templates/_form_reply_mini.haml +1 -1
  46. data/app/views/ish_manager/email_templates/_index.haml +24 -11
  47. data/app/views/ish_manager/email_templates/_piousbox_roundborders.html.erb +4 -1
  48. data/app/views/ish_manager/email_templates/done/_form.haml +22 -0
  49. data/app/views/ish_manager/email_templates/done/_form2.haml +26 -0
  50. data/app/views/ish_manager/email_templates/edit.haml +2 -1
  51. data/app/views/ish_manager/email_templates/iframe_src.haml +4 -3
  52. data/app/views/ish_manager/email_templates/new.haml +5 -0
  53. data/app/views/ish_manager/email_templates/show.haml +9 -3
  54. data/app/views/ish_manager/leads/_form.haml +11 -6
  55. data/app/views/ish_manager/leads/_form_import.haml +3 -3
  56. data/app/views/ish_manager/leads/edit.haml +19 -16
  57. data/app/views/ish_manager/leads/index.haml +25 -16
  58. data/app/views/ish_manager/leads/new.haml +8 -7
  59. data/app/views/ish_manager/leadsets/index.haml +60 -12
  60. data/app/views/ish_manager/leadsets/index_dataTables.haml +33 -0
  61. data/app/views/ish_manager/scheduled_actions/_form_mini.haml +16 -0
  62. data/app/views/ish_manager/scheduled_email_actions/_form.haml +26 -0
  63. data/app/views/ish_manager/scheduled_email_actions/index.haml +15 -0
  64. data/app/views/ish_manager/scheduled_email_actions/new.haml +4 -0
  65. data/app/views/ish_manager/scheduled_email_actions/show.haml +0 -0
  66. data/app/views/layouts/ish_manager/application.haml +2 -2
  67. data/app/views/layouts/ish_manager/application_fullwidth.haml +2 -2
  68. data/config/routes.rb +10 -2
  69. metadata +30 -6
  70. data/app/controllers/ish_manager/office_actions_controller.rb +0 -59
  71. data/app/views/ish_manager/office_actions/_form.haml +0 -83
  72. data/app/views/ish_manager/office_actions/index.haml +0 -9
@@ -0,0 +1,38 @@
1
+
2
+ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ layout 'ish_manager/application_fullwidth'
7
+
8
+ def create
9
+ puts! params, 'params'
10
+
11
+ authorize! :scheduled_emails_create, ::IshManager
12
+
13
+ @scheduled = Office::ScheduledEmailAction .new({
14
+ lead_id: params[:lead_id],
15
+ email_action_id: params[:email_action_id],
16
+ })
17
+
18
+ flag = @scheduled.save
19
+ if flag
20
+ flash[:notice] = 'Success'
21
+ else
22
+ flash[:alert] = "No luck: #{@scheduled.errors.full_messages.join(', ')}"
23
+ end
24
+ redirect_to request.referrer ? request.referrer : leadsets_path
25
+ end
26
+
27
+ def index
28
+ authorize! :scheduled_emails_index, ::IshManager
29
+ @scheduled_email_actions = ::Office::ScheduledEmailAction.all
30
+ end
31
+
32
+ def new
33
+ @scheduled_email_action = ::Office::ScheduledEmailAction.new
34
+ authorize! :scheduled_emails_new, @scheduled_email_action
35
+ end
36
+
37
+ end
38
+
@@ -26,6 +26,10 @@ module IshManager
26
26
  end
27
27
  end
28
28
 
29
+ # def email_contexts_for_lead_path lead
30
+ # "/manager/email_contexts/for_lead/#{lead.id.to_s}"
31
+ # end
32
+
29
33
  def pretty_date input
30
34
  return input.strftime("%Y-%m-%d")
31
35
  end
@@ -59,15 +59,16 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
59
59
  ac = ActionController::Base.new
60
60
  ac.instance_variable_set( :@email_ctx, @email_ctx )
61
61
 
62
- case @email_ctx.email_template.type
63
- when 'partial'
64
- template = "render/_#{@email_ctx.email_template.slug}"
65
- rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@email_ctx.email_template.slug}")
66
- when 'plain'
67
- @body = @email_ctx.body_templated
68
- template = "render/plain"
69
- rendered_str = ac.render_to_string("ish_manager/email_templates/plain")
70
- end
62
+ raise '@TODO: re-implement. _vp_ 2023-03-04'
63
+ # case @email_ctx.email_template.type
64
+ # when 'partial'
65
+ # template = "render/_#{@email_ctx.email_template.slug}"
66
+ # rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@email_ctx.email_template.slug}")
67
+ # when 'plain'
68
+ # @body = @email_ctx.body_templated
69
+ # template = "render/plain"
70
+ # rendered_str = ac.render_to_string("ish_manager/email_templates/plain")
71
+ # end
71
72
 
72
73
  @email_ctx.update( rendered_str: rendered_str, sent_at: Time.now.to_s )
73
74
 
@@ -6,4 +6,5 @@
6
6
  %li= params.inspect
7
7
  %li Cached? #{Rails.application.config.action_controller.perform_caching} :: Cache key: #{@cache_key.inspect}
8
8
  -# %li Layout: #{current_layout}
9
- %li= "Env: #{Rails.env}"
9
+ %li= "Env: #{Rails.env}"
10
+ %li JWT: #{@jwt_token}
@@ -1,79 +1,48 @@
1
1
 
2
2
 
3
3
  .application--main-header-admin.main-header{ class: "#{ENV['RAILS_ENV']} #{ENV['RAILS_ENV'][0...3]=="dev" ? "development" : ''}" }
4
+ %i.fa.fa-compress.collapse-expand#collapseHeaderMain
5
+ Piousbox Suite
4
6
  .container
5
7
 
6
8
  %i.fa.fa-compress.collapse-expand#collapseHeaderPiCMS
7
9
  PiousboxCMS
8
- %ul
9
- -# %li
10
- -# = link_to 'Photos', photos_path
11
- -# = link_to '[+]', new_photo_path
12
- %li
13
- = render 'ish_manager/galleries/menu'
14
- %li
15
- = link_to 'Reports', reports_path
16
- .inline-search
17
- = form_tag reports_path, method: :get do
18
- = text_field_tag :q
19
- = link_to '[+]', new_report_path
20
- %li
21
- = link_to 'Videos', videos_path
22
- .inline-search
23
- = form_tag videos_path, method: :get do
24
- = text_field_tag :q
25
- = link_to '[+]', new_video_path
26
- %li
27
- = link_to 'Categories & Tags', categories_path
28
- .c
29
-
30
- %i.fa.fa-compress.collapse-expand#collapseHeaderIsh
31
- Gameui
32
- .content
10
+ .a
33
11
  %ul
34
12
  %li
35
- = link_to 'Maps', maps_path
13
+ = render 'ish_manager/galleries/menu'
14
+ %li
15
+ = link_to 'Reports', reports_path
36
16
  .inline-search
37
- = form_tag maps_path, method: :get do
17
+ = form_tag reports_path, method: :get do
38
18
  = text_field_tag :q
39
- = link_to '[+]', new_map_path
40
-
41
- -# %li
42
- -# = link_to 'Tags', tags_path
43
-
19
+ = link_to '[+]', new_report_path
20
+ %li
21
+ = link_to 'Videos', videos_path
22
+ .inline-search
23
+ = form_tag videos_path, method: :get do
24
+ = text_field_tag :q
25
+ = link_to '[+]', new_video_path
26
+ %li= link_to 'Categories & Tags', categories_path
44
27
  %ul
45
28
  %li= link_to '+Newsitem', new_newsitem_path
46
- -# %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches (old m3)', stock_watches_path
47
- -# %li= link_to 'Stock Watches', '/iron_warbler/stock_watches'
48
- -# %li= link_to 'Users', users_path
49
29
  %li= link_to 'Ish::UserProfiles', user_profiles_path
30
+ %li= link_to "Ish::ImageAsset's", image_assets_path
50
31
  %li
51
- = link_to "Ish::ImageAsset's", image_assets_path
32
+ = link_to 'Maps', maps_path
33
+ .inline-search
34
+ = form_tag maps_path, method: :get do
35
+ = text_field_tag :q
36
+ = link_to '[+]', new_map_path
52
37
  .c
53
38
 
54
39
  %i.fa.fa-compress.collapse-expand#collapseHeaderOffice
55
- Office
56
- .namespace
57
- -# %ul
58
- -# %li= link_to 'Admin', '/admin'
59
- -# %li= link_to 'A/Leads', '/admin/leads'
60
- -# %li= link_to 'A/CampaignLeads', '/admin/email_campaign_leads'
40
+ PiousboxCRM
41
+ .a
61
42
  %ul
62
43
  %li
63
- = link_to 'Meetings', meetings_path
64
- = link_to '[+]', new_meeting_path
65
- %li
66
- -## superceded by conversations, below _vp_ 2023-02-26
67
- -# = link_to "Email Messages (#{Office::EmailMessage.count})", email_messages_path
68
- = link_to "Email Conv's (#{Office::EmailConversation.count})", email_conversations_path
69
- %ul
70
- %li
71
- = link_to 'Leads', leads_path
72
- = link_to '[+]', new_lead_path
73
- %li
74
- = link_to 'Leadsets', leadsets_path
75
- = link_to '[+]', new_leadset_path
76
- %li= link_to 'Email Templates', email_templates_path
44
+ = link_to "Inbox (#{Office::EmailConversation.count})", email_conversations_path
45
+ = link_to '[+]', new_email_context_path
77
46
  %li
78
47
  = link_to 'Contexts', email_contexts_path
79
48
  = link_to '[+]', new_email_context_path
@@ -81,17 +50,35 @@
81
50
  %li
82
51
  = link_to 'Campaigns', email_campaigns_path
83
52
  = link_to '[+]', new_email_campaign_path
84
- %li
85
- = link_to 'Actions', office_actions_path
86
- = link_to '[+]', new_office_action_path
87
53
 
54
+ %li
55
+ = link_to 'Scheduled Emails', scheduled_email_actions_path
56
+ = link_to '[+]', new_scheduled_email_action_path
57
+ %ul
58
+ %li
59
+ = link_to "Templates (#{Ish::EmailTemplate.all.count})", email_templates_path
60
+ = link_to '[+]', new_email_template_path
61
+ %li
62
+ = link_to "Leadsets (#{Leadset.kept.length})", leadsets_path
63
+ = link_to '[+]', new_leadset_path
64
+ %li
65
+ = link_to "Leads (#{Lead.kept.length})", leads_path
66
+ = link_to '[+]', new_lead_path
67
+ %li
68
+ = link_to "Email Actions (#{Office::EmailAction.all.length})", email_actions_path
69
+ = link_to '[+]', new_email_action_path
70
+ %li
71
+ = link_to "Filters (#{Office::EmailFilter.active.length})", email_filters_path
72
+ = link_to '[+]', new_email_filter_path
88
73
  .c
74
+
89
75
  %i.fa.fa-compress.collapse-expand#collapseHeaderIro
90
76
  Iro Wor
91
- .content
77
+ .a
92
78
  %ul
93
79
  %li
94
80
  = link_to 'Watches', iro_watches_path
95
81
  %li
96
82
  = link_to 'Plots', 'http://localhost:3000/iron_warbler/NOPE-1', target: '_blank'
83
+ .c
97
84
 
@@ -0,0 +1,42 @@
1
+
2
+ - act = email_action
3
+ - url = email_action.new_record? ? email_actions_path : email_action_path( email_action )
4
+
5
+ .email-actions--form
6
+
7
+ = form_for email_action, url: url, as: :email_action, :html => { :multipart => true } do |f|
8
+ .row
9
+ .col-sm-6
10
+ = f.submit :submit
11
+
12
+ .row
13
+ .col-md-6
14
+ .field
15
+ %label Slug
16
+ = f.text_field :slug
17
+ -# .field
18
+ -# %label Lead
19
+ -# = f.select :lead_id, options_for_select( @leads_list, selected: act.lead_id ), {}, class: 'select2'
20
+ .field
21
+ %label Template
22
+ = f.select :email_template_id, options_for_select( @email_templates_list, selected: act.email_template_id ), {}, class: 'select2'
23
+ -# .field
24
+ -# %label State
25
+ -# = f.select :state, options_for_select( ::Office::EmailAction::STATES, selected: act.state )
26
+
27
+ .col-md-6
28
+ .field
29
+ %label Next in Days
30
+ .eg eg: rand(1..5)
31
+ = f.text_field :next_in_days
32
+ .field
33
+ %label Next at Time
34
+ .eg eg: rand(8..16).hours + rand(1..59).minutes
35
+ = f.text_field :next_at_time
36
+ .field
37
+ %label Next Email Actions
38
+ = f.select :next_email_actions, options_for_select( @email_actions_list, selected: act.next_email_actions.map(&:id) ), { }, { class: 'select2', multiple: true }
39
+
40
+ .row
41
+ .col-sm-6
42
+ = f.submit :submit
@@ -0,0 +1,7 @@
1
+
2
+ .email-actions-edit
3
+ .header
4
+ %h2.title Edit Email Action
5
+
6
+ = render 'form', email_action: @act
7
+
@@ -0,0 +1,24 @@
1
+
2
+ .email-actions-index
3
+
4
+ .header
5
+ %h2.title
6
+ Email Actions
7
+ = link_to '[+]', new_email_action_path
8
+
9
+ %table.bordered
10
+ %tr
11
+ %th &nbsp;
12
+ %th actions
13
+ %th slug
14
+ %th next actions
15
+ - @email_actions.each do |act|
16
+ %tr
17
+ %td [_]
18
+ %td= link_to '[~]', edit_email_action_path( act )
19
+ %td= act.slug
20
+ -# %td= act.lead&.email
21
+ %td
22
+ %ul
23
+ - act.next_email_actions.map do |next_a|
24
+ %li= link_to next_a.slug, edit_email_action_path( next_a )
@@ -0,0 +1,7 @@
1
+
2
+ .email-actions-new
3
+ .header
4
+ %h2.title
5
+ New Email Action
6
+
7
+ = render 'form', email_action: @new_email_action
@@ -1,43 +1,45 @@
1
1
 
2
2
  .email-contexts--form
3
- %h2
4
- New Email Context
5
- - if email_ctx.email_template
6
- with template `#{email_ctx.email_template.slug}` type:#{email_ctx.email_template.type}.
3
+ .header
4
+ %h2.title Email Context
7
5
 
8
- - url = %w| index new create |.include?( params[:action] ) ? email_contexts_path : email_context_path(email_ctx)
9
- = form_for email_ctx, url: url do |f|
6
+ - url = ctx.new_record? ? email_contexts_path : email_context_path(ctx)
7
+ = form_for ctx, url: url do |f|
10
8
  .row
9
+ = f.submit 'Save'
10
+ .row
11
+ .col-md-6
12
+ .field.field-template
13
+ = f.label "Template"
14
+ = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || ctx.email_template_id ), {}, { class: 'select2' }
15
+ = link_to 'view', email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
16
+ = link_to '~', edit_email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
17
+ -# .field
18
+ -# = f.label :slug
19
+ -# = f.text_field :slug
11
20
 
12
- .col.s6
13
- .field
14
- = f.label :email_template_id
15
- = f.select :email_template_id, options_for_select(@email_templates_list, selected: params[:email_template_id] || email_ctx.email_template&.id )
16
21
  .field
17
- = f.label :slug
18
- = f.text_field :slug
22
+ = f.label "From"
23
+ = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: ctx.from_email)
19
24
 
25
+ -# .col-md-6
26
+ -# %h5 Context
27
+ -# %div Commonly: name, companyName
28
+ -# .field
29
+ -# = f.text_area :tmpl, value: JSON.pretty_generate( ctx.tmpl )
30
+ .row
31
+ .col-md-4
20
32
  .field
21
- = f.label :from_email
22
- = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: email_ctx.from_email)
23
-
24
- .col.s6
25
- -# @TODO: clean this up. _vp_ 2023-02-13
26
- .TYPE_SINGLE
27
- .field
28
- = f.label :to_email
29
- = f.text_field :to_email
30
- %h5 Templating
31
- %div Commonly: name, companyName
32
- .field
33
- = f.text_area :tmpl, value: JSON.pretty_generate( email_ctx.tmpl )
33
+ = f.label "To lead"
34
+ = f.select :lead_id, options_for_select( @leads_list ), {}, { class: 'select2' }
35
+ .col-md-8
36
+ .field.field-subject
37
+ = f.label :subject
38
+ = f.text_field :subject
34
39
 
35
- .field.field-subject
36
- = f.label :subject
37
- = f.text_field :subject
38
- - if 'plain' == email_ctx.email_template&.type
40
+ - if 'plain' == ctx.email_template&.layout
39
41
  .body
40
- = raw email_ctx.email_template.body
42
+ = raw ctx.email_template.body
41
43
  - else
42
44
  .field
43
45
  = f.label :body
@@ -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%' }
@@ -1,12 +1,49 @@
1
1
 
2
2
  .email-conversations-index
3
- %h1 Email Conversations
4
-
5
- %ul
6
- - @email_conversations.each do |c|
7
- %li
8
- = c.latest_date.to_s[0...10]
9
- .participants= c.participants.join(", ")
10
- = link_to c.subject, email_conversation_path( c )
11
- (#{c.email_messages.count})
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
12
49
 
@@ -1,27 +1,62 @@
1
1
 
2
2
  .email-conversations-show
3
- .actions.hide
4
- = link_to '[<- all conv]', email_conversations_path
5
-
6
- .header
7
- .label
8
- = link_to '[<-]', email_conversations_path
9
- Conversation:
10
- %h1
11
- #{@email_conversation.subject}
12
- (#{@email_conversation.email_messages.all.count})
13
-
14
- .participants
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
15
  %ul
16
- - @email_conversation.participants.each do |p|
16
+ - @email_conversation.leads.each do |p|
17
17
  %li
18
- = p
19
- = render 'ish_manager/email_templates/form_reply_mini'
20
- = render 'ish_manager/email_templates/form_schedule_mini'
18
+ = p.email
19
+ [existing actions?]
20
+ = render 'ish_manager/email_templates/form_reply_2_mini'
21
+ = render 'ish_manager/scheduled_actions/form_mini'
21
22
 
22
- %ul.messages
23
+
24
+ .messages.max-width
23
25
  - @email_messages.each do |m|
24
- %li
25
- .date= link_to m.date.to_s[0...10], email_message_path( m )
26
- .preview
27
- = (ActionView::Base.full_sanitizer.sanitize( m.part_html )||'<no-info>')[0..300]
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