wco_email 0.1.1.81 → 0.1.1.83
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/wco_email/api/conversations_controller.rb +10 -0
- data/app/controllers/wco_email/api_controller.rb +4 -0
- data/app/controllers/wco_email/contexts_controller.rb +13 -12
- data/app/controllers/wco_email/conversations_controller.rb +1 -38
- data/app/views/wco_email/api/conversations/index.json.jbuilder +4 -0
- data/app/views/wco_email/contexts/_header.haml +5 -10
- data/app/views/wco_email/contexts/index.haml +5 -3
- data/config/routes.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719582a97ebd0fd983baed326967e48df5c08662ab874f95ec29bb3c54f8e336
|
4
|
+
data.tar.gz: 49e79e9b494639ebe800d3fc23913d0d3d8629972b7a5e5bffd1ef18400b1849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce5caa2b693a76232ba3da967722e32bbfbc7ec974365dc813d3e0bf3ce200cf4f55788c637fc3c702515f34fe0d72ef76a9528a86acc8d22375525e529f0676
|
7
|
+
data.tar.gz: af953710ceb0829f19d0d2200ae33f717405ab997e082bf04b97ec503d026d0ee80a3f79ffe88d8721262e07e77360577c34a869b66ba7e0db96cc84c6a97bee
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
class WcoEmail::Api::ConversationsController < WcoEmail::ApiController
|
3
|
+
|
4
|
+
def index
|
5
|
+
authorize! :index, WcoEmail::Conversation
|
6
|
+
@conversations, @messages, @tag = WcoEmail::Conversation.load_conversations_messages_tag_by_params_and_profile( params, current_profile )
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
|
@@ -46,23 +46,24 @@ class WcoEmail::ContextsController < WcoEmail::ApplicationController
|
|
46
46
|
|
47
47
|
def index
|
48
48
|
authorize! :index, WcoEmail::Context
|
49
|
-
@ctxs = WcoEmail::Context.
|
50
|
-
:send_at.ne => nil,
|
51
|
-
sent_at: nil,
|
52
|
-
).order_by( sent_at: :desc, send_at: :desc
|
53
|
-
).page( params[:ctxs_page]
|
54
|
-
).per( current_profile.per_page )
|
55
|
-
|
49
|
+
@ctxs = WcoEmail::Context.all
|
56
50
|
if params[:lead_id]
|
57
51
|
@lead = Lead.find params[:lead_id]
|
58
52
|
@ctxs = @ctxs.where( lead_id: @lead.id )
|
53
|
+
end
|
54
|
+
|
55
|
+
if 'true' == params[:sent]
|
56
|
+
@ctxs = @ctxs.where( :sent_at.ne => nil )
|
57
|
+
elsif 'false' == params[:sent]
|
58
|
+
@ctxs = @ctxs.where( sent_at: nil )
|
59
59
|
else
|
60
|
-
|
61
|
-
|
62
|
-
else
|
63
|
-
@ctxs = @ctxs.where( sent_at: nil, unsubscribed_at: nil )
|
64
|
-
end
|
60
|
+
## default, show notsent.
|
61
|
+
@ctxs = @ctxs.where( :sent_at.ne => nil )
|
65
62
|
end
|
63
|
+
|
64
|
+
@ctxs = @ctxs.order_by( sent_at: :desc, send_at: :desc
|
65
|
+
).page( params[:ctxs_page]
|
66
|
+
).per( current_profile.per_page )
|
66
67
|
end
|
67
68
|
|
68
69
|
def new
|
@@ -29,44 +29,7 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
|
|
29
29
|
|
30
30
|
def index
|
31
31
|
authorize! :index, WcoEmail::Conversation
|
32
|
-
@conversations = WcoEmail::Conversation.
|
33
|
-
|
34
|
-
if params[:tagname]
|
35
|
-
@tag = Wco::Tag.find_by slug: params[:tagname]
|
36
|
-
@conversations = @conversations.where( :tag_ids.in => [ @tag.id ] )
|
37
|
-
end
|
38
|
-
if params[:tagname_not]
|
39
|
-
@tag_not = Wco::Tag.find_by slug: params[:tagname_not]
|
40
|
-
@conversations = @conversations.where( :tag_ids.nin => [ @tag_not.id ] )
|
41
|
-
end
|
42
|
-
|
43
|
-
if params[:subject].present?
|
44
|
-
@conversations = @conversations.where({ subject: /.*#{params[:subject]}.*/i })
|
45
|
-
end
|
46
|
-
|
47
|
-
if params[:from_email].present?
|
48
|
-
@conversations = @conversations.where({ from_emails: /.*#{params[:from_email]}.*/i })
|
49
|
-
end
|
50
|
-
|
51
|
-
if params[:lead_id].present?
|
52
|
-
@conversations = @conversations.where( lead_ids: params[:lead_id] )
|
53
|
-
end
|
54
|
-
|
55
|
-
@conversations = @conversations.where(
|
56
|
-
).includes( :leads, :messages, :tags
|
57
|
-
).order_by( latest_at: :desc
|
58
|
-
).page( params[:conv_page] ).per( current_profile.per_page )
|
59
|
-
|
60
|
-
conversation_ids = @conversations.map &:id
|
61
|
-
|
62
|
-
@messages_hash = {}
|
63
|
-
messages = WcoEmail::Message.where(
|
64
|
-
:conversation_id.in => conversation_ids,
|
65
|
-
read_at: nil,
|
66
|
-
)
|
67
|
-
messages.map do |msg|
|
68
|
-
@messages_hash[msg.id.to_s] = msg
|
69
|
-
end
|
32
|
+
@conversations, @messages, @tag = WcoEmail::Conversation.load_conversations_messages_tag_by_params_and_profile( params, current_profile )
|
70
33
|
end
|
71
34
|
|
72
35
|
## merge conv1 into conv2, and delete conv1
|
@@ -2,16 +2,11 @@
|
|
2
2
|
- ctxs = @ctxs || WcoEmail::Context.all
|
3
3
|
|
4
4
|
.a
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
= link_to '[notsent]', contexts_path({ sent: false })
|
11
|
-
<b>sent</b>
|
12
|
-
- else
|
13
|
-
<b>notsent</b>
|
14
|
-
= link_to '[sent]', contexts_path({ sent: true })
|
5
|
+
Email Contexts (#{ctxs.length})
|
6
|
+
- if @lead
|
7
|
+
For lead #{@lead.email}
|
8
|
+
= link_to '[notsent]', contexts_path({ sent: false }), class: "#{'false' == params[:sent] ? 'active' : ''}"
|
9
|
+
= link_to '[sent]', contexts_path({ sent: true }), class: "#{'true' == params[:sent] ? 'active' : ''}"
|
15
10
|
= form_tag contexts_path, method: :get do
|
16
11
|
= text_field_tag :q
|
17
12
|
= link_to '[+]', new_context_path
|
@@ -7,7 +7,7 @@
|
|
7
7
|
.W0
|
8
8
|
= render 'wco/paginate', resource: @ctxs, param_name: :ctxs_page, views_prefix: :wco
|
9
9
|
|
10
|
-
%table.bordered
|
10
|
+
%table.bordered
|
11
11
|
%thead
|
12
12
|
%tr
|
13
13
|
%th.actions
|
@@ -39,11 +39,13 @@
|
|
39
39
|
= ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
|
40
40
|
%td= ctx.email_template.slug
|
41
41
|
%td.send_at.padded
|
42
|
-
.datetime
|
42
|
+
.datetime.p-1
|
43
43
|
.date= pp_date ctx.send_at
|
44
44
|
.time= pp_time ctx.send_at
|
45
45
|
%td
|
46
|
-
.datetime.
|
46
|
+
.datetime.p-1
|
47
|
+
.date= pp_date ctx.sent_at
|
48
|
+
.time= pp_time ctx.sent_at
|
47
49
|
%td
|
48
50
|
.datetime.padded= pp_date ctx.unsubscribed_at
|
49
51
|
|
data/config/routes.rb
CHANGED
@@ -7,6 +7,8 @@ WcoEmail::Engine.routes.draw do
|
|
7
7
|
get 'tinymce', to: 'application#tinymce', as: :application_tinymce
|
8
8
|
|
9
9
|
get 'api/contexts/summary', to: '/wco_email/api/contexts#summary'
|
10
|
+
get 'api/conversations', to: '/wco_email/api/conversations#index'
|
11
|
+
get 'api/tags/:tagname/conversations', to: '/wco_email/api/conversations#index'
|
10
12
|
|
11
13
|
get 'conversations/in/:tagname', to: '/wco_email/conversations#index', as: :conversations_in
|
12
14
|
get 'conversations/not-in/:tagname_not', to: '/wco_email/conversations#index', as: :conversations_not_in
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.83
|
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-
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -310,6 +310,7 @@ files:
|
|
310
310
|
- app/assets/stylesheets/wco_email/messages.scss
|
311
311
|
- app/assets/stylesheets/wco_email/tags.scss
|
312
312
|
- app/controllers/wco_email/api/contexts_controller.rb
|
313
|
+
- app/controllers/wco_email/api/conversations_controller.rb
|
313
314
|
- app/controllers/wco_email/api_controller.rb
|
314
315
|
- app/controllers/wco_email/application_controller.rb
|
315
316
|
- app/controllers/wco_email/contexts_controller.rb
|
@@ -368,6 +369,7 @@ files:
|
|
368
369
|
- app/views/wco_email/_main_header.haml
|
369
370
|
- app/views/wco_email/_sidebar.haml
|
370
371
|
- app/views/wco_email/api/contexts/summary.json.jbuilder
|
372
|
+
- app/views/wco_email/api/conversations/index.json.jbuilder
|
371
373
|
- app/views/wco_email/contexts/_form.haml
|
372
374
|
- app/views/wco_email/contexts/_form_reply.haml
|
373
375
|
- app/views/wco_email/contexts/_header.haml
|