1
0
Fork 0
forked from OpenNeo/impress
impress/app/views/fundraising/donations/show.html.haml
Emi Matchu c011e99819 Fix various JS Turbo issues
First one, Turbo reasonably yelled at us in the JS console that we
should put its script tag in the `head` rather than the `body`, because
it re-executes scripts in the `body` and we don't want to spin up Turbo
multiple times!

I also removed some scripts that aren't relevant anymore, fixed a bug
in `outfits/new.js` where failing to load a donation pet would cause
the preview thing to not work when you type (I think this might've
already been an issue?), reworked `item_header.js` to just run once in
the `head`, and split scripts into `:javascripts` (run once in `head`)
vs `:javascripts_body` (run every page load in `body`).
2024-03-13 21:26:22 -07:00

51 lines
1.8 KiB
Text

- title "Thanks for donating!"
= image_tag thank_you_greeting_url, id: 'thank-you',
alt: '"Thank You" Neogreeting'
%p
%strong Thanks so much!
That's another
= number_to_currency(@donation.amount.to_f / 100)
toward this year's bills—thanks!
Your support keeps Dress to Impress online and running smoothly,
and we really, truly couldn't do this without you.
Do you feel the love? Because we do <3
%p
%strong But enough about us. Let's talk about you!
When we brag about you on our #{link_to 'donors list', @donation.campaign},
what should we say?
(If you'd rather take care of this later, no worries!
Check your email for a copy of this URL.)
= form_for @donation, html: {id: 'edit-donation'} do |f|
%ul
%li.name
= f.label :donor_name, "Your name on the donors list"
= f.text_field :donor_name, placeholder: 'Anonymous'
- @features.each do |feature|
%li.feature
= label_tag "feature[#{feature.id}][outfit_url]", "Featured outfit URL"
= text_field_tag "feature[#{feature.id}][outfit_url]",
feature_outfit_url(feature.outfit_id),
placeholder: outfit_url(12345678)
- if user_signed_in?
%span.choose-outfit
= surround '(', ')' do
or choose
= select_tag "feature[#{feature.id}][user_outfits]",
options_for_select(@outfits.map { |o| [o.name, outfit_url(o)] },
feature_outfit_url(feature.outfit_id)),
include_blank: true
= f.submit 'Save donation details'
- content_for :javascripts do
= include_javascript_libraries :jquery
- content_for :javascripts_body do
= javascript_include_tag 'fundraising/donations/show', defer: true
- content_for :stylesheets do
= stylesheet_link_tag 'fundraising/donations/show'