wco_models 3.1.0.131 → 3.1.0.133

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: 851e8e001bf09f1042638754ef22c0d943bc00b62519f9f869b9e3876ff6f7b5
4
- data.tar.gz: 2e3b5dc89b06e897e21613d13df201033ebf52dc8c067650dd345a568d232c79
3
+ metadata.gz: '08e95dc229ad1424fb5712f08008e7c36011c34d1185ea68ab62d427d2165459'
4
+ data.tar.gz: a315d6d0595e141555526012f89a0e9548c0a61f5107441b29ba0f8161414b28
5
5
  SHA512:
6
- metadata.gz: cc62d5bc28d595a2140efcbadb652b9af60f3e6c4284034e4a1a96bcb6e78497e6e09d7f1566b1934ae4f329b4a765d0dc946c84d63c51ef54ae0fe697df98ce
7
- data.tar.gz: 906f395e8a428a1eacebd532b555f7e837f8ac3468923703f7b90bb0e089ad53358928b244352fb7e3ecda684ac5adc4c58127d51e2e3b6c064dec6b7336d4d9
6
+ metadata.gz: 0fc514ec8dffd6b0be83fd5362f512828bfe0b0bd7f199f51c1f6221a5114049c45b12334e59d4277c4f0e21ea73d0d48d7e58b33259aa2caca4218daf04ba62
7
+ data.tar.gz: f8f51784b26e0230d815dd68de3230ed5329eb94754c9c6a23b084e6b1c3dcdd973d4909781b5cf9ed65b7f2180a452e9a9828a365a9bce378d4ef1fa055266a
@@ -0,0 +1,9 @@
1
+
2
+ class Wco::Api::LeadsController < Wco::ApiController
3
+
4
+ def index_hash
5
+ authorize! :index, Wco::Lead
6
+ @leads = Wco::Lead.find( params[:lead_ids].split(',') )
7
+ end
8
+
9
+ end
@@ -0,0 +1,19 @@
1
+
2
+ class Wco::ApiController < ActionController::Base
3
+ layout false
4
+
5
+ before_action :decode_jwt
6
+
7
+ ##
8
+ ## private
9
+ ##
10
+ private
11
+
12
+ def decode_jwt
13
+ out = JWT.decode params[:jwt_token], nil, false
14
+ email = out[0]['email']
15
+ user = User.find_by({ email: email })
16
+ sign_in user
17
+ end
18
+
19
+ end
@@ -67,11 +67,8 @@ class Wco::LeadsController < Wco::ApplicationController
67
67
  redirect_to request.referrer
68
68
  return
69
69
  end
70
- @ctxs = @lead.ctxs.page( params[:ctxs_page] ).per( current_profile.per_page )
71
-
72
- ## not paginated b/c of dataTable:
73
- @convs = @lead.conversations # .includes(:messages)
74
- # ).page( params[:convs_page] ).per( current_profile.per_page )
70
+ @ctxs = @lead.ctxs.page( params[:ctxs_page] ).per( current_profile.per_page )
71
+ @convs = @lead.conversations.page( params[:convs_page] ).per( current_profile.per_page )
75
72
 
76
73
  end
77
74
 
@@ -0,0 +1,8 @@
1
+
2
+
3
+ @leads.each do |lead|
4
+ json.set! lead.id.to_s do
5
+ json.email lead.email
6
+ end
7
+ end
8
+
@@ -70,5 +70,7 @@
70
70
  .row
71
71
  .col-md-12.conversations
72
72
  %h5 Email Conversations (#{@convs.length})
73
+ = paginate @convs, param_name: :convs_page
73
74
  = render 'wco_email/conversations/table', convs: @convs
75
+ = paginate @convs, param_name: :convs_page
74
76
 
data/config/routes.rb CHANGED
@@ -2,6 +2,10 @@
2
2
  Wco::Engine.routes.draw do
3
3
  root to: 'application#home'
4
4
 
5
+ namespace :api do
6
+ get 'leads/index_hash', to: 'leads#index_hash'
7
+ end
8
+
5
9
  get 'application/tinymce', to: 'application#tinymce'
6
10
 
7
11
  resources :assets
@@ -22,10 +26,10 @@ Wco::Engine.routes.draw do
22
26
  post 'invoices/:id/send-stripe', to: 'invoices#send_stripe', as: :send_invoice_stripe
23
27
  resources :invoices
24
28
 
25
- get 'leads/new', to: 'leads#new'
29
+ get 'leads/new', to: 'leads#new'
26
30
  post 'leads/bulkop', to: 'leads#bulkop'
27
31
  post 'leads/import', to: 'leads#import', as: :leads_import
28
- get 'leads/:id', to: 'leads#show', id: /[^\/]+/
32
+ get 'leads/:id', to: 'leads#show', id: /[^\/]+/
29
33
  resources :leads
30
34
  resources :leadsets
31
35
  delete 'logs/bulkop', to: 'logs#bulkop', as: :logs_bulkop
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.131
4
+ version: 3.1.0.133
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -409,6 +409,8 @@ files:
409
409
  - app/assets/stylesheets/wco/photos.scss
410
410
  - app/assets/stylesheets/wco/utils.scss
411
411
  - app/assets/stylesheets/wco/videos.scss
412
+ - app/controllers/wco/api/leads_controller.rb
413
+ - app/controllers/wco/api_controller.rb
412
414
  - app/controllers/wco/application_controller.rb
413
415
  - app/controllers/wco/galleries_controller.rb
414
416
  - app/controllers/wco/headlines_controller.rb
@@ -480,6 +482,7 @@ files:
480
482
  - app/views/wco/_main_header.haml
481
483
  - app/views/wco/_paginate.haml
482
484
  - app/views/wco/_search.haml
485
+ - app/views/wco/api/leads/index_hash.jbuilder
483
486
  - app/views/wco/application/_auth_widget.haml
484
487
  - app/views/wco/application/_debug.haml
485
488
  - app/views/wco/application/_meta.haml