mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 16:38:18 +00:00
pyramid scheme template
This commit is contained in:
parent
f2433418af
commit
472465b521
2 changed files with 61 additions and 0 deletions
BIN
app/lib/snail_mail/assets/images/pyramids.png
Normal file
BIN
app/lib/snail_mail/assets/images/pyramids.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
|
|
@ -0,0 +1,61 @@
|
|||
module SnailMail
|
||||
module Components
|
||||
module Templates
|
||||
class PyramidSchemeTemplate < TemplateBase
|
||||
def self.template_name = "Pyramid Scheme"
|
||||
|
||||
def self.show_on_single? = true
|
||||
|
||||
def view_template
|
||||
image(
|
||||
image_path("pyramids.png"),
|
||||
at: [0, 288],
|
||||
width: 432,
|
||||
)
|
||||
|
||||
# Render speech bubble
|
||||
# image(
|
||||
# image_path(speech_bubble_image),
|
||||
# at: [speech_position[:x], speech_position[:y]],
|
||||
# width: speech_position[:width]
|
||||
# )
|
||||
|
||||
# Render return address
|
||||
render_return_address(10, 270, 130, 70, font: "gohu")
|
||||
|
||||
if letter.rubber_stamps.present?
|
||||
font("gohu") do
|
||||
text_box(
|
||||
letter.rubber_stamps,
|
||||
at: [ 7, 55 ],
|
||||
width: 250,
|
||||
height: 50,
|
||||
overflow: :shrink_to_fit,
|
||||
disable_wrap_by_char: true,
|
||||
min_size: 1,
|
||||
size: 10
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Render destination address in speech bubble
|
||||
render_destination_address(
|
||||
79.5,
|
||||
202,
|
||||
237,
|
||||
100,
|
||||
size: 16, valign: :bottom, align: :left, font: "gohu"
|
||||
)
|
||||
|
||||
# Render IMb barcode
|
||||
render_imb(78, 102, 237)
|
||||
|
||||
# Render QR code for tracking
|
||||
# render_qr_code(7, 67, 60)
|
||||
render_postage
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue