ish_manager 0.1.8.429 → 0.1.8.430

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0abc37d22ccfddfa3800f1fed6895e74277e0a4d7c830daad34db5d1adf6764
4
- data.tar.gz: 715a9713d49199bc20908be318498bbb0626b709bf085a7e333099082f06cd83
3
+ metadata.gz: 7e6abbf238a452811df0495561ea410cf0a569b39065ad1067e829ee09d0091d
4
+ data.tar.gz: fe6580a8254170fcfc39b0feef97976bdd30e5b8272e57a8d85275d198e2a9bc
5
5
  SHA512:
6
- metadata.gz: 12a1ef887def22ebf1b016dd0aa5b1a5dfaf4fd3baa3675d3bba651fc60ae2353949bf6f51623d9c57d60efd2624bee8ad303199bbf8439481e7c54ab37a93a9
7
- data.tar.gz: ba86068a4bc4f2c00a9cb3aaf292952f87dec3da30708408d67937cf794bafea23d871354eec685fd712aff2edc95eb8a74d5c3f2bdf34bb5f4d4b14795384f2
6
+ metadata.gz: b671d0e4eabdcd2e351d9fb0fa51661c6c8e6b52cd05d19af5f79a58cd67ea703f9159bcf882330ad4e0fec1d3c16c1e32d7d01123a38427b4bc52ef39733e2e
7
+ data.tar.gz: '008e15ce28bfdd511fdd4186081368a7989bfae05e8d424b04ef5408248233f070e35b81f356312284636581c940ae1ca4c19fb64ccd730184e2753ae50252d3'
@@ -3,6 +3,7 @@
3
3
  //= require ish_manager/vendor/jquery.ui.widget
4
4
  //= require ish_manager/vendor/jquery.fileupload
5
5
  //= require ish_manager/vendor/jquery-ui.min
6
+ //
6
7
  // require ish_manager/vendor/summernote-bs4.min
7
8
  //
8
9
  //= require ish_manager/shared
@@ -13,6 +14,7 @@
13
14
  //= require ish_manager/email_templates
14
15
  //= require ish_manager/galleries
15
16
  //= require ish_manager/iro
17
+ //= require ish_manager/leads
16
18
  //
17
19
 
18
20
  const AppRouter = {
@@ -0,0 +1,13 @@
1
+
2
+
3
+ $(document).ready(() => {
4
+
5
+ $("input[type='checkbox']#selectAll").change(function () {
6
+ logg(this, 'clicked')
7
+
8
+ const checked = $(this).prop('checked')
9
+ $(this).closest('table').find("tbody input[type='checkbox']").prop('checked', checked)
10
+ })
11
+
12
+ })
13
+
@@ -15,6 +15,7 @@
15
15
  .leads--index,
16
16
  .leads-index,
17
17
  .leads-show,
18
+ .leadsets-show,
18
19
  .scheduled-email-actions--form,
19
20
  .scheduled-emails-index {
20
21
  .header {
@@ -22,7 +23,9 @@
22
23
  justify-content: center;
23
24
  }
24
25
  }
25
-
26
+ .ctxs {
27
+ text-align: center;
28
+ }
26
29
  .email-actions--form {
27
30
  .select2-container {
28
31
  flex-grow: 1;
@@ -71,27 +71,27 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
71
71
  @leads = @leads.page( params[:leads_page ] ).per( current_profile.per_page )
72
72
 
73
73
  @email_contexts = {}
74
- # lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
75
- # map = %Q{
76
- # function() {
77
- # emit(this.to_email, {count: 1})
78
- # }
79
- # }
80
- # reduce = %Q{
81
- # function(key, values) {
82
- # var result = {count: 0};
83
- # values.forEach(function(value) {
84
- # result.count += value.count;
85
- # });
86
- # return result;
87
- # }
88
- # }
89
- # tmp_contexts = Ish::EmailContext.all.where( :to_email.in => lead_emails
90
- # ).map_reduce( map, reduce
91
- # ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
92
- # ).to_a
93
- # tmp_contexts.map { |x| @email_contexts[x[:_id]] = x[:value][:count].to_i }
94
- # puts! @email_contexts, '@email_contexts'
74
+ lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
75
+ map = %Q{
76
+ function() {
77
+ emit(this.to_email, {count: 1})
78
+ }
79
+ }
80
+ reduce = %Q{
81
+ function(key, values) {
82
+ var result = {count: 0};
83
+ values.forEach(function(value) {
84
+ result.count += value.count;
85
+ });
86
+ return result;
87
+ }
88
+ }
89
+ tmp_contexts = Ish::EmailContext.all.where( :to_email.in => lead_emails
90
+ ).map_reduce( map, reduce
91
+ ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
92
+ ).to_a
93
+ tmp_contexts.map { |x| @email_contexts[x[:_id]] = x[:value][:count].to_i }
94
+ puts! @email_contexts, '@email_contexts'
95
95
 
96
96
  end
97
97
 
@@ -33,7 +33,11 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController
33
33
 
34
34
  def index
35
35
  authorize! :index, Leadset
36
- @leadsets = Leadset.all.kept.page( params[:leadsets_page] ).per( current_profile.per_page )
36
+ @leadsets = Leadset.all.kept.includes(:leads)
37
+ if params[:q].present?
38
+ @leadsets = @leadsets.where(" company_url LIKE ? ", "%#{params[:q]}%" )
39
+ end
40
+ @leadsets = @leadsets.page( params[:leadsets_page] ).per( current_profile.per_page )
37
41
  end
38
42
 
39
43
  def new
@@ -42,8 +46,12 @@ class ::IshManager::LeadsetsController < IshManager::ApplicationController
42
46
  end
43
47
 
44
48
  def show
45
- authorize! :redirect, IshManager::Ability
46
- redirect_to :action => :edit, :id => params[:id]
49
+ @leadset = Leadset.find params[:id]
50
+ authorize! :show, @leadset
51
+ @email_contexts = {}
52
+ @leadset.employees.each do |lead|
53
+ @email_contexts[lead.email] = lead.email_contexts
54
+ end
47
55
  end
48
56
 
49
57
  def update
@@ -67,7 +67,7 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
67
67
  if params[:redirect_to]
68
68
  redirect_to params[:redirect_to]
69
69
  else
70
- redirect_to :action => :index
70
+ redirect_to request.referrer
71
71
  end
72
72
  end
73
73
 
@@ -59,7 +59,7 @@
59
59
  = link_to "Tmpls (#{Ish::EmailTemplate.all.count})", email_templates_path
60
60
  = link_to '[+]', new_email_template_path
61
61
  %li
62
- = link_to "Co's (#{Leadset.kept.length})", leadsets_path
62
+ = link_to "Companies (#{Leadset.kept.length})", leadsets_path
63
63
  = link_to '[+]', new_leadset_path
64
64
 
65
65
 
@@ -9,5 +9,6 @@
9
9
  - @campaigns.each do |c|
10
10
  %li
11
11
  = link_to c.slug, email_campaign_path(c)
12
+ (#{c.leads.length})
12
13
  = link_to '[~]', edit_email_campaign_path(c)
13
14
 
@@ -31,15 +31,15 @@
31
31
  %tbody
32
32
  - @ctxs.each do |ctx|
33
33
  %tr
34
- %td
34
+ %td.actions
35
35
  - if ctx.sent_at
36
36
  [~]
37
37
  - else
38
38
  = link_to '[~]', edit_email_context_path(ctx)
39
39
  = button_to '[x]', email_context_path(ctx), method: :delete, form_class: :inline, data: { confirm: 'Are you sure?' }
40
- %td
40
+ %td.from
41
41
  = ctx.from_email ? ctx.from_email : "t| #{ctx.tmpl.from_email}"
42
- %td= ctx.to_email
42
+ %td.to= link_to ctx.lead.email, lead_path(ctx.lead)
43
43
  %td
44
44
  = link_to email_context_path(ctx) do
45
45
  = ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
@@ -2,30 +2,38 @@
2
2
  -#
3
3
  -# receives locals: leads , email_contexts , search_path
4
4
  -#
5
+ - email_contexts ||= {}
6
+
5
7
  .leads--index.padded
6
8
  .header
7
9
  %h2.title
8
- Leads (#{leads.total_count})
10
+ Leads
11
+ - if !defined?( skip_pagination ) || !skip_pagination
12
+ (#{leads.total_count})
13
+ - else
14
+ (#{leads.length})
9
15
  = link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
10
16
 
11
- .float-right= render 'search', path: search_path
17
+ - if defined?( search_path )
18
+ .float-right= render 'search', path: search_path
12
19
  = form_tag leads_bulkop_path do
13
20
  = label_tag 'Act on Selected:'
14
21
  = select_tag :op, options_for_select( [[nil,nil]] + Lead::OPS )
15
22
  = select_tag :email_campaign_id, options_for_select( @email_campaigns_list )
16
23
  = submit_tag 'Go'
17
24
 
18
- = paginate leads, param_name: :leads_page
25
+ - if !defined?( skip_pagination ) || !skip_pagination
26
+ = paginate leads, param_name: :leads_page
19
27
  %table.bordered
20
28
  %thead
21
29
  %tr
22
- %th &nbsp;
30
+ %th= check_box_tag :selectAll
23
31
  %th Name/Email
24
32
  %th.company Company
25
33
  %th Phone, address
26
34
  %th Tag
27
35
  %th created_at
28
- %th Ctx
36
+ %th.ctxs Ctxs
29
37
  %th Sch
30
38
 
31
39
  %tbody
@@ -42,8 +50,8 @@
42
50
  .a= lead.address if lead.address.present?
43
51
  %td= lead.wp_tags.map(&:name).join(", ")
44
52
  %td= lead.created_at.to_s[0..10]
45
- %td.ctx
46
- = email_contexts[lead.email] || '-'
53
+ %td.ctxs
54
+ = email_contexts[lead.email].length || '-'
47
55
  %td.sch
48
56
  = lead.scheduled_email_actions.length
49
57
  = link_to '[+]', new_scheduled_email_action_path( lead_id: lead.id )
@@ -53,7 +61,8 @@
53
61
  -# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
54
62
  -# [x]
55
63
 
56
- = paginate leads, param_name: :leads_page
64
+ - if !defined?( skip_pagination ) || !skip_pagination
65
+ = paginate leads, param_name: :leads_page
57
66
 
58
67
 
59
68
 
@@ -9,6 +9,7 @@
9
9
  %ul
10
10
  %li Name: #{@lead.name}
11
11
  %li Email: #{@lead.email}
12
+ %li Company: #{ link_to @lead.company.company_url, leadset_path(@lead.company) }
12
13
  %li Phone: #{@lead.phone}
13
14
  %li Address: #{@lead.address}
14
15
 
@@ -13,26 +13,24 @@
13
13
  .n-selected -
14
14
  = button_tag 'Delete', method: :delete, class: 'delete-btn'
15
15
 
16
+ .float-right= render 'search', path: leadsets_path
16
17
  = paginate @leadsets, :param_name => :leadsets_page, :views_prefix => 'ish_manager'
17
- %table
18
+ %table.bordered
18
19
  %thead
19
20
  %tr
20
21
  %th &nbsp;
21
- -# %th created at
22
- -# %th Name
23
22
  %th.company-url Company Url
24
23
  %th Tags
25
24
  %th +
25
+ %th.employees Employees
26
26
  %th.leads Leads
27
27
  %tbody
28
28
  - @leadsets.each_with_index do |leadset, idx1|
29
29
  %tr
30
30
  %td= check_box_tag 'leadset_ids[]', leadset.id, nil, { class: 'i-sel' }
31
- -# %td= leadset.created_at.strftime("%Y-%m-%d %H:%M%P")
32
- -# %td= link_to leadset.name, leadset_path( leadset )
33
- %td= link_to leadset.company_url, leadset.company_url
34
- %td.tags
31
+ %td= link_to leadset.company_url, leadset_path(leadset)
35
32
 
33
+ %td.tags
36
34
  - leadset.wp_tags.each_with_index do |tag, idx2|
37
35
  .chip
38
36
  = tag.name
@@ -47,35 +45,36 @@
47
45
  .actions
48
46
  = submit_tag 'Add'
49
47
 
50
- %td.leads
51
- -# = leadset.leads.count
52
- - leadset.leads.each do |lead|
53
- .item
48
+ %td.employees
49
+ = leadset.employees.length
50
+ -# - leadset.employees.each do |lead|
51
+ -# .item
52
+
53
+ -# .chip
54
+ -# -# = lead.email
55
+ -# = link_to lead.name, lead_path( lead )
54
56
 
55
- .chip
56
- -# = lead.email
57
- = link_to lead.name, lead_path( lead )
57
+ -# .relative
58
+ -# %a.chip{ href: email_contexts_for_lead_path( lead ) }
59
+ -# \(
60
+ -# = lead.email_contexts.count
61
+ -# %i.fa.fa-envelope
62
+ -# \)
58
63
 
59
- .relative
60
- %a.chip{ href: email_contexts_for_lead_path( lead ) }
61
- \(
62
- = lead.email_contexts.count
63
- %i.fa.fa-envelope
64
- \)
64
+ -# .relative
65
+ -# %i.fa.fa-pencil.expand-next
66
+ -# %form.form-mini{ style: 'display: none' }
67
+ -# Editing...
65
68
 
66
- .relative
67
- %i.fa.fa-pencil.expand-next
68
- %form.form-mini{ style: 'display: none' }
69
- Editing...
69
+ -# .relative
70
+ -# %i.fa.fa-clock-o.expand-next
71
+ -# .expand-hide= render 'ish_manager/scheduled_email_actions/form', scheduled_email_action: Sch.new({ lead_id: lead.id })
70
72
 
71
- .relative
72
- %i.fa.fa-clock-o.expand-next
73
- = render 'ish_manager/scheduled_email_actions/form', scheduled_email_action: Sch.new({ lead_id: lead.id })
73
+ -# -# .scheduled
74
+ -# -# - lead.scheduled_emails.each do |sch|
75
+ -# -# .chip
76
+ -# -# -# .interval= sch.interval
77
+ -# -# -# .tmpl= sch.email_template.slug
74
78
 
75
- .scheduled
76
- - lead.scheduled_emails.each do |sch|
77
- .chip
78
- .interval= sch.interval
79
- .tmpl= sch.email_template.slug
80
79
  = paginate @leadsets, :param_name => :leadsets_page, :views_prefix => 'ish_manager'
81
80
 
@@ -0,0 +1,5 @@
1
+
2
+ .leadsets-show.max-width
3
+ .header
4
+ %h2.title Leadset #{@leadset.company_url}
5
+ = render 'ish_manager/leads/index', leads: @leadset.employees, skip_pagination: true, email_contexts: @email_contexts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.429
4
+ version: 0.1.8.430
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -252,6 +252,7 @@ files:
252
252
  - app/assets/javascripts/ish_manager/email_templates.js
253
253
  - app/assets/javascripts/ish_manager/galleries.js
254
254
  - app/assets/javascripts/ish_manager/iro.js
255
+ - app/assets/javascripts/ish_manager/leads.js
255
256
  - app/assets/javascripts/ish_manager/maps.js
256
257
  - app/assets/javascripts/ish_manager/shared.js
257
258
  - app/assets/javascripts/ish_manager/vendor/jquery-ui.min.js
@@ -665,6 +666,7 @@ files:
665
666
  - app/views/ish_manager/leadsets/index.haml
666
667
  - app/views/ish_manager/leadsets/index_dataTables.haml
667
668
  - app/views/ish_manager/leadsets/new.haml
669
+ - app/views/ish_manager/leadsets/show.haml
668
670
  - app/views/ish_manager/maps/_form.haml
669
671
  - app/views/ish_manager/maps/_index_item.haml
670
672
  - app/views/ish_manager/maps/_map_meta_row.haml