From 5d2c2263579f171a907244473ec12522bdf6756a Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 5 Aug 2015 19:26:12 -0400 Subject: [PATCH] yum, new campaigns --- app/assets/images/campaigns/bird.gif | Bin 0 -> 7442 bytes app/assets/images/campaigns/hug.gif | Bin 0 -> 7068 bytes app/assets/javascripts/campaigns.js | 2 + app/assets/stylesheets/_layout.sass | 6 +- app/assets/stylesheets/application.css.sass | 2 +- app/assets/stylesheets/campaigns.css.scss | 3 + .../_donate.sass => campaigns/_show.sass} | 41 ++++++++++-- .../partials/_campaign-progress.sass | 15 +++-- app/assets/stylesheets/partials/_outfit.sass | 2 + app/controllers/campaigns_controller.rb | 20 ++++++ app/controllers/static_controller.rb | 5 -- app/helpers/campaigns_helper.rb | 2 + .../show.html.haml} | 61 ++---------------- app/views/donations/show.html.haml | 2 +- config/routes.rb | 4 +- ...0728192329_add_description_to_campaigns.rb | 5 ++ .../20150728195029_add_name_to_campaigns.rb | 6 ++ ...0150802202909_add_theme_id_to_campaigns.rb | 5 ++ db/schema.rb | 17 +++-- spec/controllers/campaigns_controller_spec.rb | 5 ++ spec/helpers/campaigns_helper_spec.rb | 15 +++++ 21 files changed, 134 insertions(+), 84 deletions(-) create mode 100644 app/assets/images/campaigns/bird.gif create mode 100644 app/assets/images/campaigns/hug.gif create mode 100644 app/assets/javascripts/campaigns.js create mode 100644 app/assets/stylesheets/campaigns.css.scss rename app/assets/stylesheets/{static/_donate.sass => campaigns/_show.sass} (71%) create mode 100644 app/controllers/campaigns_controller.rb create mode 100644 app/helpers/campaigns_helper.rb rename app/views/{static/donate.html.haml => campaigns/show.html.haml} (63%) create mode 100644 db/migrate/20150728192329_add_description_to_campaigns.rb create mode 100644 db/migrate/20150728195029_add_name_to_campaigns.rb create mode 100644 db/migrate/20150802202909_add_theme_id_to_campaigns.rb create mode 100644 spec/controllers/campaigns_controller_spec.rb create mode 100644 spec/helpers/campaigns_helper_spec.rb diff --git a/app/assets/images/campaigns/bird.gif b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6%#T447 z)VG2+&={B?N;L(ajnVXh>V(g5LSz8oms_3R_`F@77%0PlJ6=0L{jK~_gscy==F~a9 z%AIaedv->C1BA2b=ebpwC4FCbdv)o0j&vq!3Wh&wnz(Q+d2gq=(jAy`Zpek>t6mmw z|Ku5v5${HfPrTVt4ScgUs%e`lp0Q!8?A|WcwSP)e}*QS}o>43m%gQxcV81oIW)iX$xUeMUO$yUd7H zwZYotQl*%PSNxP&l=dnhOn{IV45eMm1l>k-kQ|ree z%X&1lTTgPj6gnt_d3S!0_%mKBpwveTR)y3xac}bd+ z7Gh2;rHE7KlQm--sBpBqbaPn2sn7L2fmy6)2?hSL*R3BW`j(%_D_@&28jzPxV4!X0 zE^m*X{hFkSGFNV>rBviBJUVs}H0l&;-fvWl&V2OkP00A*%ydxRXVE2Q^L+!Gya#K9 z@EKD_V;7sB9^a(^qnHj|qgA| 0 = campaign_progress(@campaign) do We've received #{number_to_currency(@campaign.progress / 100.0)} - toward our hosting costs this year. + toward #{@campaign.name}. Thanks so much! = 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] do + 'data-checkout-publishable-key' => Rails.configuration.stripe[:publishable_key], + 'data-campaign-theme' => @campaign.theme_id do = hidden_field_tag 'donation[stripe_token]' = hidden_field_tag 'donation[stripe_token_type]' = hidden_field_tag 'donation[donor_email]' @@ -25,58 +26,7 @@ = text_field_tag 'donation[amount]', '10.00' %button{:type => 'submit'} Donate now! -#success-thanks - :markdown - **Oh, wow! We've raised enough money for our 2014 hosting costs in less - than a week! Thanks a ton!** - - As it happens, we didn't have a fundraiser last year because I didn't have - the time or energy to ask for money properly—whoops. So, any further - donations will go toward last year's hosting costs that I paid out of - pocket, and will therefore help me have enough money to pay for college - ♥ - - And you'll still totally get featured here and on the homepage, too. - Thanks again for all your help! We're proud to be your Neopets fix during - the downtime - - -#description - :markdown - **Dress to Impress is cool!** We have loads of fancy features: y'all are - constantly adding models to our database, making NC trades, and saving your - outfits and sharing them across the interwebs. - It's pretty sweet, and we're super proud to have a community of users - consistently putting our resources to good use. - - **But cool features cost us money—about $800 a year.** We're running on a - [4GB Linode server][linode] for $40/mo, and y'all's fancy outfit thumbnails - live on [Amazon Web Services][aws] for about $25/mo (it varies by usage), - so that leaves us at about $65/mo. Add in $10 for the domain name and $10 - room to grow (our Amazon usage, and therefore costs, are on the rise), and - that comes to an annual budget of $800 USD. - - **So, we're here to ask for help.** If you have some spare change to send - our way, we'll gladly accept - - Thanks for helping Dress to Impress stay online and running smoothly! - - **And, to show our undying gratitude, we'll feature your outfits right - here!** Eeyup, for every $5 you send our way, we'll post one of your - beautiful outfits right here on the donors list, and feature it on the - homepage, too! Personally, I'm looking forward to seeing all your lovely - creations, and wishing I could make things even [half as pretty][matts_bat] - - (See the fine print at the bottom of the page for details.) - - **Thanks again for all your help.** Dress to Impress runs on you, from our - data to our servers. You make this site the great resource that it is, and - I'm consistently impressed by this community's generosity. Thanks for - all you do! - - [linode]: https://www.linode.com/pricing - [aws]: http://aws.amazon.com/ - [matts_bat]: http://www.neopets.com/petlookup.phtml?pet=matts_bat +#description= md @campaign.description - if @donations.present? %h2 Thanks to our lovely donors! @@ -97,6 +47,9 @@ %header Thanks, #{donation.donor_name.presence || 'Anonymous'}! +- if @campaign.active? + %p#last-years-donors= link_to "Don't forget to check out last year's donors, too!", Campaign.first + #fine-print %h2 Other ways to donate :markdown diff --git a/app/views/donations/show.html.haml b/app/views/donations/show.html.haml index f56a932d..7e23851e 100644 --- a/app/views/donations/show.html.haml +++ b/app/views/donations/show.html.haml @@ -14,7 +14,7 @@ %p %strong But enough about us. Let's talk about you! - When we brag about you on our #{link_to 'donors list', donate_path}, + 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.) diff --git a/config/routes.rb b/config/routes.rb index 613ad966..a0035b7c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,6 +86,9 @@ OpenneoImpressItems::Application.routes.draw do end end + resources :campaigns, only: [:show], path: '/donate/campaigns' + match '/donate' => 'campaigns#current', as: :donate + match 'users/current-user/closet' => 'closet_hangers#index', :as => :your_items match 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors @@ -94,7 +97,6 @@ OpenneoImpressItems::Application.routes.draw do match '/wardrobe' => 'outfits#edit', :as => :wardrobe match '/start/:color_name/:species_name' => 'outfits#start' - match '/donate' => 'static#donate', :as => :donate match 'image-mode' => 'static#image_mode', :as => :image_mode match '/terms' => 'static#terms', :as => :terms diff --git a/db/migrate/20150728192329_add_description_to_campaigns.rb b/db/migrate/20150728192329_add_description_to_campaigns.rb new file mode 100644 index 00000000..98f440ac --- /dev/null +++ b/db/migrate/20150728192329_add_description_to_campaigns.rb @@ -0,0 +1,5 @@ +class AddDescriptionToCampaigns < ActiveRecord::Migration + def change + add_column :campaigns, :description, :text, null: false, default: '' + end +end diff --git a/db/migrate/20150728195029_add_name_to_campaigns.rb b/db/migrate/20150728195029_add_name_to_campaigns.rb new file mode 100644 index 00000000..7df25bbd --- /dev/null +++ b/db/migrate/20150728195029_add_name_to_campaigns.rb @@ -0,0 +1,6 @@ +class AddNameToCampaigns < ActiveRecord::Migration + def change + # TODO: translations? + add_column :campaigns, :name, :string, null: false, default: 'our hosting costs this year' + end +end diff --git a/db/migrate/20150802202909_add_theme_id_to_campaigns.rb b/db/migrate/20150802202909_add_theme_id_to_campaigns.rb new file mode 100644 index 00000000..2d7aef80 --- /dev/null +++ b/db/migrate/20150802202909_add_theme_id_to_campaigns.rb @@ -0,0 +1,5 @@ +class AddThemeIdToCampaigns < ActiveRecord::Migration + def change + add_column :campaigns, :theme_id, :string, null: false, default: 'hug' + end +end diff --git a/db/schema.rb b/db/schema.rb index 2147294d..56a669ba 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150225194522) do +ActiveRecord::Schema.define(:version => 20150802202909) do create_table "auth_servers", :force => true do |t| t.string "short_name", :limit => 10, :null => false @@ -33,12 +33,15 @@ ActiveRecord::Schema.define(:version => 20150225194522) do add_index "campaign_translations", ["locale"], :name => "index_campaign_translations_on_locale" create_table "campaigns", :force => true do |t| - t.integer "progress", :null => false - t.integer "goal", :null => false - t.boolean "active", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "advertised", :default => true, :null => false + t.integer "progress", :null => false + t.integer "goal", :null => false + t.boolean "active", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "advertised", :default => true, :null => false + t.text "description", :null => false + t.string "name", :default => "our hosting costs this year", :null => false + t.string "theme_id", :default => "hug", :null => false end create_table "campaigns_old", :force => true do |t| diff --git a/spec/controllers/campaigns_controller_spec.rb b/spec/controllers/campaigns_controller_spec.rb new file mode 100644 index 00000000..3c06fcef --- /dev/null +++ b/spec/controllers/campaigns_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe CampaignsController do + +end diff --git a/spec/helpers/campaigns_helper_spec.rb b/spec/helpers/campaigns_helper_spec.rb new file mode 100644 index 00000000..76e29d3d --- /dev/null +++ b/spec/helpers/campaigns_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the CampaignsHelper. For example: +# +# describe CampaignsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe CampaignsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end