wco_models 3.1.0.89 → 3.1.0.90

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: a31a3f2a942a120f14f6749392ccae5a144062995f359be3827b989f238737da
4
- data.tar.gz: fd1fb43f8997d6cfd7e4750db138a59fecc0d3afa1613a7ab93ba530ca714730
3
+ metadata.gz: c7d502c6769f16c3fee34412c86b5646aa84c22c9c399da8c56cc2b496aa96b4
4
+ data.tar.gz: a4d4fef5edd8dea9656e2526b60b8c6b2a421e1955bc4c79dc1f04dfd4402d40
5
5
  SHA512:
6
- metadata.gz: 5bb910e3451c67d9703797fa050786c4895b978ae55752f281949daa245b40364dfe05d87c27b8b597baeb30bc43b8b258e54a8b41c86d0efc07744962fb45d8
7
- data.tar.gz: cae491d9f519fa1cb60c0d0fa9509d0cd9b22ae97550d6910007c3af920a8aaf8d235b14866107779627fa58790a3e7f093732cab891e66be454bcda8fbad3aa
6
+ metadata.gz: 4fbd26066c57cc0796a23dbb647b59816553fd87d6dbf87bc56bc0e6aa2d6039e017c6bd204519d4f4fff85c668a020e13558a52ec0e6d708941b9e369e5dd79
7
+ data.tar.gz: 951707c1098329b6df362e3050c02e5d0310021e9ebc7b1bc50d41096d1ab7f79bce5382db6610875953ce12846a17b9b3db0e25f03ad7e7375fd17e0d606240
@@ -123,8 +123,12 @@ textarea.monospace {
123
123
  }
124
124
 
125
125
  /* H */
126
- h5.title {
126
+ .header {
127
127
  display: flex;
128
+
129
+ h5.title {
130
+ display: flex;
131
+ }
128
132
  }
129
133
 
130
134
  .h-500px {
@@ -10,6 +10,12 @@ class Wco::ApplicationController < ActionController::Base
10
10
  authorize! :home, Wco
11
11
  end
12
12
 
13
+ def tinymce
14
+ authorize! :home, Wco
15
+ render layout: false
16
+ end
17
+
18
+
13
19
  ##
14
20
  ## private
15
21
  ##
@@ -37,7 +37,7 @@ class Wco::LeadsetsController < Wco::ApplicationController
37
37
  authorize! :index, Leadset
38
38
  @leadsets = Leadset.all.includes(:leads)
39
39
  if params[:q].present?
40
- @leadsets = @leadsets.where(" company_url LIKE ? ", "%#{params[:q]}%" )
40
+ @leadsets = @leadsets.where({ company_url: /.*#{params[:q]}.*/i })
41
41
  if @leadsets.length == 1
42
42
  return redirect_to action: :show, id: @leadsets[0][:id]
43
43
  end
@@ -6,6 +6,15 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
6
6
 
7
7
  layout 'mailer'
8
8
 
9
+ def self.renderer ctx:
10
+ out = self.new
11
+ out.instance_variable_set( :@ctx, ctx )
12
+ out.instance_variable_set( :@lead, ctx.lead )
13
+ out.instance_variable_set( :@utm_tracking_str, ctx.utm_tracking_str )
14
+ out.instance_variable_set( :@unsubscribe_url, ctx.unsubscribe_url )
15
+ out.instance_variable_set( :@config, ctx.config )
16
+ return out
17
+ end
9
18
 
10
19
  def forwarder_notify msg_id
11
20
  @msg = WcoEmail::Message.find msg_id
@@ -46,32 +55,10 @@ class WcoEmail::ApplicationMailer < ActionMailer::Base
46
55
 
47
56
  ## 2023-04-02 _vp_ Continue.
48
57
  ## 2023-09-24 _vp_ Continue : )
58
+ ## 2024-01-17 _vp_ Continue : )
49
59
  def send_context_email ctx_id
50
60
  @ctx = Ctx.find ctx_id
51
- @lead = Wco::Lead.find @ctx.lead_id
52
- @tmpl_config = OpenStruct.new JSON.parse( @ctx.tmpl[:config_json] )
53
-
54
- @utm_tracking_str = {
55
- 'cid' => @ctx.lead_id,
56
- 'utm_campaign' => @ctx.tmpl.slug,
57
- 'utm_medium' => 'email',
58
- 'utm_source' => @ctx.tmpl.slug,
59
- }.map { |k, v| "#{k}=#{v}" }.join("&")
60
-
61
- @unsubscribe_url = WcoEmail::Engine.routes.url_helpers.unsubscribes_url({
62
- template_id: @ctx.tmpl.id,
63
- lead_id: @lead.id,
64
- token: @lead.unsubscribe_token,
65
- host: Rails.application.routes.default_url_options[:host],
66
- })
67
- renderer = WcoEmail::ApplicationMailer.new
68
-
69
- renderer.instance_variable_set( :@ctx, @ctx )
70
- renderer.instance_variable_set( :@lead, @ctx.lead )
71
- renderer.instance_variable_set( :@utm_tracking_str, @utm_tracking_str )
72
- renderer.instance_variable_set( :@unsubscribe_url, @unsubscribe_url )
73
- renderer.instance_variable_set( :@tmpl_config, @tmpl_config )
74
-
61
+ renderer = self.class.renderer ctx: @ctx
75
62
  rendered_str = renderer.render_to_string("/wco_email/email_templates/_#{@ctx.tmpl.layout}")
76
63
  @ctx.update({
77
64
  rendered_str: rendered_str,
@@ -24,6 +24,7 @@ class WcoEmail::Context
24
24
  end
25
25
 
26
26
  field :body
27
+ ## Looks good... 2024-01-17
27
28
  def body
28
29
  if self[:body].presence
29
30
  return self[:body]
@@ -91,14 +92,9 @@ class WcoEmail::Context
91
92
  attr_reader :tid
92
93
 
93
94
  def get_binding
94
- @lead = lead()
95
- @utm_tracking_str = {
96
- 'cid' => lead.id,
97
- 'utm_campaign' => tmpl.slug,
98
- 'utm_medium' => 'email',
99
- 'utm_source' => tmpl.slug,
100
- }.map { |k, v| "#{k}=#{v}" }.join("&")
101
- eval( tmpl.config_exe )
95
+ @lead = lead
96
+ @utm_tracking_str = utm_tracking_str
97
+ # eval( tmpl.config_exe ) ## @TODO: remove? 2024-01-17
102
98
  binding()
103
99
  end
104
100
 
@@ -113,6 +109,28 @@ class WcoEmail::Context
113
109
  outs.to_a
114
110
  end
115
111
 
112
+ def config
113
+ OpenStruct.new JSON.parse( tmpl[:config_json] )
114
+ end
115
+
116
+ def utm_tracking_str
117
+ {
118
+ 'cid' => lead_id,
119
+ 'utm_campaign' => tmpl.slug,
120
+ 'utm_medium' => 'email',
121
+ 'utm_source' => tmpl.slug,
122
+ }.map { |k, v| "#{k}=#{v}" }.join("&")
123
+ end
124
+
125
+ def unsubscribe_url
126
+ WcoEmail::Engine.routes.url_helpers.unsubscribes_url({
127
+ host: Rails.application.routes.default_url_options[:host],
128
+ lead_id: lead_id,
129
+ template_id: tmpl.id,
130
+ token: lead.unsubscribe_token,
131
+ })
132
+ end
133
+
116
134
  end
117
135
  Ctx = WcoEmail::Context
118
136
 
@@ -0,0 +1,33 @@
1
+
2
+ <html>
3
+ <head>
4
+ <!-- include libraries(jQuery, bootstrap) -->
5
+ <link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
6
+ <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
7
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
8
+
9
+ <!-- include codemirror (codemirror.css, codemirror.js, xml.js, formatting.js) -->
10
+ <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
11
+ <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">
12
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
13
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
14
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>
15
+
16
+ <!-- include summernote css/js-->
17
+ <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css">
18
+ <script type="text/javascript" src="//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
19
+ </head>
20
+ <body>
21
+
22
+ <textarea class='tinymce'>
23
+ </textarea>
24
+
25
+ <script>
26
+ $('.tinymce').summernote({
27
+ height: 150, //set editable area's height
28
+ codemirror: { // codemirror options
29
+ theme: 'monokai'
30
+ }
31
+ });
32
+ </script>
33
+ </body></html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.89
4
+ version: 3.1.0.90
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-01-17 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -443,6 +443,7 @@ files:
443
443
  - app/views/wco/application/_meta.haml
444
444
  - app/views/wco/application/_metaline.haml
445
445
  - app/views/wco/application/home.haml
446
+ - app/views/wco/application/tinymce.html.erb
446
447
  - app/views/wco/galleries/_form.haml
447
448
  - app/views/wco/galleries/_header.haml
448
449
  - app/views/wco/galleries/_index.haml