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,6 +1,8 @@
1
1
 
2
2
  class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationController
3
3
 
4
+ # before_action :set_lists, only: %i| new |
5
+
4
6
  def create
5
7
  authorize! :create, ::Ish::EmailTemplate
6
8
  template = ::Ish::EmailTemplate.create params[:ish_email_template].permit!
@@ -24,30 +26,37 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
24
26
  end
25
27
 
26
28
  def edit
27
- @template = Ish::EmailTemplate.where({ id: params[:id] }).first
28
- authorize! :edit, @template
29
+ @tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first
30
+ authorize! :edit, @tmpl
31
+
32
+ # @ctx = @email_context = Ish::EmailContext.new
33
+ render layout: 'ish_manager/application_fullwidth'
29
34
  end
30
35
 
31
36
  def iframe_src
32
- authorize! :iframe_src, Ish::EmailTemplate
33
- @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
37
+ @tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
34
38
  Ish::EmailTemplate.find_by({ slug: params[:id] })
35
- @email_ctx = Ish::EmailContext.new({ body: Ish::LoremIpsum.html })
39
+ authorize! :iframe_src, @email_template
36
40
  render layout: false
37
41
  end
38
42
 
39
43
  def index
40
44
  authorize! :index, Ish::EmailTemplate
41
- @templates = Ish::EmailTemplate.all.page( params[:templates_page] )
45
+ @templates = Ish::EmailTemplate.all.order_by( slug: :asc ).page( params[:templates_page] )
46
+ end
47
+
48
+ def new
49
+ @new_email_template = Ish::EmailTemplate.new
50
+ authorize! :new, Ish::EmailTemplate
42
51
  end
43
52
 
44
53
  def show
45
54
  authorize! :show, Ish::EmailTemplate
46
55
  @templates = Ish::EmailTemplate.all.page( params[:templates_page] )
47
56
 
48
- @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
57
+ @tmpl = @email_template = Ish::EmailTemplate.where({ id: params[:id] }).first ||
49
58
  Ish::EmailTemplate.find_by({ slug: params[:id] })
50
- @email_ctx = ::Ish::EmailContext.new({ body: Ish::LoremIpsum.html })
59
+ @ctx = @email_context = ::Ish::EmailContext.new({ body: Ish::LoremIpsum.html })
51
60
  end
52
61
 
53
62
  def update
@@ -56,11 +65,15 @@ class ::IshManager::EmailTemplatesController < ::IshManager::ApplicationControll
56
65
  flag = @template.update_attributes( params[:ish_email_template].permit! )
57
66
  if flag
58
67
  flash[:notice] = 'Success.'
59
- redirect_to action: 'index'
60
68
  else
61
69
  flash[:alert] = "No luck. #{@template.errors.full_messages.join(', ')}"
62
- render :edit
63
70
  end
71
+ redirect_to action: :edit
64
72
  end
65
73
 
74
+ ##
75
+ ## private
76
+ ##
77
+ private
78
+
66
79
  end
@@ -3,6 +3,8 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
3
3
 
4
4
  before_action :set_lists
5
5
 
6
+ layout 'ish_manager/application_fullwidth'
7
+
6
8
  ## alphabetized : )
7
9
 
8
10
  def bulkop
@@ -69,7 +71,7 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
69
71
 
70
72
  def index
71
73
  authorize! :index, ::Lead
72
- @leads = ::Lead.all.includes( :leadset, :email_campaign_leads )
74
+ @leads = ::Lead.all # .includes( :leadset, :email_campaign_leads )
73
75
  lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
74
76
 
75
77
  map = %Q{
@@ -117,12 +119,4 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
117
119
  redirect_to :action => 'index'
118
120
  end
119
121
 
120
- private
121
-
122
- def set_lists
123
- super
124
- @leadsets_list = [ [nil,nil] ] + ::Leadset.all.map { |k| [ k.name, k.id ] }
125
- @email_campaigns_list = [ [nil,nil] ] + Ish::EmailContext.unsent_campaigns.map { |k| [ k.slug, k.id ] }
126
- end
127
-
128
122
  end
@@ -0,0 +1,18 @@
1
+
2
+ class IshManager::LeadsetTagsController < IshManager::ApplicationController
3
+
4
+ ## params[ :leadset_id, :term_id, ]
5
+ def create
6
+ authorize! :leadset_tags_create, ::IshManager
7
+
8
+ lt = LeadsetTag.new( leadset_id: params[:leadset_id], term_id: params[:term_id] )
9
+ flag = lt.save
10
+ if flag
11
+ flash[:notice] = 'Success'
12
+ else
13
+ flash[:alert] = "No luck: #{lt.errors.full_messages.join(', ')}"
14
+ end
15
+ redirect_to request.referrer ? request.referrer : leadsets_path
16
+ end
17
+
18
+ end
@@ -1,6 +1,8 @@
1
1
 
2
2
  class ::IshManager::LeadsetsController < IshManager::ApplicationController
3
3
 
4
+ before_action :set_lists
5
+
4
6
  ## alphabetized : )
5
7
 
6
8
  def create
@@ -15,6 +17,18 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController
15
17
  redirect_to :action => 'index'
16
18
  end
17
19
 
20
+ def destroy
21
+ puts! params, 'params'
22
+
23
+ leadsets = Leadset.find( params[:leadset_ids] )
24
+ @results = []
25
+ leadsets.each do |leadset|
26
+ @results.push leadset.discard
27
+ end
28
+ flash[:notice] = "Discard outcome: #{@results.inspect}."
29
+ redirect_to action: 'index'
30
+ end
31
+
18
32
  def edit
19
33
  @leadset = Leadset.find params[:id]
20
34
  authorize! :edit, @leadset
@@ -22,12 +36,14 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController
22
36
 
23
37
  def index
24
38
  authorize! :index, Leadset
25
- @leadsets = Leadset.all # where( :profile => @current_profile, :is_trash => false )
39
+ @leadsets = Leadset.all.kept # where( :profile => @current_profile, :is_trash => false )
26
40
  # if params[:is_done]
27
41
  # @leadsets = @leadsets.where( :is_done => true )
28
42
  # else
29
43
  # @leadsets = @leadsets.where( :is_done => false )
30
44
  # end
45
+
46
+ render layout: 'ish_manager/application_fullwidth'
31
47
  end
32
48
 
33
49
  def new
@@ -51,4 +67,15 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController
51
67
  redirect_to :action => 'index'
52
68
  end
53
69
 
70
+ ##
71
+ ## private
72
+ ##
73
+ private
74
+
75
+ def set_lists
76
+ @tags_list = WpTag.all.map { |t| [ t.name, t.id ] }
77
+ @leads_list = Lead.all.map { |lead| [ lead.email, lead.id ] }
78
+ @templates_list = Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
79
+ end
80
+
54
81
  end
@@ -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
+
@@ -1,6 +1,19 @@
1
1
  module IshManager
2
2
  module ApplicationHelper
3
3
 
4
+
5
+ #
6
+ # api paths
7
+ #
8
+ def api_map_path map
9
+ "/api/maps/view/#{map.slug}"
10
+ end
11
+
12
+ def api_marker_path marker
13
+ "/api/markers/view/#{marker.id}"
14
+ end
15
+
16
+
4
17
  def current_layout
5
18
  layout = controller.class.send(:_layout)
6
19
  if layout.nil?
@@ -13,6 +26,10 @@ module IshManager
13
26
  end
14
27
  end
15
28
 
29
+ # def email_contexts_for_lead_path lead
30
+ # "/manager/email_contexts/for_lead/#{lead.id.to_s}"
31
+ # end
32
+
16
33
  def pretty_date input
17
34
  return input.strftime("%Y-%m-%d")
18
35
  end
@@ -40,16 +57,5 @@ module IshManager
40
57
  "$ #{'%.2f' % a}"
41
58
  end
42
59
 
43
- #
44
- # api paths
45
- #
46
- def api_map_path map
47
- "/api/maps/view/#{map.slug}"
48
- end
49
-
50
- def api_marker_path marker
51
- "/api/markers/view/#{marker.id}"
52
- end
53
-
54
60
  end
55
61
  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
 
@@ -0,0 +1,18 @@
1
+
2
+ - if notice || alert
3
+ .row
4
+ .col-sm-12
5
+ - if notice
6
+ - if notice.class == Array
7
+ %ul.notice
8
+ - notice.map do |n|
9
+ %li= n
10
+ - else
11
+ %p.notice= notice
12
+ - if alert
13
+ - if alert.class == Array
14
+ %ul.alert
15
+ - alert.map do |n|
16
+ %li= n
17
+ - else
18
+ %p.alert= alert
@@ -1,9 +1,10 @@
1
1
 
2
2
  %i.fa.fa-compress.collapse-expand#debug
3
+ Debug
3
4
  .application--debug
4
5
  %ul.browser-default
5
6
  %li= params.inspect
6
- %li= "Cached?: #{Rails.application.config.action_controller.perform_caching}"
7
- %li Cache key: #{@cache_key.inspect}
8
- %li Layout: #{current_layout}
9
- %li= "Env: #{Rails.env}"
7
+ %li Cached? #{Rails.application.config.action_controller.perform_caching} :: Cache key: #{@cache_key.inspect}
8
+ -# %li Layout: #{current_layout}
9
+ %li= "Env: #{Rails.env}"
10
+ %li JWT: #{@jwt_token}
@@ -3,6 +3,7 @@
3
3
  .container
4
4
 
5
5
  %i.fa.fa-compress.collapse-expand#mainFooter
6
+ Account & Session
6
7
  .a
7
8
  .row
8
9
  .col-sm-6
@@ -1,75 +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
- .c
27
-
28
- %i.fa.fa-compress.collapse-expand#collapseHeaderIsh
29
- Gameui
30
- .content
10
+ .a
31
11
  %ul
32
12
  %li
33
- = link_to 'Maps', maps_path
13
+ = render 'ish_manager/galleries/menu'
14
+ %li
15
+ = link_to 'Reports', reports_path
34
16
  .inline-search
35
- = form_tag maps_path, method: :get do
17
+ = form_tag reports_path, method: :get do
36
18
  = text_field_tag :q
37
- = link_to '[+]', new_map_path
38
-
39
- -# %li
40
- -# = link_to 'Tags', tags_path
41
-
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
42
27
  %ul
43
28
  %li= link_to '+Newsitem', new_newsitem_path
44
- -# %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches (old m3)', stock_watches_path
45
- -# %li= link_to 'Stock Watches', '/iron_warbler/stock_watches'
46
- -# %li= link_to 'Users', users_path
47
29
  %li= link_to 'Ish::UserProfiles', user_profiles_path
30
+ %li= link_to "Ish::ImageAsset's", image_assets_path
48
31
  %li
49
- = 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
50
37
  .c
51
38
 
52
39
  %i.fa.fa-compress.collapse-expand#collapseHeaderOffice
53
- Office
54
- .namespace
55
- -# %ul
56
- -# %li= link_to 'Admin', '/admin'
57
- -# %li= link_to 'A/Leads', '/admin/leads'
58
- -# %li= link_to 'A/CampaignLeads', '/admin/email_campaign_leads'
59
- %ul
60
- %li
61
- = link_to 'Meetings', meetings_path
62
- = link_to '[+]', new_meeting_path
63
- %li
64
- = link_to 'EmailMessages', email_messages_path
40
+ PiousboxCRM
41
+ .a
65
42
  %ul
66
43
  %li
67
- = link_to 'Leads', leads_path
68
- = link_to '[+]', new_lead_path
69
- %li
70
- = link_to 'Leadsets', leadsets_path
71
- = link_to '[+]', new_leadset_path
72
- %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
73
46
  %li
74
47
  = link_to 'Contexts', email_contexts_path
75
48
  = link_to '[+]', new_email_context_path
@@ -77,19 +50,35 @@
77
50
  %li
78
51
  = link_to 'Campaigns', email_campaigns_path
79
52
  = link_to '[+]', new_email_campaign_path
80
- %li
81
- = link_to 'Actions', office_actions_path
82
- = link_to '[+]', new_office_action_path
83
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
84
73
  .c
74
+
85
75
  %i.fa.fa-compress.collapse-expand#collapseHeaderIro
86
- Iro
87
- .content
76
+ Iro Wor
77
+ .a
88
78
  %ul
89
79
  %li
90
80
  = link_to 'Watches', iro_watches_path
91
81
  %li
92
82
  = link_to 'Plots', 'http://localhost:3000/iron_warbler/NOPE-1', target: '_blank'
93
-
94
- %hr
83
+ .c
95
84
 
@@ -1,5 +1,5 @@
1
1
 
2
- .application-home
2
+ .application-home.max-width
3
3
  Welcome home
4
4
 
5
5
  .bordered-card
@@ -0,0 +1,12 @@
1
+
2
+ -## provides local vars: subtree, config
3
+
4
+ - puts! config, 'config'
5
+ - puts! subtree, 'subtree'
6
+
7
+ %ul
8
+ - subtree.select { |c| c[5] == config[:parent_id] }.each do |c|
9
+ %li
10
+ = c[1]
11
+ - if config[:parent_ids].include?( c[0] )
12
+ = render 'ish_manager/categories/subtree', subtree: subtree, config: { parent_id: c[0], parent_ids: config[:parent_ids] }
@@ -0,0 +1,11 @@
1
+
2
+ .row
3
+ .col-md-6
4
+ %h1 Categories
5
+ = render 'ish_manager/categories/subtree', subtree: @categories_flat, config: { parent_id: nil, parent_ids: @categories_flat.map { |c| c[5] }.uniq }
6
+
7
+ .col-md-6
8
+ %h1 Tags
9
+ %ul
10
+ - @tags.each do |tag|
11
+ %li= tag[:name]
@@ -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