ish_manager 0.1.8.335 → 0.1.8.336

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: b5eb1b44ed8e7cfdf6af8b72713142784d4ba2826e07d026295c17f06f01487c
4
- data.tar.gz: 39572c43349326d864201eea4944cd21b20b987ab73200bcd0be8bd87ed91d83
3
+ metadata.gz: 28209cd961617c020d01031f836cf312836b759a59f93a4126d96e16e8638f25
4
+ data.tar.gz: 87ba7d3183fb3ce417df0e55daa16c7c4586b07ab1a1ace13138caabc1c6e35a
5
5
  SHA512:
6
- metadata.gz: 594eaf9f3dfbd0d519150d5505783be00637d85a2bbbb2e492300a88ea3ff20c819e625d7eb316aa5137a5106cefb3f90b07f8d0a81f264b80c9834dd0b564f3
7
- data.tar.gz: d5a2455056d664e4eb977f2d5eef7cd9e22d566165dc228aec99454ca66eb32ea0c28dc6a4bc45584ea3bcc537a950bd93fc140d162822a25b91fee90d03ba99
6
+ metadata.gz: 9f11d03c08dd05be68126116be45baccc904146d2739916cfce79cf9f251e1658952a0eb6366ba9b48decde688c5e53a046928dfe0729520d7ad905b7687e969
7
+ data.tar.gz: 46d41f6306aaafe4c4638b6ca98edfc842639c57762e8917204e79b11f994af3f5cabd83a9808741436019ed5758193a2254041299058c1c2e1d6735a35bba03
@@ -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;
@@ -8,6 +8,7 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
8
8
  def create
9
9
  authorize! :create, ::Ish::EmailContext
10
10
  @email_ctx = ::Ish::EmailContext.new params[:ish_email_context].permit!
11
+ @email_ctx.tmpl = JSON.parse(@email_ctx.tmpl)
11
12
  if @email_ctx.save
12
13
  flash[:notice] = 'Saved.'
13
14
  redirect_to action: 'show', id: @email_ctx.id
@@ -60,8 +61,7 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
60
61
  render 'ish_manager/email_templates/iframe_src', layout: false
61
62
  return
62
63
  when 'plain'
63
- @body = @email_template.body
64
- @body.gsub!('{name}', @email_ctx.tmpl_name)
64
+ @body = @email_ctx.body_templated
65
65
  render 'ish_manager/email_templates/plain', layout: false
66
66
  return
67
67
  end
@@ -95,7 +95,9 @@ class ::IshManager::EmailContextsController < ::IshManager::ApplicationControlle
95
95
  def update
96
96
  @email_ctx = ::Ish::EmailContext.find params[:id]
97
97
  authorize! :update, @email_ctx
98
- if @email_ctx.update_attributes params[:ish_email_context].permit!
98
+ pparams = params[:ish_email_context].permit!
99
+ pparams[:tmpl] = JSON.parse(pparams[:tmpl])
100
+ if @email_ctx.update_attributes pparams
99
101
  flash[:notice] = 'Saved.'
100
102
  redirect_to action: 'show', id: @email_ctx.id
101
103
  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.336
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