ish_manager 0.1.8.419 → 0.1.8.420
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/ish_manager/application.scss +1 -0
- data/app/assets/stylesheets/ish_manager/kaminari_pagination.scss +40 -0
- data/app/assets/stylesheets/ish_manager/leads_leadsets.scss +4 -0
- data/app/controllers/ish_manager/categories_controller.rb +6 -0
- data/app/controllers/ish_manager/leads_controller.rb +19 -47
- data/app/views/ish_manager/application/_main_footer.haml +8 -3
- data/app/views/ish_manager/categories/_subtree.haml +2 -2
- data/app/views/ish_manager/categories/index.haml +4 -1
- data/app/views/ish_manager/categories/show.haml +10 -0
- data/app/views/ish_manager/leads/_form_import.haml +9 -9
- data/app/views/ish_manager/leads/index.haml +10 -5
- data/config/routes.rb +2 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b6609b30c07eabd56d2eb9c2ec69669abd4c57c87a502c96f69895e4f10925
|
4
|
+
data.tar.gz: e31726bba10b0c7bb6ef2f3cd65171dec1a2352926ae914c53b0cab386b13e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9add72829e88a2b0e89e66e6ca5b0afea80d149524c2c3bf13c4e359f7d97f67fb2128e3398990c57cf91cef3d23b79e9649753ae062d23c5c9f5560dfc4d2bd
|
7
|
+
data.tar.gz: 4748a3a1adc0452c14f4a98e3a680442a11e432e3ff2385e82e0e1c30b2beb89788a71df3bb584a7c6e31567431664ad14edde730b67e12a635d8e1fb1aac106
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
.pagination a, .pagination span.current, .pagination span.gap {
|
3
|
+
float: left;
|
4
|
+
padding: 0 14px;
|
5
|
+
line-height: 38px;
|
6
|
+
text-decoration: none;
|
7
|
+
background-color: white;
|
8
|
+
border: 1px solid #DDD;
|
9
|
+
border-left-width: 0;
|
10
|
+
}
|
11
|
+
|
12
|
+
.pagination {
|
13
|
+
border-left: 1px solid #ddd;
|
14
|
+
.first{
|
15
|
+
padding : 0;
|
16
|
+
float: none;
|
17
|
+
border: none;
|
18
|
+
}
|
19
|
+
.prev {
|
20
|
+
padding : 0;
|
21
|
+
float: none;
|
22
|
+
border: none;
|
23
|
+
}
|
24
|
+
.page{
|
25
|
+
padding : 0;
|
26
|
+
float: none;
|
27
|
+
border: none;
|
28
|
+
}
|
29
|
+
.next{
|
30
|
+
padding : 0;
|
31
|
+
float: none;
|
32
|
+
border: none;
|
33
|
+
}
|
34
|
+
.last{
|
35
|
+
padding : 0;
|
36
|
+
float: none;
|
37
|
+
border: none;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
@@ -51,65 +51,37 @@ class ::IshManager::LeadsController < IshManager::ApplicationController
|
|
51
51
|
authorize! :edit, @lead
|
52
52
|
end
|
53
53
|
|
54
|
-
## 0 1 2 3 4 5 6 7
|
55
|
-
## Fields: id, date, name, email, tag, phone, linkedin, comment
|
56
54
|
def import
|
57
55
|
authorize! :import, ::Lead
|
58
56
|
file = params[:csv_file]
|
59
|
-
flags = []
|
60
|
-
errors = []
|
61
|
-
CSV.read(file.path, headers: true).each do |row|
|
62
|
-
|
63
|
-
leadset = ::Leadset.find_or_create_by({ company_url: row[3].split('@')[1] })
|
64
|
-
lead = ::Lead.new({
|
65
|
-
name: row[2].presence || row[3].split('@')[0],
|
66
|
-
full_name: row[2].presence || row[3].split('@')[0],
|
67
|
-
email: row[3],
|
68
|
-
m3_leadset_id: leadset.id,
|
69
|
-
phone: row[5],
|
70
|
-
})
|
71
|
-
flag = lead.save
|
72
|
-
flags << flag
|
73
|
-
if !flag
|
74
|
-
errors << lead.errors.full_messages.join(", ")
|
75
|
-
end
|
76
57
|
|
77
|
-
|
78
|
-
|
79
|
-
WpTag.my_find_or_create({ name: tag_name })
|
80
|
-
end
|
81
|
-
puts! tags, 'tags'
|
82
|
-
tags.each do |tag|
|
83
|
-
LeadTag.create({ wp_tag: tag, lead: lead })
|
84
|
-
end
|
85
|
-
end
|
58
|
+
## 2023-04-08
|
59
|
+
flags = Lead.import_v1( file )
|
86
60
|
|
87
|
-
end
|
88
61
|
flash[:notice] = "Result: #{flags.inspect}."
|
89
|
-
flash[:alert] = errors
|
90
62
|
redirect_to action: 'new'
|
91
63
|
end
|
92
64
|
|
93
65
|
def index
|
94
66
|
authorize! :index, ::Lead
|
95
|
-
@leads = ::Lead.kept.includes( :company )
|
96
|
-
|
97
|
-
|
98
|
-
map = %Q{
|
99
|
-
function() {
|
100
|
-
emit(this.to_email, {count: 1})
|
101
|
-
}
|
102
|
-
}
|
103
|
-
reduce = %Q{
|
104
|
-
function(key, values) {
|
105
|
-
var result = {count: 0};
|
106
|
-
values.forEach(function(value) {
|
107
|
-
result.count += value.count;
|
108
|
-
});
|
109
|
-
return result;
|
110
|
-
}
|
111
|
-
}
|
67
|
+
@leads = ::Lead.kept.includes( :company ).page( params[:leads_page ] ).per( current_profile.per_page )
|
68
|
+
|
112
69
|
@email_contexts = {}
|
70
|
+
# lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
|
71
|
+
# map = %Q{
|
72
|
+
# function() {
|
73
|
+
# emit(this.to_email, {count: 1})
|
74
|
+
# }
|
75
|
+
# }
|
76
|
+
# reduce = %Q{
|
77
|
+
# function(key, values) {
|
78
|
+
# var result = {count: 0};
|
79
|
+
# values.forEach(function(value) {
|
80
|
+
# result.count += value.count;
|
81
|
+
# });
|
82
|
+
# return result;
|
83
|
+
# }
|
84
|
+
# }
|
113
85
|
# tmp_contexts = Ish::EmailContext.all.where( :to_email.in => lead_emails
|
114
86
|
# ).map_reduce( map, reduce
|
115
87
|
# ).out( inline: 1 ## From: https://www.mongodb.com/docs/mongoid/current/reference/map-reduce/
|
@@ -8,7 +8,7 @@
|
|
8
8
|
Account & Session
|
9
9
|
.a
|
10
10
|
.row
|
11
|
-
.col-sm-
|
11
|
+
.col-sm-4
|
12
12
|
%ul
|
13
13
|
%li <b>Email:</b> #{@current_profile.email}
|
14
14
|
%li <b>Role name:</b> #{@current_profile.role_name}
|
@@ -21,8 +21,13 @@
|
|
21
21
|
%li= Time.now.to_s
|
22
22
|
-# <pre>#{@changelog}</pre>
|
23
23
|
|
24
|
-
.col-sm-
|
25
|
-
= button_to 'Logout', main_app.destroy_user_session_path, :method => :delete
|
24
|
+
.col-sm-4
|
25
|
+
= button_to 'Logout', main_app.destroy_user_session_path, :method => :delete, data: { confirm: 'Are you sure?' }
|
26
|
+
= form_for @current_profile, url: profile_path(@current_profile), as: :profile do |f|
|
27
|
+
.flex-row
|
28
|
+
= f.label :per_page
|
29
|
+
= f.select :per_page, options_for_select([ 10, 25, 50, 100, 250, 500, 1000], selected: @current_profile.per_page)
|
30
|
+
= f.submit 'Go'
|
26
31
|
|
27
32
|
.c
|
28
33
|
= render 'debug' if !Rails.env.production?
|
@@ -1,11 +1,11 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
%
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
.Card
|
3
|
+
= form_tag leads_import_path, multipart: true do
|
4
|
+
.doc
|
5
|
+
%pre= Lead.import_v1_fields
|
6
|
+
.field
|
7
|
+
%label File
|
8
|
+
= file_field_tag :csv_file
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
.actions
|
11
|
+
= submit_tag 'Submit'
|
@@ -1,22 +1,23 @@
|
|
1
1
|
|
2
|
-
.leads-index
|
2
|
+
.leads-index.padded
|
3
3
|
.header
|
4
4
|
%h2.title
|
5
5
|
#{link_to 'Kept Leads', leads_path} (#{::Lead.kept.count}, #{::Lead.all.count})
|
6
6
|
= link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
|
7
7
|
|
8
|
+
= paginate @leads, param_name: :leads_page
|
8
9
|
= form_tag leads_bulkop_path do
|
9
10
|
= label_tag 'Act on Selected:'
|
10
11
|
= select_tag :op, options_for_select( [[nil,nil]] + Lead::OPS )
|
11
12
|
= select_tag :email_campaign_id, options_for_select( @email_campaigns_list )
|
12
13
|
= submit_tag 'Go'
|
13
14
|
|
14
|
-
%table.bordered
|
15
|
+
%table.bordered
|
15
16
|
%thead
|
16
17
|
%tr
|
17
18
|
%th
|
18
19
|
%th Name/Email
|
19
|
-
%th Company
|
20
|
+
%th.company Company
|
20
21
|
%th Phone
|
21
22
|
%th Tag
|
22
23
|
%th created_at
|
@@ -28,7 +29,10 @@
|
|
28
29
|
%tr
|
29
30
|
%td= check_box_tag 'lead_ids[]', lead.id
|
30
31
|
%td= link_to "#{lead.name} <#{lead.email}>", lead_path( lead )
|
31
|
-
%td
|
32
|
+
%td.company
|
33
|
+
= lead.company.company_url
|
34
|
+
- if lead.company.name.present?
|
35
|
+
<br /><b>#{lead.company.name}</b>
|
32
36
|
%td= lead.phone
|
33
37
|
%td= lead.wp_tags.map(&:name).join(", ")
|
34
38
|
%td= lead.created_at.to_s[0..10]
|
@@ -42,7 +46,8 @@
|
|
42
46
|
-# %li
|
43
47
|
-# = link_to sch_a.email_action.slug, edit_scheduled_email_action_path( sch_a )
|
44
48
|
-# [x]
|
45
|
-
|
49
|
+
.c
|
50
|
+
= paginate @leads, param_name: :leads_page
|
46
51
|
|
47
52
|
|
48
53
|
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.420
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -271,6 +271,7 @@ files:
|
|
271
271
|
- app/assets/stylesheets/ish_manager/galleries.scss
|
272
272
|
- app/assets/stylesheets/ish_manager/iro.scss
|
273
273
|
- app/assets/stylesheets/ish_manager/jquery-ui.css
|
274
|
+
- app/assets/stylesheets/ish_manager/kaminari_pagination.scss
|
274
275
|
- app/assets/stylesheets/ish_manager/leads_leadsets.scss
|
275
276
|
- app/assets/stylesheets/ish_manager/maps.scss
|
276
277
|
- app/assets/stylesheets/ish_manager/markers.scss
|
@@ -377,6 +378,7 @@ files:
|
|
377
378
|
- app/views/ish_manager/application_mailer/welcome.html.erb
|
378
379
|
- app/views/ish_manager/categories/_subtree.haml
|
379
380
|
- app/views/ish_manager/categories/index.haml
|
381
|
+
- app/views/ish_manager/categories/show.haml
|
380
382
|
- app/views/ish_manager/email_actions/_form.haml
|
381
383
|
- app/views/ish_manager/email_actions/edit.haml
|
382
384
|
- app/views/ish_manager/email_actions/index.haml
|