wco_models 3.1.0.117 → 3.1.0.118
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 +4 -4
- data/app/controllers/wco/application_controller.rb +23 -0
- data/app/controllers/wco/leads_controller.rb +4 -6
- data/app/mailers/wco_email/application_mailer.rb +1 -1
- data/app/models/wco/lead.rb +2 -2
- data/app/models/wco/tag.rb +2 -2
- data/app/models/wco_email/conversation.rb +5 -2
- data/app/models/wco_email/email_template.rb +2 -4
- data/app/views/wco/leads/index.haml +2 -2
- data/app/views/wco/leads/show.haml +3 -3
- data/app/views/wco_email/contexts/_form_reply_mini.haml +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8b72a29866bc78da0ced62721f7eda2d64867a5535d3a71192c1af2577dc40
|
4
|
+
data.tar.gz: 55f87ee9386f766a860aa03d5d233bffd0836657a82ffa2bb81d6edc5e4b5959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 692592d127d180622b0973727b925feea293520df0b6afbfe4e466ad2f691a7ab09b81ad0725d7f717889cbae6c186a879b1c4b35132110fc0e082bdf1fc2939
|
7
|
+
data.tar.gz: ff6886c342317514dbb6c7d9fcbf932abd8cad7b8ce16a22ade5301ebaea714e836c1906d56685ec1cd7bfba9e8732a2f683624abec8b842eed0fb432d6b3ba2
|
@@ -1,6 +1,18 @@
|
|
1
1
|
|
2
|
+
EC ||= WcoEmail::Conversation
|
3
|
+
EF ||= WcoEmail::EmailFilter
|
4
|
+
EM ||= WcoEmail::Message
|
5
|
+
ET ||= WcoEmail::EmailTemplate
|
6
|
+
MS ||= WcoEmail::MessageStub
|
7
|
+
EMS ||= MS
|
8
|
+
OA ||= Wco::OfficeAction
|
9
|
+
OAT ||= Wco::OfficeActionTemplate
|
10
|
+
OATT ||= Wco::OfficeActionTemplateTie
|
11
|
+
Sch ||= WcoEmail::EmailAction
|
12
|
+
|
2
13
|
class Wco::ApplicationController < ActionController::Base
|
3
14
|
include Wco::ApplicationHelper
|
15
|
+
rescue_from Exception, with: :exception_notifier if Rails.env.production?
|
4
16
|
|
5
17
|
check_authorization
|
6
18
|
|
@@ -33,6 +45,17 @@ class Wco::ApplicationController < ActionController::Base
|
|
33
45
|
@current_leadset ||= current_profile.leadset
|
34
46
|
end
|
35
47
|
|
48
|
+
def exception_notifier(exc)
|
49
|
+
puts! exc, "wco_models custom Exception"
|
50
|
+
::ExceptionNotifier.notify_exception(
|
51
|
+
exc,
|
52
|
+
data: {
|
53
|
+
backtrace: exc.backtrace,
|
54
|
+
}
|
55
|
+
)
|
56
|
+
raise exc
|
57
|
+
end
|
58
|
+
|
36
59
|
def flash_alert what
|
37
60
|
flash[:alert] ||= []
|
38
61
|
if String == what.class
|
@@ -67,12 +67,8 @@ class Wco::LeadsController < Wco::ApplicationController
|
|
67
67
|
redirect_to request.referrer
|
68
68
|
return
|
69
69
|
end
|
70
|
-
|
71
|
-
|
72
|
-
# @convs = Conv.find( Office::EmailConversationLead.where( lead_id: @lead.id ).map( &:email_conversation_id ) )
|
73
|
-
# @msgs = Msg.where( from: @lead.email )
|
74
|
-
# @galleries = @lead.galleries.page( params[:galleries_page] ).per( current_profile.per_page )
|
75
|
-
# @videos = @lead.videos.page( params[:videos_page] ).per( current_profile.per_page )
|
70
|
+
@ctxs = @lead.ctxs
|
71
|
+
@convs = @lead.conversations.includes(:messages)
|
76
72
|
end
|
77
73
|
|
78
74
|
def update
|
@@ -97,6 +93,8 @@ class Wco::LeadsController < Wco::ApplicationController
|
|
97
93
|
|
98
94
|
def set_lists
|
99
95
|
@email_campaigns_list = [[nil,nil]] + WcoEmail::Campaign.all.map { |c| [ c.slug, c.id ] }
|
96
|
+
@email_templates_list = WcoEmail::EmailTemplate.list
|
97
|
+
@leads_list = Wco::Lead.list
|
100
98
|
@leadsets_list = Wco::Leadset.list
|
101
99
|
@tags_list = Wco::Tag.list
|
102
100
|
end
|
@@ -56,7 +56,7 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
|
|
56
56
|
mail( from: @ctx.from_email,
|
57
57
|
to: @ctx.to_email,
|
58
58
|
cc: @ctx.cc,
|
59
|
-
bcc: "poxlovi@gmail.com",
|
59
|
+
bcc: "poxlovi+sent@gmail.com",
|
60
60
|
subject: ERB.new( @ctx.subject ).result( @ctx.get_binding ),
|
61
61
|
body: rendered_str,
|
62
62
|
content_type: "text/html" )
|
data/app/models/wco/lead.rb
CHANGED
@@ -52,14 +52,14 @@ class Wco::Lead
|
|
52
52
|
|
53
53
|
has_many :email_messages, class_name: '::WcoEmail::Message', inverse_of: :lead
|
54
54
|
|
55
|
-
has_and_belongs_to_many :conversations, class_name: '::WcoEmail::Conversation'
|
55
|
+
has_and_belongs_to_many :conversations, class_name: '::WcoEmail::Conversation', index: true
|
56
56
|
def convs; conversations; end
|
57
57
|
has_many :email_contexts, class_name: '::WcoEmail::Context'
|
58
58
|
def ctxs; email_contexts; end
|
59
59
|
has_many :email_actions, class_name: '::WcoEmail::EmailAction'
|
60
60
|
def schs; email_actions; end
|
61
61
|
has_and_belongs_to_many :email_campaigns, class_name: '::WcoEmail::Campaign'
|
62
|
-
has_and_belongs_to_many :tags, class_name: '::Wco::Tag'
|
62
|
+
has_and_belongs_to_many :tags, class_name: '::Wco::Tag', index: true
|
63
63
|
|
64
64
|
# has_many :galleries, class_name: 'Wco::Gallery'
|
65
65
|
# has_many :videos, class_name: 'Wco::Video'
|
data/app/models/wco/tag.rb
CHANGED
@@ -13,10 +13,10 @@ class Wco::Tag
|
|
13
13
|
|
14
14
|
has_many :email_filters, class_name: 'WcoEmail::EmailFilter', inverse_of: :tag
|
15
15
|
|
16
|
-
has_and_belongs_to_many :conversations, class_name: 'WcoEmail::Conversation'
|
16
|
+
has_and_belongs_to_many :conversations, class_name: 'WcoEmail::Conversation', index: true
|
17
17
|
has_and_belongs_to_many :message_stubs, class_name: 'WcoEmail::MessageStub'
|
18
18
|
has_and_belongs_to_many :headlines # , class_name: 'Headline'
|
19
|
-
has_and_belongs_to_many :leads # , class_name: 'Lead'
|
19
|
+
has_and_belongs_to_many :leads, index: true # , class_name: 'Lead'
|
20
20
|
has_and_belongs_to_many :leadsets # , class_name: 'Leadset'
|
21
21
|
has_and_belongs_to_many :reports
|
22
22
|
has_and_belongs_to_many :logs
|
@@ -26,12 +26,15 @@ class WcoEmail::Conversation
|
|
26
26
|
field :preview, default: ''
|
27
27
|
|
28
28
|
has_many :messages, class_name: '::WcoEmail::Message'
|
29
|
+
default_scope ->{ includes(:messages) }
|
29
30
|
|
30
|
-
has_and_belongs_to_many :tags, class_name: 'Wco::Tag'
|
31
|
-
has_and_belongs_to_many :leads, class_name: 'Wco::Lead'
|
31
|
+
has_and_belongs_to_many :tags, class_name: 'Wco::Tag', index: true
|
32
|
+
has_and_belongs_to_many :leads, class_name: 'Wco::Lead', index: true
|
32
33
|
|
33
34
|
belongs_to :filter, class_name: 'WcoEmail::EmailFilter', inverse_of: :conversations, optional: true
|
34
35
|
|
36
|
+
|
37
|
+
|
35
38
|
def to_s
|
36
39
|
"#{subject} (#{messages.length})"
|
37
40
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
DEFAULT_FROM_EMAIL = '
|
2
|
+
DEFAULT_FROM_EMAIL = 'no-reply@wasya.co'
|
3
3
|
|
4
4
|
class WcoEmail::EmailTemplate
|
5
5
|
include Mongoid::Document
|
@@ -41,7 +41,7 @@ class WcoEmail::EmailTemplate
|
|
41
41
|
field :config_json, type: Object, default: '{}'
|
42
42
|
field :layout, default: 'plain'
|
43
43
|
|
44
|
-
DEFAULT_FROM_EMAIL = 'Victor Pudeyev <
|
44
|
+
DEFAULT_FROM_EMAIL = 'Victor Pudeyev <no-reply@wasya.co>'
|
45
45
|
FROM_EMAILS = [
|
46
46
|
'Annesque Studio <hello@annesque.studio>',
|
47
47
|
'Annesque Studio <no-reply@annesque.studio>',
|
@@ -134,6 +134,4 @@ class WcoEmail::EmailTemplate
|
|
134
134
|
def self.list
|
135
135
|
[[nil,nil]] + all.map { |p| [ p.slug, p.id ] }
|
136
136
|
end
|
137
|
-
|
138
137
|
end
|
139
|
-
ET = WcoEmail::EmailTemplate
|
@@ -9,9 +9,9 @@
|
|
9
9
|
%h2.title
|
10
10
|
Leads
|
11
11
|
- if !defined?( skip_pagination ) || !skip_pagination
|
12
|
-
(#{leads.total_count})
|
12
|
+
(#{@leads.total_count})
|
13
13
|
- else
|
14
|
-
(#{leads.length})
|
14
|
+
(#{@leads.length})
|
15
15
|
= link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
|
16
16
|
|
17
17
|
= render 'index', leads: @leads, search_path: leads_path
|
@@ -39,7 +39,7 @@
|
|
39
39
|
Email Contexts (#{@lead.ctxs.length})
|
40
40
|
= link_to '[+]', '#'
|
41
41
|
%ul
|
42
|
-
- @
|
42
|
+
- @ctxs.each do |ctx|
|
43
43
|
%li
|
44
44
|
= pp_date( ctx.sent_at ) || 'not sent'
|
45
45
|
= link_to ctx.subject.presence||"No Subj?!", wco_email.context_path(ctx)
|
@@ -69,6 +69,6 @@
|
|
69
69
|
|
70
70
|
.row
|
71
71
|
.col-md-12.conversations
|
72
|
-
%h5 Email Conversations (#{@
|
73
|
-
= render 'wco_email/conversations/table', convs: @
|
72
|
+
%h5 Email Conversations (#{@convs.length})
|
73
|
+
= render 'wco_email/conversations/table', convs: @convs
|
74
74
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
|
2
|
+
- url = ctx.new_record? ? wco_email.contexts_path : wco_email.context_path(ctx)
|
3
|
+
|
2
4
|
.collapse-expand [reply]
|
3
5
|
.email-contexts--form-reply-mini.form-mini.descr{ style: 'display: none' }
|
4
|
-
= form_for ctx, html: { target: :_blank } do |f|
|
6
|
+
= form_for ctx, url: url, html: { target: :_blank } do |f|
|
5
7
|
|
6
8
|
.flex-row
|
7
9
|
.flex-row
|
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.118
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|