ish_manager 0.1.8.431 → 0.1.8.433

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: a6f1b0f07e5b49a3f1aef9c15acb767d8c02420d20be6875d523b319297cd31b
4
- data.tar.gz: 5ed7d17e31bd4873a9d06f8e7375c576059211ad122cc6e48659f6931174f127
3
+ metadata.gz: 3851f500f04389f2ec81a1a8dd31f47060d9f001be4ddeb4244ea808909c0644
4
+ data.tar.gz: 7676488b23694c001a8ae1453eba0ce3a6b0ef55ce31336a4c5bc050f2f6c5dc
5
5
  SHA512:
6
- metadata.gz: 699e248f1b23b586ba81734afc67ce008ac48264c3a0980ad8841f595f771c5edaeeda6409178cc7eab394d695ee51944e551687ff564020faef0d7d8a172fa8
7
- data.tar.gz: 0f2521916b15ffe1980fa17d5f46ef307d2fb9fab954f05ee796b669c4e7c2edb041b6375119f085635f9062ef4dcafbc942c67ad7c20c36297939e4703d3dd2
6
+ metadata.gz: 7c65c1edb906422b3ad548447da0d48811d7083e6d33b89de64d87aa4a5595f0b112f5c34d683da78449b6aa1fdfe9d2c8a6c2a704353399633d0173faf4e34a
7
+ data.tar.gz: 9facdfad77ef6a9e60058a348f42a00b77591fbcb252e50081ea0bad56eb5f5221a6c943c86a37deef15a81d1ed33edc5992236a4f4502fd0fb71ed17caa2f27
@@ -23,7 +23,9 @@
23
23
  justify-content: center;
24
24
  }
25
25
  }
26
- .ctxs {
26
+
27
+ th.ctxs,
28
+ td.ctxs {
27
29
  text-align: center;
28
30
  }
29
31
  .email-actions--form {
@@ -70,28 +70,28 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
70
70
  end
71
71
  @leads = @leads.page( params[:leads_page ] ).per( current_profile.per_page )
72
72
 
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'
73
+ # @email_contexts = {}
74
+ # # lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
75
+ # lead_ids = @leads.map( &:id )
76
+ # map = %Q{
77
+ # function() {
78
+ # emit(''+this.lead_id, {count: 1})
79
+ # }
80
+ # }
81
+ # reduce = %Q{
82
+ # function(key, values) {
83
+ # var result = {count: 0};
84
+ # values.forEach(function(value) {
85
+ # result.count += value.count;
86
+ # });
87
+ # return result;
88
+ # }
89
+ # }
90
+ # tmp_contexts = Ish::EmailContext.all.where( :lead_id.in => lead_ids
91
+ # ).map_reduce( map, reduce
92
+ # ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
93
+ # ).to_a
94
+ # tmp_contexts.map { |x| @email_contexts[x[:_id]] = x[:value][:count].to_i }
95
95
 
96
96
  end
97
97
 
@@ -116,7 +116,8 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
116
116
  else
117
117
  flash[:alert] = "Cannot update lead: #{@lead.errors.messages}"
118
118
  end
119
- redirect_to :action => 'index'
119
+ ## 2023-05-14 NOT redirecting to index anymore.
120
+ redirect_to :action => 'show', id: @lead.id
120
121
  end
121
122
 
122
123
  end
@@ -34,7 +34,7 @@
34
34
  .label-save-preview= f.submit 'Save & Preview'
35
35
  .tabs
36
36
  .tab-raw
37
- = f.text_area :body, class: 'tinymce'
37
+ = f.text_area :body
38
38
  .tab-preview
39
39
  - if ctx.new_record?
40
40
  New record...
@@ -23,6 +23,10 @@
23
23
  = f.label "Leadset (company)"
24
24
  = f.select :m3_leadset_id, options_for_select(@leadsets_list, selected: lead.m3_leadset_id), { include_blank: true }, { class: 'select2' }
25
25
 
26
+ .field
27
+ = f.label :comment
28
+ = f.text_area :comment
29
+
26
30
  -# .field
27
31
  -# = f.label "Tags"
28
32
  -# = f.text_field :wp_tags
@@ -1,8 +1,8 @@
1
1
 
2
2
  -#
3
- -# receives locals: leads , email_contexts , search_path
3
+ -# receives locals: leads , search_path
4
4
  -#
5
- - email_contexts ||= {}
5
+ -# - email_contexts ||= {}
6
6
 
7
7
  .leads--index.padded
8
8
  .header
@@ -40,7 +40,9 @@
40
40
  - leads.each do |lead|
41
41
  %tr
42
42
  %td= check_box_tag 'lead_ids[]', lead.id
43
- %td= link_to "#{lead.name} <#{lead.email}>", lead_path( lead )
43
+ %td
44
+ = link_to '[~]', edit_lead_path( lead )
45
+ = link_to "#{lead.name} <#{lead.email}>", lead_path( lead )
44
46
  %td.company
45
47
  = lead.company.company_url
46
48
  - if lead.company.name.present?
@@ -51,7 +53,10 @@
51
53
  %td= lead.wp_tags.map(&:name).join(", ")
52
54
  %td= lead.created_at.to_s[0..10]
53
55
  %td.ctxs
54
- = email_contexts[lead.email]&.length || '-'
56
+ = lead.email_contexts.length
57
+ -## without the N+1 but unfinished and messy:
58
+ -# = email_contexts[lead.id] || '-'
59
+
55
60
  %td.sch
56
61
  = lead.scheduled_email_actions.length
57
62
  = link_to '[+]', new_scheduled_email_action_path( lead_id: lead.id )
@@ -1,2 +1,3 @@
1
1
 
2
- = render 'index', leads: @leads, email_contexts: @email_contexts, search_path: leads_path
2
+ = @email_contexts
3
+ = render 'index', leads: @leads, search_path: leads_path
@@ -12,6 +12,7 @@
12
12
  %li Company: #{ link_to @lead.company.company_url, leadset_path(@lead.company) }
13
13
  %li Phone: #{@lead.phone}
14
14
  %li Address: #{@lead.address}
15
+ %li Comment: #{raw @lead.comment}
15
16
 
16
17
  .row
17
18
  .col-md-6.ctxs
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.431
4
+ version: 0.1.8.433
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox