wco_models 3.1.0.113 → 3.1.0.115
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/wco/{application.css → application.scss} +1 -0
- data/app/controllers/wco/leads_controller.rb +5 -0
- data/app/controllers/wco/leadsets_controller.rb +1 -0
- data/app/controllers/wco/prices_controller.rb +3 -5
- data/app/models/wco/leadset.rb +3 -2
- data/app/models/wco_hosting/domain.rb +5 -0
- data/app/models/wco_hosting/serverhost.rb +1 -0
- data/app/models/wco_hosting/subdomain.rb +24 -0
- data/app/views/wco/leads/_index.haml +1 -9
- data/app/views/wco/leads/index.haml +10 -0
- data/app/views/wco/leadsets/show.haml +47 -21
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d70a4892d30e5a9b9c0770cfaffdd6ee5c88bf57b5af541eba11c322f8e5d2ce
|
4
|
+
data.tar.gz: ba8e775b3c215866039f00c458c2405b3b35084300f46543f9190047fb55d3c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f2e8846418c1b9ac3e3d9318915028a8b558b6249edfda6f7d7767dc1a2d92f1ec6971d41dee3b27b698b72ab3d1017f77112ff6f3519a5f96ce0e548c08bc4
|
7
|
+
data.tar.gz: '06229f19a036feb27e63c48fa7beb7540a282dbc85b5f205e2388b8d191825e1d8a0bd1741b45f4ab509b6d3af5e651cefa16e64e06e2948099d224f289ad38a'
|
@@ -30,6 +30,11 @@ class Wco::LeadsController < Wco::ApplicationController
|
|
30
30
|
@leads = @leads.any_of(
|
31
31
|
{ email: /#{params[:q].downcase}/i },
|
32
32
|
{ name: /#{params[:q].downcase}/i } )
|
33
|
+
|
34
|
+
if 1 == @leads.length
|
35
|
+
redirect_to controller: 'wco/leads', action: 'show', id: @leads[0].id
|
36
|
+
return
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
# if params[:q_tag_ids].present?
|
@@ -83,6 +83,7 @@ class Wco::LeadsetsController < Wco::ApplicationController
|
|
83
83
|
private
|
84
84
|
|
85
85
|
def set_lists
|
86
|
+
@appliance_tmpls = WcoHosting::ApplianceTmpl.all
|
86
87
|
@serverhosts_list = WcoHosting::Serverhost.list
|
87
88
|
@tags_list = Wco::Tag.list
|
88
89
|
@leads_list = Wco::Lead.all.map { |lead| [ lead.email, lead.id ] }
|
@@ -47,11 +47,9 @@ class Wco::PricesController < Wco::ApplicationController
|
|
47
47
|
redirect_to request.referrer || root_path
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
# end
|
54
|
-
end
|
50
|
+
## delete and the create, instead
|
51
|
+
# def update
|
52
|
+
# end
|
55
53
|
|
56
54
|
end
|
57
55
|
|
data/app/models/wco/leadset.rb
CHANGED
@@ -19,10 +19,11 @@ class Wco::Leadset
|
|
19
19
|
|
20
20
|
|
21
21
|
has_many :appliances, class_name: '::WcoHosting::Appliance', inverse_of: :leadset
|
22
|
-
has_many :appliance_tmpl_prices,
|
22
|
+
has_many :appliance_tmpl_prices, class_name: 'Wco::Price'
|
23
23
|
has_many :environments, class_name: '::WcoHosting::Environment', inverse_of: :leadset
|
24
|
-
has_many :invoices,
|
24
|
+
has_many :invoices, class_name: 'Wco::Invoice'
|
25
25
|
has_many :leads, class_name: 'Wco::Lead'
|
26
|
+
has_many :subdomains, class_name: 'WcoHosting::Subdomain'
|
26
27
|
|
27
28
|
has_many :profiles, class_name: 'Wco::Profile', inverse_of: :leadset
|
28
29
|
has_many :subscriptions, class_name: 'Wco::Subscription', inverse_of: :leadset
|
@@ -8,12 +8,17 @@ class WcoHosting::Domain
|
|
8
8
|
field :name
|
9
9
|
validates :name, presence: true, uniqueness: true
|
10
10
|
|
11
|
+
has_many :subdomains, class_name: 'WcoHosting::Subdomain'
|
12
|
+
|
11
13
|
STATUS_ACTIVE = 'active'
|
12
14
|
STATUS_INACTIVE = 'inactive'
|
13
15
|
STATUSES = [ 'active', 'inactive' ]
|
14
16
|
field :status
|
15
17
|
scope :active, ->{ where(status: STATUS_ACTIVE) }
|
16
18
|
|
19
|
+
def to_s
|
20
|
+
name
|
21
|
+
end
|
17
22
|
def self.list
|
18
23
|
[[nil,nil]] + active.map { |i| [i.name, i.name ] }
|
19
24
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
class WcoHosting::Subdomain
|
3
|
+
include Mongoid::Document
|
4
|
+
include Mongoid::Timestamps
|
5
|
+
include Mongoid::Paranoia
|
6
|
+
store_in collection: 'wco_dns_subdomains'
|
7
|
+
|
8
|
+
field :name
|
9
|
+
validates :name, presence: true, uniqueness: { scope: :domain_id }
|
10
|
+
|
11
|
+
belongs_to :domain, class_name: 'WcoHosting::Domain'
|
12
|
+
belongs_to :leadset, class_name: 'Wco::Leadset'
|
13
|
+
|
14
|
+
# STATUS_ACTIVE = 'active'
|
15
|
+
# STATUS_INACTIVE = 'inactive'
|
16
|
+
# STATUSES = [ 'active', 'inactive' ]
|
17
|
+
# field :status
|
18
|
+
# scope :active, ->{ where(status: STATUS_ACTIVE) }
|
19
|
+
|
20
|
+
# def self.list
|
21
|
+
# [[nil,nil]] + active.map { |i| [i.name, i.name ] }
|
22
|
+
# end
|
23
|
+
end
|
24
|
+
|
@@ -4,15 +4,7 @@
|
|
4
4
|
-#
|
5
5
|
-# - email_contexts ||= {}
|
6
6
|
|
7
|
-
.leads--index.padded
|
8
|
-
.header
|
9
|
-
%h2.title
|
10
|
-
Leads
|
11
|
-
- if !defined?( skip_pagination ) || !skip_pagination
|
12
|
-
(#{leads.total_count})
|
13
|
-
- else
|
14
|
-
(#{leads.length})
|
15
|
-
= link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
|
7
|
+
.leads--index.container-fluid.padded
|
16
8
|
|
17
9
|
- if defined?( search_path )
|
18
10
|
.float-right= render 'wco/search', path: search_path
|
@@ -4,4 +4,14 @@
|
|
4
4
|
= select_tag :q_tag_ids, options_for_select(@tags_list, selected: params[:q_tag_ids]), { class: :select2, multiple: true }
|
5
5
|
= submit_tag 'tag-search'
|
6
6
|
%hr
|
7
|
+
|
8
|
+
.header
|
9
|
+
%h2.title
|
10
|
+
Leads
|
11
|
+
- if !defined?( skip_pagination ) || !skip_pagination
|
12
|
+
(#{leads.total_count})
|
13
|
+
- else
|
14
|
+
(#{leads.length})
|
15
|
+
= link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
|
16
|
+
|
7
17
|
= render 'index', leads: @leads, search_path: leads_path
|
@@ -1,26 +1,50 @@
|
|
1
1
|
|
2
|
-
.leadsets-show.
|
3
|
-
.
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
.leadsets-show.padded
|
3
|
+
.maxwidth
|
4
|
+
.header
|
5
|
+
%h2.title
|
6
|
+
Leadset `#{@leadset.company_url}`
|
7
|
+
= link_to '[~]', edit_leadset_path( @leadset )
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
%hr
|
9
|
+
%ul
|
10
|
+
%li <b>Email:</b> #{@leadset.email}
|
11
|
+
%li <b>company_url</b>: #{@leadset.company_url}
|
12
|
+
%li <b>customer_id</b>: #{@leadset.customer_id}
|
13
|
+
%hr
|
15
14
|
|
16
15
|
.row
|
17
16
|
.col-md-6
|
18
|
-
%h5
|
19
|
-
%
|
20
|
-
|
21
|
-
%
|
22
|
-
|
23
|
-
|
17
|
+
%h5 Appliance Tmpls (prices)
|
18
|
+
%table.bordered.data-table
|
19
|
+
%thead
|
20
|
+
%td
|
21
|
+
%td Appliance Tmpl
|
22
|
+
%td Amount Cents
|
23
|
+
%td Interval
|
24
|
+
- @appliance_tmpls.each do |tmpl|
|
25
|
+
%tr
|
26
|
+
- price = @leadset.appliance_tmpl_prices.where( product: tmpl ).first
|
27
|
+
- price ||= Wco::Price.new({ product: tmpl, appliance_tmpl_leadset: @leadset })
|
28
|
+
- url = price.new_record? ? wco.prices_path : wco.price_path(price)
|
29
|
+
- if !price.new_record?
|
30
|
+
%td
|
31
|
+
= button_to 'x', wco.price_path(price), method: :delete, data: { confirm: 'Are you sure?' }
|
32
|
+
- else
|
33
|
+
%td
|
34
|
+
= form_for price, url: url do |f|
|
35
|
+
= hidden_field_tag 'price[product_id]', price.product_id
|
36
|
+
= hidden_field_tag 'price[product_type]', price.product_type
|
37
|
+
= hidden_field_tag 'price[appliance_tmpl_leadset_id]', @leadset.id
|
38
|
+
%td
|
39
|
+
%b= tmpl
|
40
|
+
%td
|
41
|
+
= f.number_field :amount_cents
|
42
|
+
%td
|
43
|
+
= f.select :interval, options_for_select( Wco::Price::INTERVALS, selected: price.interval ), class: 'select2'
|
44
|
+
= f.submit '>'
|
45
|
+
|
46
|
+
%br
|
47
|
+
.gray= price.price_id || 'nil'
|
24
48
|
|
25
49
|
.col-md-6
|
26
50
|
%h5.collapse-expand#subscriptionsList
|
@@ -36,7 +60,8 @@
|
|
36
60
|
%td= i.product.name
|
37
61
|
%td= i.price
|
38
62
|
%hr
|
39
|
-
|
63
|
+
|
64
|
+
.row.maxwidth
|
40
65
|
.col-md-6
|
41
66
|
%h5.collapse-expand#invoicesList
|
42
67
|
Invoices (#{@leadset.invoices.length})
|
@@ -56,6 +81,7 @@
|
|
56
81
|
%hr
|
57
82
|
|
58
83
|
.row
|
59
|
-
|
60
|
-
|
84
|
+
.col-12
|
85
|
+
%h5.collapse-expand#leads Leads
|
86
|
+
= render '/wco/leads/index', leads: @leads
|
61
87
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.115
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -380,7 +380,7 @@ files:
|
|
380
380
|
- app/assets/stylesheets/production_theme.scss
|
381
381
|
- app/assets/stylesheets/vendor/bootstrap-4.6.2.min.css
|
382
382
|
- app/assets/stylesheets/wco/alerts_notices.scss
|
383
|
-
- app/assets/stylesheets/wco/application.
|
383
|
+
- app/assets/stylesheets/wco/application.scss
|
384
384
|
- app/assets/stylesheets/wco/chip.scss
|
385
385
|
- app/assets/stylesheets/wco/conversations.scss
|
386
386
|
- app/assets/stylesheets/wco/galleries.scss
|
@@ -451,6 +451,7 @@ files:
|
|
451
451
|
- app/models/wco_hosting/domain.rb
|
452
452
|
- app/models/wco_hosting/environment.rb
|
453
453
|
- app/models/wco_hosting/serverhost.rb
|
454
|
+
- app/models/wco_hosting/subdomain.rb
|
454
455
|
- app/views/layouts/wco/application.haml
|
455
456
|
- app/views/wco/_alerts_notices.haml
|
456
457
|
- app/views/wco/_analytics.erb
|