mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 19:55:10 +00:00
add som magic happening
This commit is contained in:
parent
eac12782ab
commit
e7db15331d
5 changed files with 57 additions and 0 deletions
BIN
app/lib/snail_mail/assets/images/hotdogcat.jpg
Normal file
BIN
app/lib/snail_mail/assets/images/hotdogcat.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
BIN
app/lib/snail_mail/assets/images/magic_smoke.png
Normal file
BIN
app/lib/snail_mail/assets/images/magic_smoke.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
app/lib/snail_mail/assets/images/wizard.png
Normal file
BIN
app/lib/snail_mail/assets/images/wizard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 585 KiB |
|
|
@ -0,0 +1,56 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SnailMail
|
||||
module Components
|
||||
module Templates
|
||||
class SoMMagicHappening < HalfLetterComponent
|
||||
IMAGES = %w(wizard.png hotdogcat.jpg magic_smoke.png)
|
||||
|
||||
def self.abstract? = false
|
||||
|
||||
def address_font = "gohu"
|
||||
|
||||
def self.template_name = "SoM Magic Happening"
|
||||
|
||||
def self.template_size = :half_letter
|
||||
|
||||
def self.show_on_single? = false
|
||||
|
||||
def render_front
|
||||
image(
|
||||
image_path(IMAGES.sample),
|
||||
at: [410, bounds.bottom + 200],
|
||||
valign: :top,
|
||||
width: 150
|
||||
)
|
||||
|
||||
meta = letter.metadata || {}
|
||||
project = (proj = meta["project"]).present? ? "#{proj} " : nil
|
||||
reviewer = meta["reviewer"].presence || "your secret admirer"
|
||||
text = <<~EOM
|
||||
Dearest #{letter.address&.first_name&.titleize},
|
||||
|
||||
We wanted to send out a little personal thank you, just to say that your project #{project}really struck a chord with us at HQ.
|
||||
|
||||
We love to see real creativity and people building with passion, and we think you're doing an amazing job!
|
||||
|
||||
Many thanks & keep hacking!
|
||||
|
||||
<3 ~#{reviewer}
|
||||
|
||||
|
||||
|
||||
|
||||
tl;dr: TS cool!
|
||||
EOM
|
||||
|
||||
font "gohu" do text_box text, at: [15, bounds.top-15], width: bounds.right - 200 - 20, size: 14 end
|
||||
end
|
||||
|
||||
def render_back
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -36,4 +36,5 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|||
inflect.acronym "QZ"
|
||||
inflect.acronym "OTP"
|
||||
inflect.acronym "ETL"
|
||||
inflect.acronym "SoM"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue