ish_manager 0.1.8.385 → 0.1.8.387

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/email_contexts.js +1 -15
  3. data/app/assets/javascripts/ish_manager/email_templates.js +1 -1
  4. data/app/assets/stylesheets/ish_manager/application.scss +2 -1
  5. data/app/assets/stylesheets/ish_manager/email.scss +2 -0
  6. data/app/assets/stylesheets/ish_manager/email_contexts.scss +0 -4
  7. data/app/assets/stylesheets/ish_manager/email_templates.scss +1 -1
  8. data/app/assets/stylesheets/ish_manager/{scheduled_actions_emails.scss → scheduled_email_actions.scss} +21 -4
  9. data/app/controllers/ish_manager/application_controller.rb +21 -17
  10. data/app/controllers/ish_manager/email_actions_controller.rb +20 -33
  11. data/app/controllers/ish_manager/email_contexts_controller.rb +10 -9
  12. data/app/jobs/ish_manager/test_email_job.rb +2 -0
  13. data/app/mailers/ish_manager/application_mailer.rb +4 -0
  14. data/app/mailers/ish_manager/office_mailer.rb +5 -15
  15. data/app/views/ish_manager/application_mailer/test_email.html.erb +3 -0
  16. data/app/views/ish_manager/email_actions/_form.haml +4 -4
  17. data/app/views/ish_manager/email_actions/new.haml +2 -0
  18. data/app/views/ish_manager/email_actions/show.haml +9 -1
  19. data/app/views/ish_manager/email_contexts/_form.haml +17 -23
  20. data/app/views/ish_manager/email_contexts/edit.haml +3 -1
  21. data/app/views/ish_manager/email_contexts/iframe_src.haml +4 -0
  22. data/app/views/ish_manager/email_contexts/index.haml +0 -4
  23. data/app/views/ish_manager/email_contexts/new.haml +3 -1
  24. data/app/views/ish_manager/email_contexts/show.haml +7 -6
  25. data/app/views/ish_manager/email_conversations/show.haml +2 -1
  26. data/app/views/ish_manager/email_templates/_form.haml +3 -0
  27. data/app/views/ish_manager/email_templates/_plain.haml +4 -0
  28. data/app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb +3 -319
  29. data/app/views/ish_manager/email_templates/iframe_src.haml +1 -2
  30. data/app/views/ish_manager/scheduled_email_actions/_form.haml +9 -15
  31. data/app/views/ish_manager/scheduled_email_actions/_form_mini.haml-trash +28 -0
  32. data/app/views/ish_manager/scheduled_email_actions/index.haml +3 -1
  33. data/config/routes.rb +1 -0
  34. data/lib/tasks/office_tasks.rake +13 -12
  35. metadata +8 -5
  36. data/app/views/ish_manager/email_templates/plain.html.erb +0 -4
  37. /data/app/views/ish_manager/email_templates/{_plain.html.erb → plain.html.erb-trash} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b543b5f1c79e4a3938be93fc4701c085393798b4bb8809bb9eca0c7d825937ac
4
- data.tar.gz: 335bb44f73016350aa4c8d44e800425376bfdd7659d621819002a18a97b05504
3
+ metadata.gz: 69f00f3a091162a2aa2b6535f519bd2a9437984131334224bbd8936fe9bf0bac
4
+ data.tar.gz: d3272e499c6b92122a07cac2879f62fa38ea2f44a09562728b6adb7c89d1ab33
5
5
  SHA512:
6
- metadata.gz: c289826afe4fc20ccd178005e48c2a4ed28fdadefb148edc134b73fd7b560ef63c8685ebd267a226e04bf95b06fd29da3d021191f5da68c47681c825cad34061
7
- data.tar.gz: 107bca0378ff2406e639735fc132f4c7512dc8cd8f1fbb7b1d892a5e8682e6115a8e972b5a5843ce2de3ef7e8086c9d4d2ef9e50e502b81126e8cbf43fa49a52
6
+ metadata.gz: fc3f0866b54220116e7ebdac586f19a0333c973b1adfc819ab66ed03a10e691801a09a7dba0baced8cd10079b2078becb9c39c484c0724613177cb0350328818
7
+ data.tar.gz: e3a7dda50885710cb50c784e5d6185dd78c31c0c1fdc3779922ee4523efa073ef761e93c4fb553054d82db8da659f95ad1e516fa8afc29ae4935c1892cb324c8
@@ -3,26 +3,12 @@
3
3
  $(document).ready(() => {
4
4
 
5
5
  if ($(".email-contexts--form").length) {
6
+
6
7
  $("#ish_email_context_email_template_id").on('change', (ev) => {
7
8
  const val = ev.target.value
8
9
  window.location.href = AppRouter.new_email_context_with_template_path(val)
9
10
  })
10
11
 
11
- $("#ish_email_context_type").on('change', (ev) => {
12
- const val = ev.target.value
13
- if (val == 'TYPE_CAMPAIGN') {
14
- $(".email-contexts--form .TYPE_SINGLE").css('display', 'none')
15
- } else {
16
- $(".email-contexts--form .TYPE_SINGLE").css('display', 'block')
17
- }
18
- })
19
- // on page load:
20
- if ($("#ish_email_context_type").val() == 'TYPE_CAMPAIGN') {
21
- $(".email-contexts--form .TYPE_SINGLE").css('display', 'none')
22
- } else {
23
- $(".email-contexts--form .TYPE_SINGLE").css('display', 'block')
24
- }
25
-
26
12
  }
27
13
 
28
14
  })
@@ -1,7 +1,7 @@
1
1
 
2
2
  $(document).ready(() => {
3
3
 
4
- if ($(".email-templates--form").length) {
4
+ if ($(".email-templates--form").length || $(".email-contexts--form").length) {
5
5
  $(".tab-labels > a").click(function() {
6
6
  logg( $(this).data('ref'), 'ref')
7
7
 
@@ -18,7 +18,7 @@
18
18
  *= require ish_manager/office
19
19
  *= require ish_manager/pagination
20
20
  *= require ish_manager/photos
21
- *= require ish_manager/scheduled_actions_emails
21
+ *= require ish_manager/scheduled_email_actions
22
22
  *= require ish_manager/tags
23
23
  *= require ish_manager/user_profiles
24
24
  *= require ish_manager/videos
@@ -406,6 +406,7 @@ textarea.large {
406
406
 
407
407
  .select2-container {
408
408
  max-width: 100%;
409
+ min-width: 250px;
409
410
  display: block;
410
411
  }
411
412
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  .email-actions-edit,
4
4
  .email-actions-index,
5
+ .email-actions-new,
5
6
  .email-filters-index,
6
7
  .email-templates-edit,
7
8
  .email-templates-new,
@@ -13,6 +14,7 @@
13
14
  .leads-edit,
14
15
  .leads-index,
15
16
  .leads-show,
17
+ .scheduled-email-actions--form,
16
18
  .scheduled-emails-index {
17
19
  .header {
18
20
  display: flex;
@@ -24,10 +24,6 @@
24
24
 
25
25
  .field-template {
26
26
  display: flex;
27
-
28
- a.action-view {
29
- width: 150px;
30
- }
31
27
  }
32
28
 
33
29
  textarea {
@@ -1,4 +1,5 @@
1
1
 
2
+ .email-contexts--form,
2
3
  .email-templates--form {
3
4
  form {
4
5
  > .actions {
@@ -9,7 +10,6 @@
9
10
  // border: 1px solid red;
10
11
  margin-top: 1em;
11
12
 
12
-
13
13
  display: flex;
14
14
 
15
15
  > * {
@@ -4,8 +4,6 @@
4
4
  }
5
5
 
6
6
  .scheduled-emails-new {
7
-
8
-
9
7
  border: 1px solid red;
10
8
  border-radius: .5em;
11
9
  padding: .5em;
@@ -18,13 +16,32 @@
18
16
 
19
17
  }
20
18
 
21
- .scheduled-actions--form-mini {
22
- display: inline-block;
19
+ .form-mini {
20
+ border: 1px solid blue;
23
21
  background: #ccc;
24
22
 
23
+ display: inline-block;
24
+ }
25
+
26
+ .scheduled-email-actions--form {
27
+
25
28
  form {
26
29
  border: 1px solid blue;
30
+ border-radius: 0.5em;
31
+ padding: 0.5em;
32
+
33
+ background: #ccc;
34
+ display: inline-block;
35
+ }
27
36
 
37
+ .actions {
28
38
  display: flex;
39
+ justify-content: flex-end;
40
+ padding-top: .5em;
29
41
  }
42
+
43
+ .flex-row {
44
+ justify-content: space-between;
45
+ }
46
+
30
47
  }
@@ -1,6 +1,7 @@
1
1
 
2
2
  module IshManager
3
3
  class ApplicationController < ActionController::Base
4
+
4
5
  protect_from_forgery :with => :exception, :prepend => true
5
6
  before_action :set_current_ability
6
7
  before_action :set_changelog
@@ -9,7 +10,11 @@ module IshManager
9
10
  check_authorization
10
11
  rescue_from ::CanCan::AccessDenied, :with => :access_denied
11
12
 
12
- http_basic_authenticate_with :name => BASIC_AUTH_NAME, :password => BASIC_AUTH_PASSWORD
13
+ before_action :basic_auth
14
+ def basic_auth
15
+ return if Rails.env.test?
16
+ http_basic_authenticate_or_request_with :name => BASIC_AUTH_NAME, :password => BASIC_AUTH_PASSWORD
17
+ end
13
18
 
14
19
  def home
15
20
  authorize! :home, IshManager::Ability
@@ -26,6 +31,11 @@ module IshManager
26
31
  redirect_to user_signed_in? ? root_path : Rails.application.routes.url_helpers.new_user_session_path, :alert => exception.message
27
32
  end
28
33
 
34
+ def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
35
+ payload[:exp] = exp.to_i
36
+ JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
37
+ end
38
+
29
39
  def pp_errors err
30
40
  err
31
41
  end
@@ -51,23 +61,17 @@ module IshManager
51
61
  @jwt_token = encode(user_profile_id: @current_user.profile.id.to_s)
52
62
  end
53
63
 
54
- def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
55
- payload[:exp] = exp.to_i
56
- JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
57
- end
58
-
59
64
  def set_lists
60
- @galleries_list = Gallery.all.list
61
- @locations_list = ::Gameui::Map.list
62
- @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
63
- @reports_list = Report.all.list
64
- @user_profiles_list = Ish::UserProfile.list
65
- @videos_list = Video.all.list
66
-
67
- @leads_list = Lead.list
68
- @leadsets_list = Leadset.list
69
- @email_actions_list = [[nil,nil]] + ::Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
70
- @email_templates_list = Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
65
+ @galleries_list = Gallery.all.list
66
+ @locations_list = ::Gameui::Map.list
67
+ @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
68
+ @reports_list = Report.all.list
69
+ @user_profiles_list = Ish::UserProfile.list
70
+ @videos_list = Video.all.list
71
+ @leads_list = Lead.list
72
+ @leadsets_list = Leadset.list
73
+ @email_actions_list = [[nil,nil]] + Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
74
+ @email_templates_list = [[nil,nil]] + Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
71
75
  end
72
76
 
73
77
  def set_title
@@ -5,28 +5,6 @@ class ::IshManager::EmailActionsController < IshManager::ApplicationController
5
5
 
6
6
  ## Alphabetized : )
7
7
 
8
- def create
9
- @act = @email_action = Office::EmailAction.new
10
- authorize! :create, @act
11
-
12
- next_ids = params[:email_action].delete(:next_email_actions)
13
- next_ids.delete("")
14
- Office::EmailAction.where(prev_email_action_id: params[:id] ).update_all(prev_email_action_id: nil)
15
- next_ids.each do |next_id|
16
- next_action = ::Office::EmailAction.find next_id
17
- next_action.update_attribute( :prev_email_action_id, params[:id] )
18
- end
19
-
20
- flag = @act.update_attributes( params[:email_action].permit! )
21
- if flag
22
- flash[:notice] = 'Success'
23
- else
24
- flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}"
25
- end
26
-
27
- redirect_to action: 'index'
28
- end
29
-
30
8
  def edit
31
9
  @act = @email_action = Office::EmailAction.find( params[:id] )
32
10
  @act.ties.push Office::EmailActionTie.new( next_email_action_id: nil )
@@ -48,28 +26,37 @@ class ::IshManager::EmailActionsController < IshManager::ApplicationController
48
26
  authorize! :show, @act
49
27
  end
50
28
 
29
+ ## def create; update; end
30
+ ## def upsert; update; end
51
31
  def update
52
- @act = @email_action = Office::EmailAction.find( params[:id] )
53
- authorize! :update, @act
54
-
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 )
32
+ if params[:id]
33
+ @act = @email_action = Office::EmailAction.find( params[:id] )
34
+ else
35
+ @act = @email_action = Office::EmailAction.new
36
+ end
37
+ authorize! :upsert, @act
38
+
39
+ if params[:email_action][:ties_attributes]
40
+ params[:email_action][:ties_attributes].each do |k, v|
41
+ if !v[:next_email_action_id].present?
42
+ params[:email_action][:ties_attributes].delete( k )
43
+ end
44
+ if v[:to_delete] == "1"
45
+ Actie.find( v[:id] ).delete
46
+ params[:email_action][:ties_attributes].delete( k )
47
+ end
62
48
  end
63
49
  end
64
50
 
65
51
  flag = @act.update_attributes( params[:email_action].permit! )
66
52
  if flag
67
53
  flash[:notice] = 'Success'
54
+ redirect_to action: 'index'
68
55
  else
69
56
  flash[:alert] = "No luck: #{@act.errors.full_messages.join(', ')}. #{@act.ties.map { |t| t.errors.full_messages.join(', ') }.join(' | ') }"
57
+ render action: 'edit'
70
58
  end
71
59
 
72
- redirect_to action: 'index'
73
60
  end
74
61
 
75
62
  ##
@@ -6,8 +6,7 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
6
6
  before_action :set_lists
7
7
 
8
8
  def create
9
- pparams = params[:ish_email_context].permit!
10
- @ctx = ::Ish::EmailContext.new pparams
9
+ @ctx = ::Ish::EmailContext.new params[:ctx].permit!
11
10
  @tmpl = ::Ish::EmailTemplate.find @ctx.email_template_id
12
11
 
13
12
  @ctx.from_email ||= @tmpl.from_email
@@ -57,9 +56,12 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
57
56
  def iframe_src
58
57
  @ctx = @email_context = Ish::EmailContext.find params[:id]
59
58
  authorize! :iframe_src, @ctx
59
+
60
60
  @tmpl = @email_template = @ctx.email_template
61
61
  @lead = @ctx.lead
62
- render "ish_manager/email_templates/_#{@tmpl.layout}", layout: false
62
+ @body = @ctx.body
63
+
64
+ render layout: false
63
65
  end
64
66
 
65
67
  def index
@@ -80,10 +82,10 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
80
82
  authorize! :new, ::Ish::EmailContext
81
83
  @tmpl = @email_template = Ish::EmailTemplate.where( slug: params[:template_slug] ).first || Ish::EmailTemplate.where( id: params[:template_slug] ).first
82
84
  attrs = {}
83
- if @template
84
- attrs = @template.attributes.slice( :subject, :body, :from_email )
85
+ if @tmpl
86
+ attrs = @tmpl.attributes.slice( :subject, :body, :from_email )
85
87
  end
86
- @ctx = ::Ish::EmailContext.new( { email_template: @template }.merge(attrs) )
88
+ @ctx = ::Ish::EmailContext.new( { email_template: @tmpl }.merge(attrs) )
87
89
  end
88
90
 
89
91
  def show
@@ -94,11 +96,10 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
94
96
  def update
95
97
  @ctx = ::Ish::EmailContext.find params[:id]
96
98
  authorize! :update, @ctx
97
- pparams = params[:ish_email_context].permit!
98
99
 
99
- if @ctx.update_attributes pparams
100
+ if @ctx.update_attributes params[:ctx].permit!
100
101
  flash[:notice] = 'Saved.'
101
- redirect_to action: 'show', id: @ctx.id
102
+ redirect_to action: 'edit', id: @ctx.id
102
103
  return
103
104
  else
104
105
  flash[:alert] = "Could not save: #{@ctx.errors.full_messages.join(', ')}"
@@ -9,3 +9,5 @@ class IshManager::TestEmailJob
9
9
  end
10
10
 
11
11
  end
12
+
13
+
@@ -25,5 +25,9 @@ module IshManager
25
25
  mail( :to => stock.profile.email, :subject => "IshManager Stock Alert :: #{stock.ticker}" ).deliver
26
26
  end
27
27
 
28
+ def test_email
29
+ mail( to: 'piousbox@gmail.com', subject: "Test email at #{Time.now}" )
30
+ end
31
+
28
32
  end
29
33
  end
@@ -56,28 +56,18 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
56
56
  end
57
57
 
58
58
  def send_context_email ctx_id
59
- @email_ctx = ::Ish::EmailContext.find ctx_id
59
+ @ctx = ::Ish::EmailContext.find ctx_id
60
60
  ac = ActionController::Base.new
61
- ac.instance_variable_set( :@email_ctx, @email_ctx )
61
+ ac.instance_variable_set( :@ctx, @ctx )
62
62
 
63
- raise '@TODO: re-implement. _vp_ 2023-03-04'
64
- # case @email_ctx.email_template.type
65
- # when 'partial'
66
- # template = "render/_#{@email_ctx.email_template.slug}"
67
- # rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@email_ctx.email_template.slug}")
68
- # when 'plain'
69
- # @body = @email_ctx.body_templated
70
- # template = "render/plain"
71
- # rendered_str = ac.render_to_string("ish_manager/email_templates/plain")
72
- # end
73
-
74
- @email_ctx.update( rendered_str: rendered_str, sent_at: Time.now.to_s )
63
+ rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@ctx.tmpl.slug}")
64
+ @ctx.update( rendered_str: rendered_str, sent_at: Time.now.to_s )
75
65
 
76
66
  mail( from: @email_ctx.from_email,
77
67
  to: @email_ctx.to_email,
78
68
  bcc: 'piousbox@gmail.com',
79
69
  subject: @email_ctx.subject,
80
- template_name: template )
70
+ template_name: "render/_#{@ctx.tmpl.slug}" )
81
71
  end
82
72
 
83
73
  end
@@ -0,0 +1,3 @@
1
+
2
+ <p>This is a test email.</p>
3
+ <p>Time now: <%= Time.now %>.</p>
@@ -14,10 +14,10 @@
14
14
  .field
15
15
  %label Slug
16
16
  = f.text_field :slug
17
- .field
18
- %label Descr
19
- = f.text_area :descr
20
- .field
17
+ -# .field
18
+ -# %label Descr
19
+ -# = f.text_area :descr
20
+ .field.flex-row
21
21
  %label Template
22
22
  = f.select :email_template_id, options_for_select( @email_templates_list, selected: act.email_template_id ), {}, class: 'select2'
23
23
 
@@ -1,4 +1,6 @@
1
1
 
2
+ -# padded b/c eval(next_time_at) is long
3
+
2
4
  .email-actions-new.padded
3
5
  .header
4
6
  %h2.title
@@ -1,3 +1,11 @@
1
1
 
2
2
  .email-actions-show.max-width
3
- show...
3
+ .header
4
+ .title Email Action #{@act.id}
5
+
6
+ %ul
7
+ - @act.ties.map do |next_a|
8
+ %li
9
+ .a <b>Next act:</b> #{"(same)" if next_a.next_email_action.slug == @act.slug} #{next_a.next_email_action.slug}
10
+ .a <b>Next at exe:</b> #{next_a.next_at_exe}
11
+ .a <b>Eval'ed:</b> #{eval( next_a.next_at_exe )}
@@ -1,12 +1,7 @@
1
1
 
2
2
  .email-contexts--form
3
- .header
4
- %h2.title Email Context
5
-
6
3
  - url = ctx.new_record? ? email_contexts_path : email_context_path(ctx)
7
- = form_for ctx, url: url do |f|
8
- .row
9
- = f.submit 'Save'
4
+ = form_for ctx, as: :ctx, url: url do |f|
10
5
  .row
11
6
  .col-md-6
12
7
  .field.field-template
@@ -15,36 +10,35 @@
15
10
  - if ctx.email_template_id
16
11
  = link_to 'view', email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
17
12
  = link_to '~', edit_email_template_path( ctx.email_template_id ), target: :_blank, class: [ 'action-view' ]
18
- -# .field
19
- -# = f.label :slug
20
- -# = f.text_field :slug
13
+ layout: #{ctx.tmpl.layout}
21
14
 
22
15
  .field
23
16
  = f.label "From"
24
17
  = f.select :from_email, options_for_select(Ish::EmailContext.from_email_list, selected: ctx.from_email)
25
18
 
26
- -# .col-md-6
27
- -# %h5 Context
28
- -# %div Commonly: name, companyName
29
- -# .field
30
- -# = f.text_area :tmpl, value: JSON.pretty_generate( ctx.tmpl )
31
19
  .row
32
20
  .col-md-4
33
- .field
21
+ .field.flex-row
34
22
  = f.label "To lead"
35
- = f.select :lead_id, options_for_select( @leads_list ), {}, { class: 'select2' }
23
+ = f.select :lead_id, options_for_select( @leads_list, selected: ctx.lead_id ), {}, { class: 'select2' }
36
24
  .col-md-8
37
25
  .field.field-subject
38
26
  = f.label :subject
39
27
  = f.text_field :subject
40
28
 
41
- - if 'plain' == ctx.email_template&.layout
42
- .body
43
- = raw ctx.email_template.body
44
- - else
45
- .field
46
- = f.label :body
47
- = f.text_area :body, class: 'tinymce'
29
+
30
+
31
+ .tab-labels
32
+ %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
33
+ %a.label-preview.active{ href: "javascript: void(0)", data: { ref: '.tab-preview' } } Preview
34
+ .label-save-preview= f.submit 'Save & Preview'
35
+ .tabs
36
+ .tab-raw
37
+ = f.text_area :body
38
+ .tab-preview
39
+ %iframe{ src: email_context_iframe_path(ctx), width: '100%', height: '100%' }
40
+
41
+
48
42
  .actions
49
43
  .left
50
44
  = f.submit 'Preview'
@@ -1,3 +1,5 @@
1
1
 
2
- .email-contexts-edit
2
+ .email-contexts-edit.max-width
3
+ .header
4
+ %h2.title Edit email Context
3
5
  = render 'ish_manager/email_contexts/form', ctx: @ctx, tmpl: @tmpl
@@ -0,0 +1,4 @@
1
+
2
+
3
+ = render "ish_manager/email_templates/#{@email_template.layout}"
4
+
@@ -20,8 +20,6 @@
20
20
  %th.to To
21
21
  %th.subject Subject
22
22
  %th.template Template
23
- %th.created_at Created at
24
- %th.updated_at Updated at
25
23
  %tbody
26
24
  - @ctxs.each do |ctx|
27
25
  %tr
@@ -38,8 +36,6 @@
38
36
  = link_to email_context_path(ctx) do
39
37
  = ctx.subject ? ctx.subject : "t| #{ctx.tmpl.subject}"
40
38
  %td= ctx.email_template.slug
41
- %td= ctx.created_at.strftime('%Y-%m-%d %l:%M%P %:z')
42
- %td= ctx.updated_at.strftime('%Y-%m-%d %l:%M%P %:z')
43
39
 
44
40
 
45
41
  = render 'paginate', resource: @ctxs, param_name: :email_contexts_page, views_prefix: :ish_manager
@@ -1,3 +1,5 @@
1
1
 
2
- .email-contexts-new
2
+ .email-contexts-new.max-width
3
+ .header
4
+ %h2.title New email context
3
5
  = render 'ish_manager/email_contexts/form', ctx: @ctx
@@ -23,10 +23,11 @@
23
23
  = button_to 'Send', email_context_send_path(@ctx), form_class: 'inline', :data => { :confirm => 'Are you sure?' }
24
24
  = link_to '[~]', edit_email_context_path(@ctx)
25
25
 
26
- - if @ctx.sent_at
27
- = raw @ctx.rendered_str
28
- = @ctx.tmpl
26
+ .max-width
27
+ - if @ctx.sent_at
28
+ = raw @ctx.rendered_str
29
+ -# = @ctx.tmpl
29
30
 
30
- - else
31
- = link_to 'i-src', email_context_iframe_path(@ctx), target: :_blank
32
- %iframe{ src: email_context_iframe_path(@ctx), width: '100%', height: '100%' }
31
+ - else
32
+ -# = link_to 'i-src', email_context_iframe_path(@ctx), target: :_blank
33
+ %iframe{ src: email_context_iframe_path(@ctx), width: '100%', height: '100%' }
@@ -31,7 +31,8 @@
31
31
  = msg.id
32
32
  <b>To:</b> #{msg.to}
33
33
  %li
34
- <b>From:</b> #{msg.from}
34
+ <b>From:</b>
35
+ -# #{msg.from}
35
36
  = lead.email
36
37
  %a.chip{ href: email_contexts_for_lead_path( lead ) }
37
38
  \(
@@ -23,6 +23,7 @@
23
23
  = f.label :preview_str
24
24
  = f.text_field :preview_str
25
25
 
26
+
26
27
  .tab-labels
27
28
  %a.label-raw{ href: "javascript: void(0)", data: { ref: '.tab-raw' } } Raw
28
29
  %a.label-preview.active{ href: "javascript: void(0)", data: { ref: '.tab-preview' } } Preview
@@ -34,6 +35,8 @@
34
35
  - if email_template.persisted?
35
36
  -# .descr= render "ish_manager/email_templates/#{email_template.layout}", ctx: Ish::EmailContext.new, tmpl: email_template
36
37
  %iframe{ src: email_template_iframe_path(email_template), width: '100%', height: '100%' }
38
+
39
+
37
40
  .actions
38
41
  = f.submit 'Save'
39
42
 
@@ -0,0 +1,4 @@
1
+
2
+
3
+ = raw ERB.new( @ctx.body ).result
4
+