ish_models 0.0.33.298 → 0.0.33.300
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameui/asset3d.rb +4 -2
- data/lib/ish_models.rb +2 -0
- data/lib/office/directmail_envelope.rb +51 -0
- data/lib/office/email_message.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cbacd235fd37e42e37b5c5f8abd84a51658aa5a5263454a798122af614cdbf1
|
4
|
+
data.tar.gz: 4bc1d8a4b4e69b50cde0f842e395823c686fee275803f961e7fda433045353bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29a7decf23ce8c07ebbd3a2ac67c969a097bd09ff5782bed675cbc577cff390ba7e36bcc7d58d352b4878601f85d468b5bcb8398f2415c1ce9c6271c7ab126b4
|
7
|
+
data.tar.gz: e129b750d37d0774a0cae9500fbbda062e82ef12d35019434f28268688da689b8037dad2155dd33ff3afc661278d061894372059b17e9bab0c14e8e9a424d496
|
data/lib/gameui/asset3d.rb
CHANGED
@@ -8,8 +8,9 @@ class ::Gameui::Asset3d
|
|
8
8
|
include Mongoid::Paperclip
|
9
9
|
include Ish::Utils
|
10
10
|
|
11
|
-
belongs_to :marker,
|
12
|
-
belongs_to :invoice,
|
11
|
+
belongs_to :marker, class_name: 'Gameui::Marker', optional: true
|
12
|
+
belongs_to :invoice, class_name: 'Ish::Invoice', optional: true
|
13
|
+
belongs_to :email_message, class_name: 'Office::EmailMessage', optional: true, inverse_of: :asset3ds
|
13
14
|
|
14
15
|
has_mongoid_attached_file :object,
|
15
16
|
:storage => :s3,
|
@@ -29,3 +30,4 @@ class ::Gameui::Asset3d
|
|
29
30
|
end
|
30
31
|
|
31
32
|
end
|
33
|
+
GA3 = ::Gameui::Asset3d
|
data/lib/ish_models.rb
CHANGED
@@ -66,6 +66,7 @@ require 'video'
|
|
66
66
|
require 'office/action'
|
67
67
|
require 'office/action_tie'
|
68
68
|
require 'office/admin_message'
|
69
|
+
require 'office/directmail_envelope'
|
69
70
|
require 'office/email_action'
|
70
71
|
require 'office/email_action_tie'
|
71
72
|
require 'office/email_attachment'
|
@@ -80,6 +81,7 @@ require 'office/lead_action_template'
|
|
80
81
|
require 'office/obfuscated_redirect'
|
81
82
|
require 'office/scheduled_email_action'
|
82
83
|
|
84
|
+
|
83
85
|
require 'wco/appliance'
|
84
86
|
require 'wco/appliance_tmpl'
|
85
87
|
require 'wco/leadset'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'prawn'
|
2
|
+
|
3
|
+
class Office::DirectmailEnvelope
|
4
|
+
include Mongoid::Document
|
5
|
+
include Mongoid::Timestamps
|
6
|
+
|
7
|
+
|
8
|
+
## 72 points per inch
|
9
|
+
## 72 ppi
|
10
|
+
def self.list_to_envelopes props
|
11
|
+
from = props[:from]
|
12
|
+
|
13
|
+
pdf = Prawn::Document.new({ page_size: [ 9.5*72, 4.12*72 ], :margin => [0,0,0,0] })
|
14
|
+
|
15
|
+
pdf.canvas do
|
16
|
+
|
17
|
+
props[:tos].each_with_index do |to, idx|
|
18
|
+
print '.'
|
19
|
+
|
20
|
+
pdf.bounding_box( [ 0.5*72, 3.5*72 ], width: 3*72, height: 2*72 ) do
|
21
|
+
# pdf.transparent(0.5) { pdf.stroke_bounds }
|
22
|
+
|
23
|
+
pdf.text from[:name]
|
24
|
+
pdf.text from[:address_1]
|
25
|
+
pdf.text from[:address_2]
|
26
|
+
pdf.text from[:address_3]
|
27
|
+
end
|
28
|
+
|
29
|
+
pdf.bounding_box( [ 4*72, 2.5*72 ], width: 4*72, height: 2*72 ) do
|
30
|
+
# pdf.transparent(0.5) { pdf.stroke_bounds }
|
31
|
+
|
32
|
+
pdf.text to[:name]
|
33
|
+
pdf.text to[:address_1]
|
34
|
+
pdf.text to[:address_2]
|
35
|
+
pdf.text to[:address_3]
|
36
|
+
end
|
37
|
+
|
38
|
+
if idx+1 != props[:tos].length
|
39
|
+
pdf.start_new_page
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
return pdf
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
ODE = ::Office::DirectmailEnvelope
|
51
|
+
|
data/lib/office/email_message.rb
CHANGED
@@ -54,6 +54,7 @@ class Office::EmailMessage
|
|
54
54
|
end
|
55
55
|
|
56
56
|
has_many :email_attachments, class_name: 'Office::EmailAttachment', inverse_of: :email_message
|
57
|
+
has_many :asset3ds, class_name: 'Gameui::Asset3d', inverse_of: :email_message
|
57
58
|
has_many :attachments, class_name: 'Photo'
|
58
59
|
|
59
60
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.33.
|
4
|
+
version: 0.0.33.300
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- lib/office/action.rb
|
217
217
|
- lib/office/action_tie.rb
|
218
218
|
- lib/office/admin_message.rb
|
219
|
+
- lib/office/directmail_envelope.rb
|
219
220
|
- lib/office/email_action.rb
|
220
221
|
- lib/office/email_action_tie.rb
|
221
222
|
- lib/office/email_attachment.rb
|