mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 19:55:10 +00:00
Add Haxmas template (#190)
This commit is contained in:
parent
33b2223392
commit
888b119d51
2 changed files with 53 additions and 0 deletions
BIN
app/lib/snail_mail/assets/images/haxmas.png
Normal file
BIN
app/lib/snail_mail/assets/images/haxmas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
53
app/lib/snail_mail/components/templates/haxmas_template.rb
Normal file
53
app/lib/snail_mail/components/templates/haxmas_template.rb
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SnailMail
|
||||
module Components
|
||||
module Templates
|
||||
class HaxmasTemplate < TemplateBase
|
||||
def self.template_name
|
||||
"Haxmas"
|
||||
end
|
||||
|
||||
def self.show_on_single?
|
||||
true
|
||||
end
|
||||
|
||||
def view_template
|
||||
image(
|
||||
image_path("haxmas.png"),
|
||||
at: [ -2.5, 295 ],
|
||||
width: 443,
|
||||
)
|
||||
|
||||
|
||||
render_return_address(10, 278, 260, 70, size: 8, font: "f25")
|
||||
|
||||
|
||||
render_destination_address(
|
||||
100,
|
||||
200,
|
||||
260,
|
||||
120,
|
||||
size: 14,
|
||||
valign: :center,
|
||||
align: :left
|
||||
)
|
||||
|
||||
bounding_box [ 7, 165 ],
|
||||
width: 65,
|
||||
height: 67,
|
||||
valign: :bottom do
|
||||
font_size 8
|
||||
text letter.rubber_stamps || ""
|
||||
end
|
||||
|
||||
|
||||
render_imb(140, 70, 183)
|
||||
render_qr_code(310, 262, 42)
|
||||
render_letter_id(2, 5, 6)
|
||||
render_postage
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue