wco_email 0.1.1.78 → 0.1.1.80

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: 598c923ca2af9d6d4b66479f643b5d0c261e5883bd1378e09bb9e8d207bf8d94
4
- data.tar.gz: d80c9501a2636c8c9163ad8f7ef91aa991062d95083aa398dee5d23e5139cd3c
3
+ metadata.gz: 4c75364c487acb06734974d75ed8b1ec8e3c2f170e770b0c03f6c9589cf6ee4a
4
+ data.tar.gz: 9358b7cabd07fc5d0ccf675216fce4f1a1acf329d81eca41cd6845380a8d5445
5
5
  SHA512:
6
- metadata.gz: 52edcfe51e90ee55651fc2ab47641e6e2f80be5ee621ec08c391e1a94945cfc65186604782e422eeb79d522b8b454e854b29920c1e652ee618966009b35425ec
7
- data.tar.gz: d2d817c9a1b8d9ca8655a9035b46e4f20d3a4ac0f70341333818edcacc637a05d440e6ee1582e832a5dcacc2053a556913997bf77e7a8e21c644ff9506c54963
6
+ metadata.gz: e88f5abb24e1d5eb216db6596235cb230e179c2c3a6894f195c4fcf6924d11c69b657e5312f577c8f328bea99a1b1c1766fdfac2d8f68719b00738f31a782893
7
+ data.tar.gz: 9c8de2194ce44663dcc887b5cfa0ce3d943adb29146adbd6d43619a3ce76ebcf10cbc71d17cd3de913087f65577f189cf016bf234eba86520d77c01c126c6605
@@ -21,6 +21,51 @@ class WcoEmail::MessageStubsController < WcoEmail::ApplicationController
21
21
  redirect_to request.referrer
22
22
  end
23
23
 
24
+ def create
25
+ @stub = WcoEmail::MessageStub.new params[:stub].permit!
26
+ authorize! :create, @stub
27
+ if @stub.save
28
+ flash_notice 'saved.'
29
+ redirect_to action: 'show'
30
+ else
31
+ flash_alert "Cannot save stub: #{@stub.errors.full_messages}"
32
+ render 'new'
33
+ end
34
+ end
35
+
36
+ def edit
37
+ @stub = WcoEmail::MessageStub.find params[:id]
38
+ authorize! :edit, @stub
39
+ end
40
+
41
+ def index
42
+ authorize! :index, WcoEmail::MessageStub
43
+ @stubs = WcoEmail::MessageStub.all.page( params[:stubs_page] )
44
+ render '_index_table'
45
+ end
46
+
47
+ def new
48
+ @stub = WcoEmail::MessageStub.new
49
+ authorize! :new, @stub
50
+ end
51
+
52
+ def show
53
+ @stub = WcoEmail::MessageStub.find params[:id]
54
+ authorize! :show, @stub
55
+ end
56
+
57
+ def update
58
+ @stub = WcoEmail::MessageStub.find params[:id]
59
+ authorize! :update, @stub
60
+ flag = @stub.update_attributes params[:stub].permit!
61
+ if flag
62
+ flash_notice 'success'
63
+ redirect_to action: 'show'
64
+ else
65
+ flash_alert "Cannot save stub: #{@stub.errors.full_messages}"
66
+ render 'edit'
67
+ end
68
+ end
24
69
 
25
70
  end
26
71
 
@@ -7,9 +7,10 @@
7
7
  %ul
8
8
  %li= link_to 'Inbox', conversations_in_path('inbox')
9
9
  %li
10
- Stubs
10
+ = link_to 'Stubs', wco_email.message_stubs_path
11
11
  (#{WcoEmail::MessageStub.pending.length})
12
12
  (#{WcoEmail::MessageStub.all.length})
13
+ = link_to '[+]', wco_email.new_message_stub_path
13
14
  %li= render '/wco_email/email_templates/header'
14
15
  %li= render '/wco_email/email_campaigns/header'
15
16
  %li= render '/wco_email/email_filters/header'
@@ -0,0 +1,10 @@
1
+
2
+ -#
3
+ -# only change the subject
4
+ -#
5
+
6
+ = form_for conversation do |f|
7
+ .d-flex
8
+ %label Subj
9
+ = f.text_field :subject, class: 'w-100'
10
+ = f.submit '~>'
@@ -5,13 +5,13 @@
5
5
  .conversations-list
6
6
  = check_box_tag 'conversation_ids[]', @conversation.id.to_s, true, { class: 'i-sel', disabled: true }
7
7
  .conversations-show.maxwidth
8
+ = render '/wco_email/conversations/form_mini', conversation: @conversation
9
+
8
10
  %h5
9
- = @conversation.subject
10
11
  <b>(#{@messages.length})</b>
11
- = link_to '[~]', edit_conversation_path(@conversation)
12
12
  %span.gray.mini= @conversation.id
13
+ = render '/wco/tags/index_chips', tags: @conversation.tags, config: { skip_checkbox: true }
13
14
 
14
- = render '/wco/tags/index_chips', tags: @conversation.tags
15
15
  = render '/wco_email/conversations/tags_actions'
16
16
  = render '/wco/leads/index_chips', leads: @conversation.leads
17
17
  = render '/wco/leadsets/index_chips', leadsets: @conversation.leadsets
@@ -0,0 +1,12 @@
1
+
2
+ = stub.inspect
3
+
4
+ = form_for stub, as: :stub do |f|
5
+ .field
6
+ %label object_key
7
+ = f.text_field :object_key
8
+ .field
9
+ %label bucket
10
+ = f.text_field :bucket
11
+ .actions
12
+ = f.submit 'Go'
@@ -1,10 +1,16 @@
1
1
 
2
+ - stubs ||= @stubs
3
+
2
4
  .message-stubs--index
5
+ = paginate stubs, param_name: :stubs_page
3
6
  %ul
4
7
  - stubs.each do |stub|
5
8
  %li
9
+ .a <b>created_at:</b> #{stub.created_at}
6
10
  .a
11
+ <b>Status:</b>
7
12
  = stub.status
8
13
  .d-inline-block= button_to 'churn', wco_email.churn_message_stub_path(stub), data: { confirm: 'Are you sure?' }
9
- .a= stub.object_key
10
- .a= stub.tags.map &:slug
14
+ .a <b>object_key:</b> #{stub.object_key}
15
+ .a <b>tag slugs:</b> #{stub.tags.map &:slug}
16
+ = paginate stubs, param_name: :stubs_page
@@ -0,0 +1,24 @@
1
+
2
+ - stubs ||= @stubs
3
+
4
+ .message-stubs--index
5
+ = paginate stubs, param_name: :stubs_page
6
+ %table.bordered.padded
7
+ %thead
8
+ %tr
9
+ %th created_at
10
+ %th status
11
+ %th object_key
12
+ %th tag slugs
13
+ %tbody
14
+ - stubs.each do |stub|
15
+ %tr
16
+ %td #{stub.created_at}
17
+ %td
18
+ = stub.status
19
+ = link_to '[view]', wco_email.message_stub_path(stub)
20
+ = link_to '[~]', wco_email.edit_message_stub_path(stub)
21
+ .d-inline-block= button_to 'churn', wco_email.churn_message_stub_path(stub), data: { confirm: 'Are you sure?' }
22
+ %td #{stub.object_key}
23
+ %td #{stub.tags.map &:slug}
24
+ = paginate stubs, param_name: :stubs_page
@@ -0,0 +1,3 @@
1
+
2
+ .message-stubs-edit
3
+ = render 'wco_email/message_stubs/form', stub: @stub
@@ -0,0 +1,7 @@
1
+
2
+
3
+ .message-stubs-new.maxwidth
4
+ .header
5
+ .title New Stub
6
+ = render 'wco_email/message_stubs/form', stub: @stub
7
+
@@ -0,0 +1,4 @@
1
+
2
+ .message-stubs-show
3
+ = @stub.inspect
4
+ .d-inline-block= button_to 'churn', wco_email.churn_message_stub_path(@stub), data: { confirm: 'Are you sure?' }
@@ -24,8 +24,8 @@
24
24
  %li
25
25
  <b>object_key:</b> #{message.object_key}
26
26
  %li
27
- <b>Stub:</b>
28
- #{message.stub.id}
27
+ <b>Stub id:</b>
28
+ #{link_to message.stub.id, message_stub_path(message.stub)}
29
29
  .d-inline-block= button_to 'reprocess', churn_message_stub_path(message.stub)
30
30
  %li <b>in_reply_to_id:</b> #{message.in_reply_to_id}
31
31
  %li
@@ -10,8 +10,9 @@
10
10
  %iframe.message-iframe{ src: message_iframe_path(@message) }
11
11
  = render '/wco_email/contexts/form_reply', lead_id: @message.lead_id, message: @message, ctx: WcoEmail::Context.new({ from_email: @message.to&.downcase, subject: @message.subject, email_template_id: ET.find_by( slug: 'blank').id })
12
12
 
13
- = @message.inspect
14
- %hr
15
13
  %pre
16
- = raw @the_mail.body.decoded
14
+ = raw @the_mail.body.decoded.force_encoding('UTF-8')
15
+ %hr
16
+ = @message.inspect
17
+
17
18
 
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.78
4
+ version: 0.1.1.80
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-08-21 00:00:00.000000000 Z
11
+ date: 2024-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -380,6 +380,7 @@ files:
380
380
  - app/views/wco_email/contexts/summary.csv.erb
381
381
  - app/views/wco_email/contexts/summary.haml
382
382
  - app/views/wco_email/conversations/_form.haml
383
+ - app/views/wco_email/conversations/_form_mini.haml
383
384
  - app/views/wco_email/conversations/_search.haml
384
385
  - app/views/wco_email/conversations/_tags_actions.haml
385
386
  - app/views/wco_email/conversations/edit.haml
@@ -433,7 +434,12 @@ files:
433
434
  - app/views/wco_email/email_templates/show_iframe.haml
434
435
  - app/views/wco_email/lead_action_templates/_header.haml
435
436
  - app/views/wco_email/lead_actions/_header.haml
437
+ - app/views/wco_email/message_stubs/_form.haml
436
438
  - app/views/wco_email/message_stubs/_index.haml
439
+ - app/views/wco_email/message_stubs/_index_table.haml
440
+ - app/views/wco_email/message_stubs/edit.haml
441
+ - app/views/wco_email/message_stubs/new.haml
442
+ - app/views/wco_email/message_stubs/show.haml
437
443
  - app/views/wco_email/messages/_meta.haml
438
444
  - app/views/wco_email/messages/show.haml
439
445
  - app/views/wco_email/messages/show_iframe.haml