wco_email 0.1.1.48 → 0.1.1.49

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: bfdc93a04b6ada90896eb286b87784236064a3bdc94b43fc935c8e4ed0cc4803
4
+ data.tar.gz: 8e0214d33ebd8ddab96867418993df99af76bf946fc450d938cb62bef3d9807f
5
5
  SHA512:
6
- metadata.gz: c28fe7d5fc5c74f9d9764601e5106ebfe0e0ed7745b4d0c7c6d8605be31777d6a6032531f29cbdfa3788876213763788f723f34d1da94b3657fc3acb88362393
7
- data.tar.gz: 7d136d2e07998fd9ade589167dbce85f41404d55fef3e14f28377ec9579428c3ff9d8695d0b028ccc36821aba79cb04ba27970da177411716c7d0d172a26b8af
6
+ metadata.gz: 968f20e090484637b7f1214f040d2afb0159a8f6959cb9d006c2239aca0fa4708d3619a59209379705f3c441f673c9bbf1370e4024614f188d5d50fa25b0ffe7
7
+ data.tar.gz: 45912f6f3d88898d76fc19e8e7f06accd2bdd5b21efe9c90df111880dcd270c34e963327012aebbdf3e8c9680a12ca09dcb07d3b996c27cec440e1f0ccc4c89c
@@ -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
@@ -86,8 +91,8 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
86
91
  end
87
92
 
88
93
  def show
89
- authorize! :show, WcoEmail::Conversation
90
94
  @conversation = ::WcoEmail::Conversation.find( params[:id] )
95
+ authorize! :show, @conversation
91
96
  @messages = @conversation.messages.order_by( date: :asc )
92
97
  @conversation.update_attributes({ status: Conv::STATUS_READ })
93
98
 
@@ -102,6 +107,16 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
102
107
  end
103
108
  end
104
109
 
110
+ def update
111
+ @conversation = ::WcoEmail::Conversation.find( params[:id] )
112
+ authorize! :update, @conversation
113
+ if @conversation.update( params[:conversation].permit! )
114
+ flash_notice 'ok'
115
+ else
116
+ flash_alert @conversation
117
+ end
118
+ redirect_to action: 'show', id: @conversation.id
119
+ end
105
120
 
106
121
  ##
107
122
  ## private
@@ -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
@@ -0,0 +1,3 @@
1
+
2
+ .conversations-edit.maxwidth
3
+ = render 'form', conversation: @conversation
@@ -6,6 +6,7 @@
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
10
11
 
11
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
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.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -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