wco_email 0.1.1.33 → 0.1.1.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78fb2701aceae49be8e71f766e2230de18fdae793ee34d281e8d0f654de7547c
4
- data.tar.gz: 6818673a5cadaef98218df37c829f4f1fb9e0ca93d04381ea7ca9519548fd170
3
+ metadata.gz: bec07a4e4ca2d021905fd82003f9447d7f502ca047da8421d259ef927354c64e
4
+ data.tar.gz: 1c420fefd28598ca53af3806ae1d4bb8975e2f5a9ab472eeffb8ba692896cc7a
5
5
  SHA512:
6
- metadata.gz: 725603d48b9c7fefbc9e9d4b2d42c4643e203d0cc2cde8356c4b79e3c6fc3d94e6f99ac12632d6bcdb401827d7607dff930f1921a9eaeffab1585ea85cfc1069
7
- data.tar.gz: dfb45143933acb188bcc45f5d80831a2a0f4d07087d340d0b1596f87793d0976dd78b1193f63b8f1d22d8ef51ad369d30905dce96873376160240b1efef2a4b0
6
+ metadata.gz: 9b88fd7946cec4223d98d83b70e5a3158ecbd28382a2dddc0658f48e60b9cb548065d279944f8d6b7a04568c66edf78c1cce679244370072dddc0d187d77878a
7
+ data.tar.gz: 6433e52a9e9d25ff43f1e46201ec2b10752bc2c0b5a9cf2fd24d7a6b02a75c1fd2ba469dc54843b2d7aec851257113b1c832d95faefa8599c34d1ffc5d4d41a7
@@ -1,4 +1,6 @@
1
1
 
2
+ EF = WcoEmail::EmailFilter
3
+
2
4
  class WcoEmail::ApplicationController < Wco::ApplicationController
3
5
  # before_action :set_lists
4
6
  layout 'wco_email/application'
@@ -34,7 +34,7 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
34
34
  def index
35
35
  authorize! :index, WcoEmail::EmailFilter.new
36
36
  @email_filter = WcoEmail::EmailFilter.new
37
- @email_filters = WcoEmail::EmailFilter.all # .page( params[WcoEmail::EmailFilter::PAGE_PARAM_NAME] ).per( current_profile.per_page )
37
+ @email_filters = WcoEmail::EmailFilter.all.includes( :email_template, :conversations )
38
38
  end
39
39
 
40
40
  def new
@@ -42,6 +42,11 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
42
42
  authorize! :new, @email_filter
43
43
  end
44
44
 
45
+ def show
46
+ @email_filter = WcoEmail::EmailFilter.find params[:id]
47
+ authorize! :show, @email_filter
48
+ end
49
+
45
50
  def update
46
51
  @email_filter = WcoEmail::EmailFilter.find params[:id]
47
52
  authorize! :update, @email_filter
@@ -18,15 +18,10 @@
18
18
  %tr
19
19
  %th &nbsp;
20
20
  %th &nbsp;
21
- %th From Regex
22
- %th From Exact
23
- %th Subject Regex
24
- %th Subject Exact
25
- %th Body Exact
26
- %th Kind
27
- %th Respond with <br />Email Template
28
- %th Email Action <br />(template)
29
- %th Tag
21
+ %th n convs
22
+ %th Match
23
+ %th Action
24
+
30
25
  - @email_filters.each_with_index do |ef, idx|
31
26
 
32
27
  %tr
@@ -34,19 +29,34 @@
34
29
  .gray= idx+1
35
30
  = check_box_tag 'checked'
36
31
  %td
37
- = link_to '[~]', edit_email_filter_path(ef)
38
- .inline-block= button_to '[x]', email_filter_path(ef), method: :delete, data: { confirm: 'Are you sure?' }
39
- %td
40
- `#{ef.from_regex}`
41
- %td
42
- `#{ef.from_exact}`
43
- %td= ef.subject_regex
44
- %td= ef.subject_exact
45
- %td= ef.body_exact
46
- %td= ef.kind
47
- %td= ef.email_template&.slug
48
- %td= ef.email_action_template&.slug
49
- %td= ef.tag&.slug
32
+ .flex-row
33
+ = link_to '[~]', edit_email_filter_path(ef)
34
+ = link_to '[view]', email_filter_path(ef)
35
+ .inline-block= button_to '[x]', email_filter_path(ef), method: :delete, data: { confirm: 'Are you sure?' }
36
+ %td.n-convs
37
+ = ef.conversations.length
38
+ %td.match
39
+ - if ef.from_regex.present?
40
+ .a <b>from_regex:</b> `#{ef.from_regex}`
41
+ - if ef.from_exact.present?
42
+ .a <b>from_exact:</b> `#{ef.from_exact}`
43
+ - if ef.subject_regex.present?
44
+ .a <b>subject_regex:</b> `#{ef.subject_regex}`
45
+ - if ef.subject_exact.present?
46
+ .a <b>subject_exact:</b> `#{ef.subject_exact}`
47
+ - if ef.body_exact.present?
48
+ .a <b>body_exact:</b> `#{ef.body_exact}`
49
+
50
+ %td.action
51
+ - if ef.kind == EF::KIND_AUTORESPOND_TMPL
52
+ .a <b>#{EF::KIND_AUTORESPOND_TMPL}:</b> #{ef.email_template&.slug}
53
+ - if ef.kind == EF::KIND_AUTORESPOND_EACT
54
+ .a <b>#{EF::KIND_AUTORESPOND_EACT}:</b> #{ef.email_action_template&.slug}
55
+ - if ef.kind == EF::KIND_ADD_TAG
56
+ .a <b>#{EF::KIND_ADD_TAG}:</b> #{ef.tag&.slug}
57
+ - if ef.kind == EF::KIND_REMOVE_TAG
58
+ .a <b>#{EF::KIND_REMOVE_TAG}:</b> #{ef.tag&.slug}
59
+
50
60
  -# = paginate @email_filters, param_name: WcoEmail::EmailFilter::PAGE_PARAM_NAME, views_prefix: 'wco'
51
61
 
52
62
 
@@ -0,0 +1,9 @@
1
+
2
+ .email-filters-show.maxwidth
3
+ .header
4
+ %h5.title Email Filter `#{@email_filter.id}`
5
+
6
+ %h5 Convs (#{@email_filter.conversations.length})
7
+ %ul
8
+ - @email_filter.conversations.each do |conv|
9
+ %li= link_to conv, email_conversation_path(conv)
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.33
4
+ version: 0.1.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
@@ -400,6 +400,7 @@ files:
400
400
  - app/views/wco_email/email_filters/edit.haml
401
401
  - app/views/wco_email/email_filters/index.haml
402
402
  - app/views/wco_email/email_filters/new.haml
403
+ - app/views/wco_email/email_filters/show.haml
403
404
  - app/views/wco_email/email_templates/_form.haml
404
405
  - app/views/wco_email/email_templates/_form_mini.haml
405
406
  - app/views/wco_email/email_templates/_form_reply_mini.haml