From 24fed6824749fe4bde5349eb8783866bb2eed77c Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Thu, 28 Jul 2011 16:38:43 -0700 Subject: [PATCH 1/3] added the buttons --- app/views/aspects/index.html.haml | 24 ++++++++++++++++++++++++ public/images/icons/coffee.png | Bin 0 -> 267 bytes 2 files changed, 24 insertions(+) create mode 100644 public/images/icons/coffee.png diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index a0ef6f2c2..f1949cf81 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -81,3 +81,27 @@ = t('bookmarklet.heading') .content != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.explanation_link_text'), bookmarklet)) + + .section + .title + = image_tag('/images/icons/coffee.png') + %h5 + Donate + .content + Keep JoinDiaspora running fast, buy our servers coffee + = form_tag "https://www.paypal.com/cgi-bin/webscr", :method => 'post' do + = hidden_field_tag "cmd", "_s-xclick" + + = hidden_field_tag "hosted_button_id", "WPG875V39Y9RA" + = hidden_field_tag "on0", "Type" + = hidden_field_tag "modify" , "2" + + What monthly amount + %br + + = select_tag :os0, options_from_collection_for_select(["Caffee mocha : $3.00USD", "Caffee Americano : $5.00USD", "Box of Joe : $20.00USD"], "to_s", "to_s") + = hidden_field_tag "currency_code", "USD" + = submit_tag "Coffee!!" + / "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" +/= hidden_field_tag "cmd", "_s-xclick" + diff --git a/public/images/icons/coffee.png b/public/images/icons/coffee.png new file mode 100644 index 0000000000000000000000000000000000000000..ba9540216f5b3461550f8b5047fe201a2640b63c GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~g!3HGv?z=Y!NHG=%xjQkeJ16rJ$YD$Jc6VX; z4}uH!E}sk(;VkfoEM{Qf76xHPhFNnYfP(BLp1!W^x7lUH6uIS95-$OTx;DNumrLBD+WVn!(oS3wRLuI6PdGS@jQbV3 Date: Fri, 29 Jul 2011 11:07:38 -0700 Subject: [PATCH 2/3] the working button in diaspora --- app/views/aspects/index.html.haml | 20 +++----------------- app/views/shared/_donate.html | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 app/views/shared/_donate.html diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index f1949cf81..b5171e8f5 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -88,20 +88,6 @@ %h5 Donate .content - Keep JoinDiaspora running fast, buy our servers coffee - = form_tag "https://www.paypal.com/cgi-bin/webscr", :method => 'post' do - = hidden_field_tag "cmd", "_s-xclick" - - = hidden_field_tag "hosted_button_id", "WPG875V39Y9RA" - = hidden_field_tag "on0", "Type" - = hidden_field_tag "modify" , "2" - - What monthly amount - %br - - = select_tag :os0, options_from_collection_for_select(["Caffee mocha : $3.00USD", "Caffee Americano : $5.00USD", "Box of Joe : $20.00USD"], "to_s", "to_s") - = hidden_field_tag "currency_code", "USD" - = submit_tag "Coffee!!" - / "https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" -/= hidden_field_tag "cmd", "_s-xclick" - + Keep JoinDiaspora.com running fast, buy our servers their monthly coffee fix! + %br + = render 'shared/donate' diff --git a/app/views/shared/_donate.html b/app/views/shared/_donate.html new file mode 100644 index 000000000..1ede3255d --- /dev/null +++ b/app/views/shared/_donate.html @@ -0,0 +1,15 @@ + +
+ + + + + + + +
+ From 00571b84cda007c9cc5b0fbdbd842e4859f5551a Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Fri, 29 Jul 2011 11:33:04 -0700 Subject: [PATCH 3/3] completed donate option --- .../{shared/_donate.html => _donate.html.erb} | 0 app/views/aspects/index.html.haml | 19 +++++++++--------- app/views/shared/_donate.html.erb | 15 ++++++++++++++ config/application.yml.example | 2 ++ config/locales/diaspora/en.yml | 2 ++ public/images/icons/coffee.png | Bin 267 -> 309 bytes 6 files changed, 29 insertions(+), 9 deletions(-) rename app/views/{shared/_donate.html => _donate.html.erb} (100%) create mode 100644 app/views/shared/_donate.html.erb diff --git a/app/views/shared/_donate.html b/app/views/_donate.html.erb similarity index 100% rename from app/views/shared/_donate.html rename to app/views/_donate.html.erb diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index b5171e8f5..2d2d092ec 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -82,12 +82,13 @@ .content != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.explanation_link_text'), bookmarklet)) - .section - .title - = image_tag('/images/icons/coffee.png') - %h5 - Donate - .content - Keep JoinDiaspora.com running fast, buy our servers their monthly coffee fix! - %br - = render 'shared/donate' + - unless AppConfig[:paypal_hosted_button_id].blank? + .section + .title + = image_tag('/images/icons/coffee.png') + %h5 + = t('.donate') + .content + = t('.keep_us_running', :pod => URI.parse(AppConfig[:pod_url]).host) + %br + = render 'shared/donate' diff --git a/app/views/shared/_donate.html.erb b/app/views/shared/_donate.html.erb new file mode 100644 index 000000000..472aa42a2 --- /dev/null +++ b/app/views/shared/_donate.html.erb @@ -0,0 +1,15 @@ + +
+ + + + + + + +
+ diff --git a/config/application.yml.example b/config/application.yml.example index 6577ffd9d..ddd115f98 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -130,6 +130,8 @@ defaults: &defaults # Set this to true if you want to do everything synchronously instead of using resque, our redis-backed queue system. single_process_mode: true + # Use paypal for recurring donations + paypal_hosted_button_id: '' # Use this section to override default settings in specific environments development: diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 22cdb588f..849621c8c 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -147,6 +147,8 @@ en: family: "Family" work: "Work" index: + donate: "Donate" + keep_us_running: "Keep %{pod} running fast, buy our servers their monthly coffee fix!" your_aspects: "Your Aspects" tags_following: "Followed Tags" no_tags: "No tags" diff --git a/public/images/icons/coffee.png b/public/images/icons/coffee.png index ba9540216f5b3461550f8b5047fe201a2640b63c..978cd2a38754e2ff80dbc4212b484ce02010be4e 100644 GIT binary patch delta 235 zcmVs-<0000PbVXQnLvL+uWo~o; zLvm$dbY)~9cWHEJAV*0}P*;Ht7XSbNkV!;AR5;7s(=iS~Q4j^tc0dX8==!$1y-TcNpwoj*F1@c7vIzUNp2>SOy l@H9Wbs>bo8ux`NfJOBukI}OWePr(2H002ovPDHLkV1i)KVK4vy delta 193 zcmV;y06zb<0*eBW7YYgp1^@s6y}sU@ks&{S92Ox9A0%PY0001sNkl_8aPD}2pkH7rUV?<2skWN09D{{Bse6G!@Ns?@WS1jWU|?0GqXEcKCwgf zhXGeCpszhnSmA(kH$&i#Bi5Mb2-N5xo8$(iw1T00X7YuC&ldx3P(E)>X!`K00000NkvXXu0mjf*Aq)X