ish_manager 0.1.8.384 → 0.1.8.385

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: 6bebeac16a23bc0a3d32dfe6ed2f17ffa40f12f5651d2ed96b6c536107982361
4
- data.tar.gz: c0bb4c816f75c97b8baa1c158f340618cb30a594b4eb7366b1a2c6342b1a3af3
3
+ metadata.gz: b543b5f1c79e4a3938be93fc4701c085393798b4bb8809bb9eca0c7d825937ac
4
+ data.tar.gz: 335bb44f73016350aa4c8d44e800425376bfdd7659d621819002a18a97b05504
5
5
  SHA512:
6
- metadata.gz: b963eb5535ea6ff9e746c16a8ede99eddd69bb99147ff02d1426b587eddfbb153afa6fc4867500dcc1cc5cd40688cd1add88f34dc45abbce2fda09f950499719
7
- data.tar.gz: 80c4f372cc882d4bf282128fe4caaa71a8eb4efe037ae471649862f0bb1ce8f618e61a32da87e8756ff256aff72d80f17588ba1b1ec242f45885177c43aa2317
6
+ metadata.gz: c289826afe4fc20ccd178005e48c2a4ed28fdadefb148edc134b73fd7b560ef63c8685ebd267a226e04bf95b06fd29da3d021191f5da68c47681c825cad34061
7
+ data.tar.gz: 107bca0378ff2406e639735fc132f4c7512dc8cd8f1fbb7b1d892a5e8682e6115a8e972b5a5843ce2de3ef7e8086c9d4d2ef9e50e502b81126e8cbf43fa49a52
@@ -91,7 +91,7 @@ $(function () {
91
91
  if (!!$('body').select2) {
92
92
  $('.select2').each(function() {
93
93
  $( this ).select2({
94
- width: '100%'
94
+ width: 'auto',
95
95
  })
96
96
  })
97
97
  }
@@ -208,6 +208,10 @@ table.dataTable {
208
208
 
209
209
  /* F */
210
210
 
211
+ .flex-grow {
212
+ flex-grow: 1;
213
+ }
214
+
211
215
  .flex-row {
212
216
  display: flex;
213
217
  flex-wrap: wrap;
@@ -327,6 +331,8 @@ textarea.large {
327
331
  margin-top: 1em;
328
332
 
329
333
  flex-grow: 1;
334
+
335
+ z-index: -1;
330
336
  }
331
337
 
332
338
  .max-width {
@@ -20,6 +20,11 @@
20
20
  }
21
21
  }
22
22
 
23
+ .email-actions--form {
24
+ .select2-container {
25
+ flex-grow: 1;
26
+ }
27
+ }
23
28
 
24
29
  .form-mini {
25
30
 
@@ -66,7 +66,7 @@ module IshManager
66
66
 
67
67
  @leads_list = Lead.list
68
68
  @leadsets_list = Leadset.list
69
- @email_actions_list = ::Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
69
+ @email_actions_list = [[nil,nil]] + ::Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
70
70
  @email_templates_list = Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
71
71
  end
72
72
 
@@ -29,6 +29,7 @@ class ::IshManager::EmailActionsController < IshManager::ApplicationController
29
29
 
30
30
  def edit
31
31
  @act = @email_action = Office::EmailAction.find( params[:id] )
32
+ @act.ties.push Office::EmailActionTie.new( next_email_action_id: nil )
32
33
  authorize! :edit, @act
33
34
  end
34
35
 
@@ -43,25 +44,29 @@ class ::IshManager::EmailActionsController < IshManager::ApplicationController
43
44
  end
44
45
 
45
46
  def show
47
+ @act = @email_action = Office::EmailAction.find( params[:id] )
48
+ authorize! :show, @act
46
49
  end
47
50
 
48
51
  def update
49
52
  @act = @email_action = Office::EmailAction.find( params[:id] )
50
53
  authorize! :update, @act
51
54
 
52
- next_ids = params[:email_action].delete(:next_email_actions)
53
- next_ids.delete("")
54
- Office::EmailAction.where(prev_email_action_id: params[:id] ).update_all(prev_email_action_id: nil)
55
- next_ids.each do |next_id|
56
- next_action = ::Office::EmailAction.find next_id
57
- next_action.update_attribute( :prev_email_action_id, params[:id] )
55
+ params[:email_action][:ties_attributes].each do |k, v|
56
+ if !v[:next_email_action_id].present?
57
+ params[:email_action][:ties_attributes].delete( k )
58
+ end
59
+ if v[:to_delete] == "1"
60
+ Actie.find( v[:id] ).delete
61
+ params[:email_action][:ties_attributes].delete( k )
62
+ end
58
63
  end
59
64
 
60
65
  flag = @act.update_attributes( params[:email_action].permit! )
61
66
  if flag
62
67
  flash[:notice] = 'Success'
63
68
  else
64
- flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}"
69
+ flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}. #{@act.ties.map { |t| t.errors.full_messages.join(', ') }.join(' | ') }"
65
70
  end
66
71
 
67
72
  redirect_to action: 'index'
@@ -4,14 +4,9 @@ class IshManager::ScheduledEmailActionsController < IshManager::ApplicationContr
4
4
  before_action :set_lists
5
5
 
6
6
  def create
7
- puts! params, 'params'
8
-
9
7
  authorize! :scheduled_emails_create, ::IshManager
10
8
 
11
- @scheduled = Office::ScheduledEmailAction .new({
12
- lead_id: params[:lead_id],
13
- email_action_id: params[:email_action_id],
14
- })
9
+ @scheduled = Office::ScheduledEmailAction.new( params[:sch].permit! )
15
10
 
16
11
  flag = @scheduled.save
17
12
  if flag
@@ -22,35 +22,23 @@
22
22
  = f.select :email_template_id, options_for_select( @email_templates_list, selected: act.email_template_id ), {}, class: 'select2'
23
23
 
24
24
  .col-md-6
25
- .field
26
- %label Next At Exe
27
- .eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
28
- = f.text_field :next_at_exe
29
- -# .field
30
- -# %label Next in Days
31
- -# .eg eg: rand(1..5)
32
- -# = f.text_field :next_in_days
33
- -# .field
34
- -# %label Next at Time
35
- -# .eg eg: rand(8..16).hours + rand(1..59).minutes
36
- -# = f.text_field :next_at_time
37
25
  .field
38
26
  %label Next Email Actions
39
- = f.select :next_email_actions, options_for_select( @email_actions_list, selected: act.next_email_actions.map(&:id) ), { }, { class: 'select2', multiple: true }
27
+ .eg rand(1..5).business_days.from_now.to_date + rand(8..16).hours + rand(1..59).minutes
28
+ %br
29
+
30
+ = f.fields_for :ties do |next_f|
31
+ .flex-row.field
32
+ = next_f.label :next_at_exe
33
+ = next_f.text_field :next_at_exe, class: 'flex-grow'
34
+ .flex-row.field
35
+ = next_f.label :to_delete
36
+ = next_f.check_box :to_delete
37
+ = next_f.select :next_email_action_id, options_for_select( @email_actions_list, selected: next_f.object.next_email_action_id ), { }, { class: 'select2' }
38
+ %br
40
39
 
41
40
  .row
42
41
  .col-sm-6
43
42
  = f.submit :submit
44
43
 
45
44
 
46
-
47
-
48
-
49
-
50
-
51
- -# .field
52
- -# %label State
53
- -# = f.select :state, options_for_select( ::Office::EmailAction::STATES, selected: act.state )
54
- -# .field
55
- -# %label Lead
56
- -# = f.select :lead_id, options_for_select( @leads_list, selected: act.lead_id ), {}, class: 'select2'
@@ -1,5 +1,5 @@
1
1
 
2
- .email-actions-edit
2
+ .email-actions-edit.padded
3
3
  .header
4
4
  %h2.title Edit Email Action
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- .email-actions-index.max-width
2
+ .email-actions-index.padded
3
3
 
4
4
  .header
5
5
  %h2.title
@@ -17,10 +17,16 @@
17
17
  %tr
18
18
  %td= check_box_tag 'abba'
19
19
  %td= link_to '[~]', edit_email_action_path( act )
20
- %td= act.slug
20
+ %td= link_to act.slug, email_action_path( act )
21
21
  %td= act.descr
22
22
  -# %td= act.lead&.email
23
23
  %td
24
24
  %ul
25
- - act.next_email_actions.map do |next_a|
26
- %li= link_to next_a.slug, edit_email_action_path( next_a )
25
+ - act.ties.map do |next_a|
26
+ %li
27
+ .a= next_a.next_at_exe
28
+ .a
29
+ - if next_a.next_email_action.slug == act.slug
30
+ (same)
31
+ = next_a.next_email_action.slug
32
+ -# %li= link_to next_a.next_email_action.slug, edit_email_action_path( next_a.next_email_action )
@@ -1,5 +1,5 @@
1
1
 
2
- .email-actions-new.max-width
2
+ .email-actions-new.padded
3
3
  .header
4
4
  %h2.title
5
5
  New Email Action
@@ -0,0 +1,3 @@
1
+
2
+ .email-actions-show.max-width
3
+ show...
@@ -1,5 +1,5 @@
1
1
 
2
- .leads-show
2
+ .leads-show.padded
3
3
 
4
4
  .header
5
5
  %h2.title
@@ -14,7 +14,7 @@
14
14
  .col-md-6.ctxs
15
15
  %h5
16
16
  Email Contexts (#{@ctxs.length})
17
- = link_to '[new]', '#'
17
+ = link_to '[+]', '#'
18
18
  %ul
19
19
  - @ctxs.each do |ctx|
20
20
  %li
@@ -23,17 +23,14 @@
23
23
  .col-md-6.schs
24
24
  %h5
25
25
  Scheduled actions (#{@schs.length})
26
- = link_to '[new]', '#'
26
+ = link_to '[+]', '#'
27
27
  %ul
28
28
  - @schs.each do |sch|
29
29
  %li
30
30
  = link_to sch.email_action.slug, edit_scheduled_email_action_path(sch)
31
31
  = sch.state
32
-
33
-
34
- (#{link_to 'prototype', edit_email_action_path(sch.email_action)})
35
-
36
- In #{sch.email_action.next_in_days} days at #{sch.email_action.next_at_time}
32
+ (#{link_to 'proto-action', edit_email_action_path(sch.email_action)})
33
+ = sch.perform_at
37
34
 
38
35
 
39
36
  .row
@@ -12,15 +12,19 @@
12
12
  %h5.title Schedule an email action
13
13
 
14
14
  .field
15
- %label Lead
16
- = select_tag :lead_id, options_for_select( @leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), class: 'select2'
15
+ = f.label :lead
16
+ = f.select :lead_id, options_for_select(@leads_list, selected: sch_a[:lead_id]||params[:lead_id] ), class: 'select2'
17
17
  .field
18
18
  %label State
19
19
  = f.select :state, options_for_select(::Office::ScheduledEmailAction::STATES, selected: sch_a.state ), class: 'select2'
20
20
  %br
21
21
  .field
22
22
  %label Email Action
23
- = select_tag :email_action_id, options_for_select( @email_actions_list, selected: sch_a[:email_action_id] ), class: 'select2'
23
+ = f.select :email_action, options_for_select( @email_actions_list, selected: sch_a[:email_action_id] ), class: 'select2'
24
+ %br
25
+ .field
26
+ = f.label :perform_at
27
+ = f.text_field :perform_at
24
28
 
25
29
  .actions
26
30
  = submit_tag 'Schedule'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.384
4
+ version: 0.1.8.385
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -400,6 +400,7 @@ files:
400
400
  - app/views/ish_manager/email_actions/edit.haml
401
401
  - app/views/ish_manager/email_actions/index.haml
402
402
  - app/views/ish_manager/email_actions/new.haml
403
+ - app/views/ish_manager/email_actions/show.haml
403
404
  - app/views/ish_manager/email_campaign_leads/show.haml
404
405
  - app/views/ish_manager/email_contexts/_form.haml
405
406
  - app/views/ish_manager/email_contexts/_form_reply.haml