wco_email 0.1.1.71 → 0.1.1.73

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: d19500786f1ed1265575707c15d0692ef028bce2787bb319bd79fb9fa565843c
4
- data.tar.gz: 7db5eb86566d1bfc24a191a6d5f95779be918789e83fb137270d98bb39f4f523
3
+ metadata.gz: 126de881448d4a9f4f776b68c39afa8676637b654752390b502f1bb89ed6a30b
4
+ data.tar.gz: 7264f72eb0bde6a68faed340e3eeb1ac4179d27dbd2e2cfc03ebde2e9b10bb17
5
5
  SHA512:
6
- metadata.gz: 34f610f692aa355f5bb27b1f78078b674a7aa462fc10103d25b2267dbfe14b95da8ed1a3879375f42e38c443b9ca2e3fbdc4f67d14c8b89ce8966bcba350d296
7
- data.tar.gz: 0c29c54a11eb251087e12571e127a7569f6ded7fef5b9e406ca7d269c19a8be0555aafc6dcaf3b99db162d62286248e6c0f29cff4be1e9fd7b2f0b9159c9063f
6
+ metadata.gz: 7a18ddfdd69412bac0a35cb7bfae4016d5ab955931329ecab4b22f0b7e1258d2c9119c755be6bf078fd775d2e6341c194767a6e2050eaf5e8939c4dee9006d92
7
+ data.tar.gz: 2e389076abd1dd1c3f01d7afb13764740817e41495ec66f5d3de0dc7a005e44ce9475411b9b6890958a4ae16ad3e34d4b5e73183564e1ed9fa738c260248b057
@@ -22,8 +22,19 @@ class WcoEmail::EmailActionsController < WcoEmail::ApplicationController
22
22
  end
23
23
 
24
24
  def index
25
- @schs = Sch.all
26
- authorize! :index, @schs
25
+ @email_actions = WcoEmail::EmailAction.all
26
+ authorize! :index, @email_actions
27
+ if params[:q]
28
+ email_template_ids = WcoEmail::EmailTemplate.where( slug: /#{params[:q]}/i ).map &:id
29
+ email_action_template_ids = WcoEmail::EmailActionTemplate.any_of(
30
+ { :email_template_id.in => email_template_ids },
31
+ { slug: /#{params[:q]}/i },
32
+ ).map &:id
33
+
34
+ @email_actions = @email_actions.where({
35
+ :email_action_template_id.in => email_action_template_ids,
36
+ })
37
+ end
27
38
  end
28
39
 
29
40
  def new
@@ -41,6 +41,12 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
41
41
  @email_filter = WcoEmail::EmailFilter.new
42
42
  authorize! :new, @email_filter
43
43
  end
44
+ def new2
45
+ @email_filter = WcoEmail::EmailFilter.new
46
+ authorize! :new, @email_filter
47
+
48
+ @new_email_filter_condition = WcoEmail::EmailFilterCondition.new
49
+ end
44
50
 
45
51
  def show
46
52
  @email_filter = WcoEmail::EmailFilter.find params[:id]
@@ -3,7 +3,7 @@
3
3
  .header
4
4
  %h2
5
5
  Email Actions
6
- (#{Sch.all.count})
6
+ (#{WcoEmail::EmailAction.all.length})
7
7
  = link_to '[+]', new_email_action_path
8
8
 
9
9
  %table.bordered.data-table
@@ -16,19 +16,19 @@
16
16
  %td.tmpl Email Template
17
17
  %td Perform at
18
18
  %tbody
19
- - @schs.each do |sch|
19
+ - @email_actions.each do |ea|
20
20
  %tr
21
- %td= link_to '[~]', edit_email_action_path(sch)
22
- %td= sch.status == 'active' ? 'Y' : '-'
21
+ %td= link_to '[~]', edit_email_action_path(ea)
22
+ %td= ea.status == 'active' ? 'Y' : '-'
23
23
  %td.email_action_template
24
- = render '/wco_email/email_action_templates/show_cell', tmpl: sch.tmpl
24
+ = render '/wco_email/email_action_templates/show_cell', tmpl: ea.tmpl
25
25
  %td.to
26
- = link_to sch.lead.email, wco.lead_path(sch.lead)
26
+ = link_to ea.lead.email, wco.lead_path(ea.lead)
27
27
  %td.tmpl
28
- = render '/wco_email/email_templates/show_cell', tmpl: sch.tmpl.email_template
28
+ = render '/wco_email/email_templates/show_cell', tmpl: ea.tmpl.email_template
29
29
  %td
30
- = pp_date sch.perform_at.in_time_zone
31
- = pp_time sch.perform_at.in_time_zone
30
+ = pp_date ea.perform_at.in_time_zone
31
+ = pp_time ea.perform_at.in_time_zone
32
32
 
33
33
 
34
34
 
@@ -0,0 +1,12 @@
1
+
2
+ .d-flex
3
+ .field
4
+ %label Field
5
+ = f.select :field, options_for_select(WcoEmail::EmailFilter::FIELD_OPTS)
6
+ .field
7
+ %label Matchtype
8
+ = f.select :matchtype, options_for_select(WcoEmail::EmailFilter::MATCHTYPE_OPTS)
9
+ .field
10
+ %label Value
11
+ = f.text_field :value
12
+ [-]
@@ -1,4 +1,8 @@
1
1
 
2
+ -##
3
+ -## 2024-04-13 Before email_filter_condition was introduced
4
+ -##
5
+
2
6
  - url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
3
7
  .email-filters--from
4
8
  = form_for email_filter, url: url, as: :email_filter do |f|
@@ -0,0 +1,46 @@
1
+
2
+ -##
3
+ -## 2024-04-13 Introducing email_filter_condition
4
+ -##
5
+
6
+ - url = email_filter.new_record? ? email_filters_path : email_filter_path( email_filter )
7
+ .email-filters--from.maxwidth
8
+ = form_for email_filter, url: url, as: :email_filter do |f|
9
+
10
+ %p If
11
+ - f.fields_for( :email_filter_conditions ) do |f_cond|
12
+ = render '/wco_email/email_filter_conditions/form', f: f_cond
13
+ = form_for @new_email_filter_condition do |ff|
14
+ = render '/wco_email/email_filter_conditions/form', f: ff
15
+
16
+ .d-flex [+]
17
+ %p Skip
18
+ - email_filter.email_filter_skip_conditions.each do |f_cond|
19
+ .d-flex
20
+ .field
21
+ %label Field
22
+ = f_cond.select :field, options_for_select(WcoEmail::EmailFilter::FIELD_OPTS, selected: f_cond.field)
23
+ .field
24
+ %label Matchtype
25
+ = f_cond.select :matchtype, options_for_select(WcoEmail::EmailFilter::MATCHTYPE_OPTS, selected: f_cond.matchtype)
26
+ .field
27
+ %label Value
28
+ = f_cond.text_field :value
29
+ [-]
30
+ .d-flex [+]
31
+ %p Then [test]
32
+ - email_filter.action_tmpls.each do |f_act_tmpl|
33
+ .d-flex
34
+ %label Office Action
35
+ .field
36
+ %label slug
37
+ = f_act_tmpl.slug
38
+ .field
39
+ %label config
40
+ = f_act_tmpl.text_area :config
41
+ [-]
42
+ .d-flex [+]
43
+ [perform]
44
+
45
+ .actions
46
+ = f.submit 'Go'
@@ -0,0 +1,5 @@
1
+
2
+ .emails-ns.email-filters-new.maxwidth
3
+ .header
4
+ %h2.title New2 Email Filter
5
+ = render 'form2', email_filter: @email_filter
data/config/routes.rb CHANGED
@@ -26,7 +26,11 @@ WcoEmail::Engine.routes.draw do
26
26
  get 'contexts/summary', to: 'contexts#summary'
27
27
  post 'contexts/send_immediate/:id', to: 'contexts#send_immediate', as: :send_context
28
28
  resources :contexts
29
+
30
+ get 'email_filters/new2', to: 'email_filters#new2'
29
31
  resources :email_filters
32
+ resources :email_filter_conditions
33
+
30
34
  get 'email_templates/:id/iframe', to: 'email_templates#show_iframe', as: :email_template_iframe
31
35
  resources :email_templates
32
36
 
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.71
4
+ version: 0.1.1.73
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-04-13 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -401,11 +401,14 @@ files:
401
401
  - app/views/wco_email/email_campaigns/index.haml
402
402
  - app/views/wco_email/email_campaigns/new.haml
403
403
  - app/views/wco_email/email_campaigns/show.haml
404
+ - app/views/wco_email/email_filter_conditions/_form.haml
404
405
  - app/views/wco_email/email_filters/_form.haml
406
+ - app/views/wco_email/email_filters/_form2.haml
405
407
  - app/views/wco_email/email_filters/_header.haml
406
408
  - app/views/wco_email/email_filters/edit.haml
407
409
  - app/views/wco_email/email_filters/index.haml
408
410
  - app/views/wco_email/email_filters/new.haml
411
+ - app/views/wco_email/email_filters/new2.haml
409
412
  - app/views/wco_email/email_filters/show.haml
410
413
  - app/views/wco_email/email_templates/_form.haml
411
414
  - app/views/wco_email/email_templates/_form_mini.haml