wco_models 3.1.0.49 → 3.1.0.51

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: 59ffec6c4c869d7be3284372fee1f1fd256be7be9d91aab789de5a3a16d5341e
4
- data.tar.gz: ecff78bf5d5cfd33376287ccf3dff091b098879f592c3c88aa41d6104edddfa8
3
+ metadata.gz: d2aedb50a30f432370f7a3d8dce814677b95ec4373a64594aae4b142fa7d31fa
4
+ data.tar.gz: 6b56ff81d8003170a2d7f2035de0b5708ece56d3bf2576c5f4f2575b8d4e5a84
5
5
  SHA512:
6
- metadata.gz: a8a84b80a2f8388394c496423fbc35c7eb05bd0f1d67172266ddeb429cfb37e147d496fe5e9370741766ccfbf0dd3d04bf0e2f43c6fb7485e63b67ef25da802d
7
- data.tar.gz: ab9b15349faffb29f3bcfc011ce4c75c7c73c418d04239d872cf9bedc29eea51b5a76166ac9924e901449da48e12ad5f27e6a7cfc411efd28dc0cf41deb8009f
6
+ metadata.gz: a1887e0d49d5d016b0e672118428bc71809375a1989ee89fa1976eafb8edf4976c27f5733550fd8b82921b49e819c14d3f158a7c56d469660de33fe6c36c3b01
7
+ data.tar.gz: d2330182a059ad9699441c11e40fd81b7867ec7650cad664a4f8848b56f7f8c2bbf8f712a4104f72b9950ed1c7f0483524921de999def7410a3935a319e0a727
@@ -16,6 +16,8 @@ class Wco::Lead
16
16
  belongs_to :leadset, class_name: 'Wco::Leadset'
17
17
  has_one :photo, class_name: 'Wco::Photo'
18
18
 
19
+ has_many :email_messages, class_name: '::WcoEmail::Message', inverse_of: :lead
20
+
19
21
  has_and_belongs_to_many :conversations, class_name: '::WcoEmail::Conversation'
20
22
  def convs; conversations; end
21
23
  has_many :email_contexts, class_name: '::WcoEmail::Context'
@@ -33,7 +33,7 @@ class Wco::Leadset
33
33
  field :customer_id
34
34
  def customer_id
35
35
  if self[:customer_id].blank?
36
- return nil if !email
36
+ return nil if !email.present?
37
37
  existing = Stripe::Customer.search({ query: "email: '#{email}'" })
38
38
  # puts! existing, 'existing'
39
39
  if existing.data.present?
@@ -47,4 +47,8 @@ class Wco::Leadset
47
47
  self[:customer_id]
48
48
  end
49
49
 
50
+ def to_s
51
+ company_url
52
+ end
53
+
50
54
  end
@@ -1,7 +1,7 @@
1
+
1
2
  ##
2
3
  ## Send a single email
3
4
  ##
4
-
5
5
  class WcoEmail::Context
6
6
  include Mongoid::Document
7
7
  include Mongoid::Timestamps
@@ -45,6 +45,8 @@ class WcoEmail::Context
45
45
  self[:subject].presence || tmpl.subject
46
46
  end
47
47
 
48
+ belongs_to :reply_to_message, class_name: 'WcoEmail::Message', inverse_of: :replies, optional: true
49
+
48
50
  belongs_to :email_template, class_name: 'WcoEmail::EmailTemplate'
49
51
  def tmpl; email_template; end
50
52
 
@@ -106,10 +106,10 @@ class WcoEmail::EmailTemplate
106
106
  binding()
107
107
  end
108
108
 
109
- has_many :email_actions, class_name: 'WcoEmail::EmailAction'
110
- has_many :email_contexts, class_name: 'WcoEmail::EmailContext'
111
- has_many :email_filters, class_name: 'WcoEmail::EmailFilter'
112
- has_many :unsubscribes, class_name: 'WcoEmail::Unsubscribe'
109
+ has_many :email_actions, class_name: '::WcoEmail::EmailAction'
110
+ has_many :email_contexts, class_name: '::WcoEmail::Context'
111
+ has_many :email_filters, class_name: '::WcoEmail::EmailFilter'
112
+ has_many :unsubscribes, class_name: '::WcoEmail::Unsubscribe'
113
113
 
114
114
  SLUG_BLANK = 'blank'
115
115
  def self.blank_template
@@ -49,6 +49,8 @@ class WcoEmail::Message
49
49
 
50
50
  field :from, type: :string
51
51
  field :froms, type: Array, default: []
52
+ belongs_to :lead, class_name: 'Wco::Lead', inverse_of: :email_messages
53
+
52
54
  field :to, type: :string
53
55
  field :tos, type: Array, default: []
54
56
  field :cc, type: :string
@@ -69,6 +71,7 @@ class WcoEmail::Message
69
71
 
70
72
  has_many :assets, class_name: '::Wco::Asset'
71
73
  has_many :photos, class_name: '::Wco::Photo'
74
+ has_many :replies, class_name: '::WcoEmail::Context', inverse_of: :reply_to_message
72
75
 
73
76
  def apply_filter filter
74
77
  case filter.kind
@@ -1,6 +1,6 @@
1
1
 
2
- .galleries-edit.max-width
3
- = render 'title', :gallery => @gallery
4
- = render 'form', :gallery => @gallery, :url => gallery_path( @gallery )
5
- = render 'thumbs', :gallery => @gallery
6
- = render 'wco/photos/multinew', :gallery => @gallery
2
+ .galleries-edit.maxwidth
3
+ = render 'title', gallery: @gallery
4
+ = render 'form', gallery: @gallery, :url => gallery_path( @gallery )
5
+ = render 'thumbs', gallery: @gallery
6
+ = render 'wco/photos/multinew', gallery: @gallery
@@ -1,3 +1,3 @@
1
1
 
2
- .invoices-index.max-width
2
+ .invoices-index.maxwidth
3
3
  = render 'index_table', invoices: @invoices
@@ -1,5 +1,5 @@
1
1
 
2
- .invoices-new.max-width
2
+ .invoices-new.maxwidth
3
3
 
4
4
  .row
5
5
  .col.s12.col.m6.col-md-offset-3
@@ -3,7 +3,7 @@
3
3
  - url = invoice.persisted? ? invoice_path( invoice.id ) : create_invoice_stripe_path
4
4
 
5
5
 
6
- .invoices-new.max-width
6
+ .invoices-new.maxwidth
7
7
 
8
8
  .row
9
9
  .col.s12.col.m6.col-md-offset-3
@@ -1,7 +1,7 @@
1
1
 
2
2
  - i = @invoice
3
3
 
4
- .invoices-show.max-width
4
+ .invoices-show.maxwidth
5
5
  %h5 Invoice ##{i.number}
6
6
 
7
7
  %ul
@@ -1,7 +1,7 @@
1
1
 
2
- .leads-edit.max-width
2
+ .leads-edit.maxwidth
3
3
  .header
4
- %h2.title Edit lead #{ link_to @lead.name, lead_path(@lead) }
4
+ %h5.title Edit lead #{ link_to @lead.name, lead_path(@lead) }
5
5
 
6
6
  = render 'form', :lead => @lead
7
7
 
@@ -1,5 +1,5 @@
1
1
 
2
- .leads-new.max-width
2
+ .leads-new.maxwidth
3
3
  .row
4
4
  .col-sm-12.col-md-6
5
5
  %h1 New Lead
@@ -7,10 +7,6 @@
7
7
  = f.label :company_url
8
8
  = f.text_field :company_url
9
9
 
10
- .input-field
11
- = f.label :name
12
- = f.text_field :name
13
-
14
10
  .input-field
15
11
  = f.label :email
16
12
  = f.text_field :email
@@ -1,4 +1,4 @@
1
1
 
2
- .leadsets-edit.max-width
3
- %h1 Edit leadset `#{link_to @leadset.name, leadset_path(@leadset)}`
4
- = render 'form', :leadset => @leadset
2
+ .leadsets-edit.maxwidth
3
+ %h1 Edit leadset `#{link_to @leadset.company_url, leadset_path(@leadset)}`
4
+ = render 'form', leadset: @leadset
@@ -1,5 +1,5 @@
1
1
 
2
- .leadsets-new.max-width
2
+ .leadsets-new.maxwidth
3
3
  .row
4
4
  .col.s6.col-sm-offset-3
5
5
  %h5 New Leadset
@@ -1,5 +1,5 @@
1
1
 
2
- .products-edit.max-width
2
+ .products-edit.maxwidth
3
3
  %h5 Edit product
4
4
 
5
5
  = render 'form', product: @product
@@ -1,5 +1,5 @@
1
1
 
2
- .products-show.max-width
2
+ .products-show.maxwidth
3
3
  %h5
4
4
  Show product #{@product.name}
5
5
  = link_to '[~]', edit_product_path( @product )
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- .videos-edit.max-width
3
+ .videos-edit.maxwidth
4
4
  .header
5
- %h3.title Edit Video
5
+ %h5.title Edit Video
6
6
 
7
7
  = render 'form', :video => @video
@@ -1,5 +1,5 @@
1
1
 
2
- .videos-new.max-width
2
+ .videos-new.maxwidth
3
3
  .header
4
4
  %h3.title New Video
5
5
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  - video ||= @video
3
3
 
4
- .videos-show.max-width
4
+ .videos-show.maxwidth
5
5
  .row
6
6
  = link_to '[Back]', videos_path
7
7
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  Rails.application.config.assets.version = '1.0'
3
3
 
4
- Rails.application.config.assets.precompile += %w( wco/application.js )
4
+ Rails.application.config.assets.precompile += %w( wco/application.js wco/application.css )
data/lib/wco_models.rb CHANGED
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'aws-sdk-s3'
3
3
 
4
+ require 'business_time'
5
+
4
6
  require 'cancancan'
5
7
 
6
8
  require 'devise'
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.49
4
+ version: 3.1.0.51
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-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3