ish_manager 0.1.8.335 → 0.1.8.337

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: b5eb1b44ed8e7cfdf6af8b72713142784d4ba2826e07d026295c17f06f01487c
4
- data.tar.gz: 39572c43349326d864201eea4944cd21b20b987ab73200bcd0be8bd87ed91d83
3
+ metadata.gz: 119cb9a058b27d517c73af8cd483ef96e264dcda487df9e38fa92c2841a66865
4
+ data.tar.gz: 3e0fcbbfdab6c79f9cd0c14fbd0ca68c6ebb6e63625e22bc0fdcf8f39ee24075
5
5
  SHA512:
6
- metadata.gz: 594eaf9f3dfbd0d519150d5505783be00637d85a2bbbb2e492300a88ea3ff20c819e625d7eb316aa5137a5106cefb3f90b07f8d0a81f264b80c9834dd0b564f3
7
- data.tar.gz: d5a2455056d664e4eb977f2d5eef7cd9e22d566165dc228aec99454ca66eb32ea0c28dc6a4bc45584ea3bcc537a950bd93fc140d162822a25b91fee90d03ba99
6
+ metadata.gz: 8f467be2339eb8bce1c1eeaefe9327fbdbd30fecddfc29f8f88b81fa47d9c9e3ef718655062d710742a8eaf4d029640215b86613b86f65d7cb14a9994f2a0528
7
+ data.tar.gz: 28ea781560a088c016f149785d9889a3306ffcf1452410563cb4ed89501cc53a4b4e9169c530308d4607cedaae920f2a2726dfa6154768e9f9167bc5a444694d
@@ -52,6 +52,11 @@
52
52
  .email-contexts--form,
53
53
  .email-templates--form {
54
54
 
55
+ textarea {
56
+ width: 100%;
57
+ min-height: 200px;
58
+ }
59
+
55
60
  .field-subject {
56
61
  display: flex;
57
62
  width: calc( 100% - 20px );
@@ -63,8 +68,6 @@
63
68
  }
64
69
  }
65
70
 
66
-
67
-
68
71
  .body {
69
72
  border: 1px solid red;
70
73
  padding: 10px;
@@ -7,7 +7,9 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
7
7
 
8
8
  def create
9
9
  authorize! :create, ::Ish::EmailContext
10
- @email_ctx = ::Ish::EmailContext.new params[:ish_email_context].permit!
10
+ pparams = params[:ish_email_context].permit!
11
+ pparams[:tmpl] = JSON.parse(pparams[:tmpl])
12
+ @email_ctx = ::Ish::EmailContext.new pparams
11
13
  if @email_ctx.save
12
14
  flash[:notice] = 'Saved.'
13
15
  redirect_to action: 'show', id: @email_ctx.id
@@ -60,8 +62,7 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
60
62
  render 'ish_manager/email_templates/iframe_src', layout: false
61
63
  return
62
64
  when 'plain'
63
- @body = @email_template.body
64
- @body.gsub!('{name}', @email_ctx.tmpl_name)
65
+ @body = @email_ctx.body_templated
65
66
  render 'ish_manager/email_templates/plain', layout: false
66
67
  return
67
68
  end
@@ -95,7 +96,9 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
95
96
  def update
96
97
  @email_ctx = ::Ish::EmailContext.find params[:id]
97
98
  authorize! :update, @email_ctx
98
- if @email_ctx.update_attributes params[:ish_email_context].permit!
99
+ pparams = params[:ish_email_context].permit!
100
+ pparams[:tmpl] = JSON.parse(pparams[:tmpl])
101
+ if @email_ctx.update_attributes pparams
99
102
  flash[:notice] = 'Saved.'
100
103
  redirect_to action: 'show', id: @email_ctx.id
101
104
  return
@@ -59,8 +59,7 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
59
59
  template = "render/_#{@email_ctx.email_template.slug}"
60
60
  rendered_str = ac.render_to_string("ish_manager/email_templates/_#{@email_ctx.email_template.slug}")
61
61
  when 'plain'
62
- @body = @email_ctx.email_template.body
63
- @body.gsub!('{name}', @email_ctx.name)
62
+ @body = @email_ctx.body_templated
64
63
  template = "render/plain"
65
64
  rendered_str = ac.render_to_string("ish_manager/email_templates/plain")
66
65
  end
@@ -30,9 +30,9 @@
30
30
  = f.label :to_email
31
31
  = f.text_field :to_email
32
32
  %h5 Templating
33
+ %div Commonly: name, companyName
33
34
  .field
34
- = f.label :tmpl_name
35
- = f.text_field :tmpl_name
35
+ = f.text_area :tmpl, value: JSON.pretty_generate( email_ctx.tmpl )
36
36
 
37
37
  .field.field-subject
38
38
  = f.label :subject
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.335
4
+ version: 0.1.8.337
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-21 00:00:00.000000000 Z
11
+ date: 2022-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails