mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 19:55:10 +00:00
Merge pull request #186 from hackclub/flavortown-letter-templates
This commit is contained in:
commit
05d1e8d17e
4 changed files with 105 additions and 0 deletions
BIN
app/lib/snail_mail/assets/images/flavortown/chefs.png
Normal file
BIN
app/lib/snail_mail/assets/images/flavortown/chefs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
app/lib/snail_mail/assets/images/flavortown/domain.png
Normal file
BIN
app/lib/snail_mail/assets/images/flavortown/domain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
|
|
@ -0,0 +1,53 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SnailMail
|
||||
module Components
|
||||
module Templates
|
||||
class FlavortownFreeStickersFulfillmentTemplate < TemplateBase
|
||||
def self.template_name
|
||||
"flavortown free stickers fulfillment"
|
||||
end
|
||||
|
||||
def self.template_description
|
||||
"Flavortown Free Stickers Fulfillment"
|
||||
end
|
||||
|
||||
def self.show_on_single?
|
||||
true
|
||||
end
|
||||
|
||||
def view_template
|
||||
# Add your template content here
|
||||
|
||||
# Example: Add an image
|
||||
image(
|
||||
image_path("flavortown/domain.png"),
|
||||
at: [ -2.5, 295 ],
|
||||
width: 443,
|
||||
)
|
||||
|
||||
# Render return address
|
||||
render_return_address(10, 278, 260, 70, size: 10)
|
||||
|
||||
# Render destination address
|
||||
render_destination_address(
|
||||
160,
|
||||
140,
|
||||
220,
|
||||
71,
|
||||
size: 14,
|
||||
valign: :bottom,
|
||||
align: :left
|
||||
)
|
||||
|
||||
# Render postal elements
|
||||
render_imb(240, 24, 183)
|
||||
render_qr_code(5, 115, 60)
|
||||
render_letter_id(10, 65, 10, rotate: 90)
|
||||
render_postage
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SnailMail
|
||||
module Components
|
||||
module Templates
|
||||
class FlavortownFulfillmentTemplate < TemplateBase
|
||||
def self.template_name
|
||||
"flavortown fulfillment"
|
||||
end
|
||||
|
||||
def self.template_description
|
||||
"Flavortown Fulfillment"
|
||||
end
|
||||
|
||||
def self.show_on_single?
|
||||
true
|
||||
end
|
||||
|
||||
def view_template
|
||||
|
||||
image(
|
||||
image_path("flavortown/chefs.png"),
|
||||
at: [46, 260],
|
||||
width: 340,
|
||||
)
|
||||
|
||||
# Render return address
|
||||
render_return_address(10, 278, 260, 70, size: 10)
|
||||
|
||||
# Render destination address
|
||||
render_destination_address(
|
||||
100,
|
||||
155,
|
||||
230,
|
||||
55,
|
||||
size: 12,
|
||||
valign: :center,
|
||||
align: :center
|
||||
)
|
||||
|
||||
# Render postal elements
|
||||
render_imb(240, 24, 183)
|
||||
render_qr_code(5, 65, 60)
|
||||
render_letter_id(10, 19, 10)
|
||||
|
||||
render_postage
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue