1
0
Fork 0
forked from OpenNeo/impress
impress/app/views/fundraising/campaigns/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

127 lines
5.5 KiB
Text

- title "Support Dress to Impress"
- if @current_campaign.progress > 0
= campaign_progress(@current_campaign) do
We've received #{cents_to_currency(@current_campaign.progress)}
toward #{@current_campaign.purpose}.
Thanks so much!
-# TODO: Reinstall Stripe before showing the checkout form
= form_tag donations_path, method: 'POST', id: 'donation-form',
'data-checkout-image' => image_path('default_preview.png'),
'data-checkout-publishable-key' => Rails.configuration.stripe[:publishable_key],
'data-campaign-theme' => @current_campaign.theme_id do
= hidden_field_tag 'donation[stripe_token]'
= hidden_field_tag 'donation[stripe_token_type]'
= hidden_field_tag 'donation[donor_email]'
= hidden_field_tag 'donation[amount]'
%header
%p#donation-form-title
Thanks for supporting Dress to Impress!
%p
From modeling to servers, Dress to Impress is a community effort.
This year, we need to raise
#{cents_to_currency(@current_campaign.goal, precision: 0)}
to cover our #{@current_campaign.name} hosting costs.
%p
As a thank-you gift, for every $5 you give, we'll feature one of your
outfits here and on the homepage. Show off your latest designs!
%p
All donations are securely powered by
#{link_to 'Stripe', 'https://stripe.com/'}, and go directly toward our
hosting costs. Thank you for your help!
#donation-fields
#amount-header Amount
#amount-choices
%li
%input#amount-5{type: 'radio', name: 'amount', value: '5.00'}
%label{for: 'amount-5'} $5
%li
%input#amount-10{type: 'radio', name: 'amount', value: '10.00'}
%label{for: 'amount-10'} $10
%li
%input#amount-30{type: 'radio', name: 'amount', value: '20.00', checked: true}
%label{for: 'amount-30'} $20
%li
%input#amount-50{type: 'radio', name: 'amount', value: '50.00'}
%label{for: 'amount-50'} $50
%li
%input#amount-custom{type: 'radio', name: 'amount', value: 'custom'}
%label{for: 'amount-custom'} Other
%label#amount-custom-fields{for: 'amount-custom-value'}
%input#amount-custom-value{type: 'text'}
#donation-controls
%button{type: 'submit'} Donate now!
- if @donations.present?
#outfits-header
%h2 Thanks to our lovely donors!
- if @all_campaigns.length > 1
%ul#all-campaigns-list
- @all_campaigns.each do |campaign|
%li
- if campaign == @campaign
%strong= campaign.name
- else
= link_to campaign.name, campaign
%ul#outfits
- @donations.each do |donation|
-# if large_donation?(donation.amount)
%li.banner
%span
Thanks, #{donation.donor_name}, for donating
#{number_to_currency(donation.amount / 100.0)}!
- donation.features.each do |feature|
- if outfit_image?(feature.outfit) || !large_donation?(donation.amount)
%li
- if outfit_image?(feature.outfit)
= link_to image_tag(feature.outfit.image.small.url), feature.outfit
- else
= image_tag 'default_preview.png'
%header Thanks, #{donation.donor_name.presence || 'Anonymous'}!
- else
- current_index = @all_campaigns.index(@campaign)
- prev_campaign = @all_campaigns[current_index + 1]
- if prev_campaign
%p#last-years-donors= link_to "Don't forget to check out last year's donors, too!", prev_campaign
#fine-print
%h2 Some notes on featured outfits
:markdown
**TL;DR: We love to help and acknowledge our good-faith donors,
but reserve the right not to do those things,
in order to better handle bad-faith donors and unexpected circumstances.**
#{image_tag 'emoticons/smiley.gif'}
When you make a donation, we'll divide the amount by $5 USD, and, rounding
down, that's how many of your outifts we'll feature. This is our way of
publicly thanking our donors, and we love doing it! However, it is not a
purchased service. Your outfit is not guaranteed to appear anywhere on the
site, for any amount of time. (That said, our donors' outfits generally
appear on the site very quickly, and we plan to continue to showcase them
for as long as the site stays up!)
We reserve the right to refuse to post any content for any reason, and we
reserve the right to remove any previously posted content at any time for
any reason. If we we're not comfortable with the outfit's name, the
outfit's appearance, or the name on your donation, or anything else, then
we might choose not to publish it.
(That said, we plan to allow any name and outfit that are appropriate for
Neopians of all ages.)
If you change your mind about donating, no worries: you can request a
refund at any time #{image_tag 'emoticons/smiley.gif'} If it's within 30
days of when you donated, then we promise to refund your donation as soon
as we can. If it's been longer, we're a bit more limited in what we can do,
but we'll try our best to help! Additionally, if we remove your outfit
because we didn't feel comfortable showcasing it, then we may choose not to
issue a refund, regardless of when you ask. (Sorry for the extra
complexity, but this exception helps us discourage bad behavior.)
We also accept donations via PayPal.
#{mail_to 'webmaster@openneo.net', "Please email us for more information."}
Thank you!!
- content_for :stylesheets do
= stylesheet_link_tag 'fundraising/campaigns/show'