wco_email 0.1.1.48 → 0.1.1.50

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: 92016ce179b88dd8a7e125ea321f7fbd063c62eba53ae985d15d597201c089b7
4
- data.tar.gz: baf6b4270b2067b541167328f86081d70ae982f9d65312601728d8c477412e51
3
+ metadata.gz: a8b3bc2eba0acec70837677886c89711208050bb409cb1a10124dcaaf9582d9a
4
+ data.tar.gz: ca74500d7835c3eb35548f83f3b503ba70075c0ab9050a89925188589c4d6c4c
5
5
  SHA512:
6
- metadata.gz: c28fe7d5fc5c74f9d9764601e5106ebfe0e0ed7745b4d0c7c6d8605be31777d6a6032531f29cbdfa3788876213763788f723f34d1da94b3657fc3acb88362393
7
- data.tar.gz: 7d136d2e07998fd9ade589167dbce85f41404d55fef3e14f28377ec9579428c3ff9d8695d0b028ccc36821aba79cb04ba27970da177411716c7d0d172a26b8af
6
+ metadata.gz: 04061ac88baa77afa3d4f5456830e25608de8df6e4fb4073edd34a6c9f2dcb8d4f6eb323b9648c287e21879b1d0823607d74a9833933035238471996b65467d9
7
+ data.tar.gz: 3681168ce29b4263bb44ccf824877fa017eef329752e7405b302428fbe2e6f6978a918d03a67e1367f60b9c4b7b15ea23d6d0a896b84fc5ac80860d426ea9a40
@@ -22,6 +22,11 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
22
22
  # redirect_to request.referrer # || root_path
23
23
  end
24
24
 
25
+ def edit
26
+ @conversation = ::WcoEmail::Conversation.find( params[:id] )
27
+ authorize! :edit, @conversation
28
+ end
29
+
25
30
  def index
26
31
  authorize! :index, WcoEmail::Conversation
27
32
  @conversations = WcoEmail::Conversation.all
@@ -43,6 +48,10 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
43
48
  @conversations = @conversations.where({ from_emails: /.*#{params[:from_email]}.*/i })
44
49
  end
45
50
 
51
+ if params[:lead_id].present?
52
+ @conversations = @conversations.where( lead_ids: params[:lead_id] )
53
+ end
54
+
46
55
  @conversations = @conversations.order_by( latest_at: :desc
47
56
  ).includes( :leads, :messages
48
57
  ).page( params[:conv_page]
@@ -86,8 +95,8 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
86
95
  end
87
96
 
88
97
  def show
89
- authorize! :show, WcoEmail::Conversation
90
98
  @conversation = ::WcoEmail::Conversation.find( params[:id] )
99
+ authorize! :show, @conversation
91
100
  @messages = @conversation.messages.order_by( date: :asc )
92
101
  @conversation.update_attributes({ status: Conv::STATUS_READ })
93
102
 
@@ -102,6 +111,16 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
102
111
  end
103
112
  end
104
113
 
114
+ def update
115
+ @conversation = ::WcoEmail::Conversation.find( params[:id] )
116
+ authorize! :update, @conversation
117
+ if @conversation.update( params[:conversation].permit! )
118
+ flash_notice 'ok'
119
+ else
120
+ flash_alert @conversation
121
+ end
122
+ redirect_to action: 'show', id: @conversation.id
123
+ end
105
124
 
106
125
  ##
107
126
  ## private
@@ -20,7 +20,7 @@
20
20
  = javascript_include_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
21
21
 
22
22
  = stylesheet_link_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/css/select2.min.css"
23
- = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js"
23
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js", defer: 'defer'
24
24
 
25
25
  = stylesheet_link_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css"
26
26
  = javascript_include_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"
@@ -0,0 +1,7 @@
1
+
2
+ = form_for conversation do |f|
3
+ .d-flex
4
+ %label Subject
5
+ = f.text_field :subject, class: 'w-100'
6
+ .actions
7
+ = f.submit
@@ -9,4 +9,6 @@
9
9
  %label by subject
10
10
  = text_field_tag :subject, params[:subject]
11
11
  = submit_tag '>'
12
+ - if params[:lead_id]
13
+ <b>lead_id:</b>#{params[:lead_id]}
12
14
 
@@ -0,0 +1,3 @@
1
+
2
+ .conversations-edit.maxwidth
3
+ = render 'form', conversation: @conversation
@@ -6,7 +6,12 @@
6
6
  %h5
7
7
  = @conversation.subject
8
8
  <b>(#{@conversation.messages.length})</b>
9
+ = link_to '[~]', edit_conversation_path(@conversation)
9
10
  %span.gray.mini= @conversation.id
11
+ .leads
12
+ .d-inline <b>Leads:</b>
13
+ - @conversation.leads.each do |lead|
14
+ .Chip= link_to lead.email, wco.lead_path( lead )
10
15
 
11
16
 
12
17
  - if @other_convs.present?
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.48
4
+ version: 0.1.1.50
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-01 00:00:00.000000000 Z
11
+ date: 2024-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -383,7 +383,9 @@ files:
383
383
  - app/views/wco_email/contexts/summary.csv.erb
384
384
  - app/views/wco_email/contexts/summary.haml
385
385
  - app/views/wco_email/conversations/_actions.haml
386
+ - app/views/wco_email/conversations/_form.haml
386
387
  - app/views/wco_email/conversations/_search.haml
388
+ - app/views/wco_email/conversations/edit.haml
387
389
  - app/views/wco_email/conversations/index.haml
388
390
  - app/views/wco_email/conversations/show.haml
389
391
  - app/views/wco_email/email_action_templates/_form.haml