ish_manager 0.1.8.419 → 0.1.8.420

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86d230d2dfd6f1b6973de7a7149f842fd60cbf22fecacf9b33f0189cdd2aa548
4
- data.tar.gz: 778d653ae2bddc09480bcdb76233e4faf917f0269b9c0c3ba496725a56676f1e
3
+ metadata.gz: 40b6609b30c07eabd56d2eb9c2ec69669abd4c57c87a502c96f69895e4f10925
4
+ data.tar.gz: e31726bba10b0c7bb6ef2f3cd65171dec1a2352926ae914c53b0cab386b13e18
5
5
  SHA512:
6
- metadata.gz: d4f17c27e7dd75e6718d1b84bcd5a54415ad94b8181db7d1916deeb3ff25f69429d800b580f97c6d9629f06f7749c8f83dabe1a3bba7a3fcc820b534b4a16f4a
7
- data.tar.gz: 0de72042c870fe8218fcc492d8b634a371dbe61396c1a2383c6dfcf63f86a69b2cdd516a1bf65e55774503bd2dac861f23f17c35b3a3da2521f0415d64455ce2
6
+ metadata.gz: 9add72829e88a2b0e89e66e6ca5b0afea80d149524c2c3bf13c4e359f7d97f67fb2128e3398990c57cf91cef3d23b79e9649753ae062d23c5c9f5560dfc4d2bd
7
+ data.tar.gz: 4748a3a1adc0452c14f4a98e3a680442a11e432e3ff2385e82e0e1c30b2beb89788a71df3bb584a7c6e31567431664ad14edde730b67e12a635d8e1fb1aac106
@@ -2,6 +2,7 @@
2
2
  * Alphabetized : )
3
3
  *
4
4
  *= require ish_manager/jquery-ui
5
+ *= require ish_manager/kaminari_pagination
5
6
  *= require_self
6
7
  *
7
8
  *= require ish_manager/email_contexts
@@ -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
+
@@ -1,4 +1,8 @@
1
1
 
2
+ .doc {
3
+ max-width: 555px;
4
+ }
5
+
2
6
  .manager-leads-index {
3
7
  th.company-url {
4
8
  width: 10px;
@@ -10,5 +10,11 @@ class ::IshManager::CategoriesController < IshManager::ApplicationController
10
10
  @tags = Category.all_tags
11
11
  end
12
12
 
13
+ def show
14
+ @category = WpTag.find params[:id]
15
+ authorize! :show, @category
16
+
17
+ end
18
+
13
19
  end
14
20
 
@@ -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
- if row[4].present?
78
- tags = row[4].split(",").map do |tag_name|
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
- lead_emails = @leads.map( &:email ).compact.reject(&:empty?)
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-6
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-2
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,8 +1,8 @@
1
1
 
2
2
  -## provides local vars: subtree, config
3
3
 
4
- - puts! config, 'config'
5
- - puts! subtree, 'subtree'
4
+ -# - puts! config, 'config'
5
+ -# - puts! subtree, 'subtree'
6
6
 
7
7
  %ul
8
8
  - subtree.select { |c| c[5] == config[:parent_id] }.each do |c|
@@ -9,4 +9,7 @@
9
9
  %h1 Tags
10
10
  %ul
11
11
  - @tags.each do |tag|
12
- %li= tag[:name]
12
+ %li
13
+ = tag[:taxonomy]
14
+ \::
15
+ = link_to tag[:name], category_path( tag[:id] )
@@ -0,0 +1,10 @@
1
+
2
+ .categories-show.max-width
3
+ .header
4
+ %h2.title Category/Tag `#{@category.slug}`
5
+
6
+ .leads
7
+ %h3 Leads (#{@category.leads.length})
8
+ %ol
9
+ - @category.leads.each do |lead|
10
+ %li= link_to lead.email, lead_path(lead)
@@ -1,11 +1,11 @@
1
1
 
2
- = form_tag leads_import_path, multipart: true do
3
- .doc
4
- %ul
5
- %li Fields: id, date, name, email, tag, phone, linkedin, comment
6
- .field
7
- %label File
8
- = file_field_tag :csv_file
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
- .actions
11
- = submit_tag 'Submit'
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.data-table
15
+ %table.bordered
15
16
  %thead
16
17
  %tr
17
18
  %th &nbsp;
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= lead.company.company_url
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
@@ -3,7 +3,8 @@ IshManager::Engine.routes.draw do
3
3
 
4
4
  root :to => 'application#home'
5
5
 
6
- get 'categories', to: 'categories#index'
6
+ # get 'categories', to: 'categories#index'
7
+ resources :categories
7
8
 
8
9
  resources 'events'
9
10
 
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.419
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-07 00:00:00.000000000 Z
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