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 b5171e8f55483bc5d6f0468593f7f4ea61b14f96..2d2d092ec596c38f6629bfa37673540d1ab7a3a1 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 0000000000000000000000000000000000000000..472aa42a2b052b5354f3e4c2f12d79915fec987b --- /dev/null +++ b/app/views/shared/_donate.html.erb @@ -0,0 +1,15 @@ + +<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> +<input type="hidden" name="cmd" value="_s-xclick"> +<input type="hidden" name="hosted_button_id" value="<%= AppConfig[:paypal_hosted_button_id] %>"> +<input type="hidden" name="on0" value="Type"> +<input type="hidden" name="modify" value="2"> +<select name="os0"> + <option value="Mocha">Mocha : $3.00USD</option> + <option value="Americano">Americano : $5.00USD</option> + <option value="Box o' Joe">Box o' Joe : $20.00USD</option> +</select> +<input type="hidden" name="currency_code" value="USD"> +<input type="submit" name="submit" value="Donate"> +</form> + diff --git a/config/application.yml.example b/config/application.yml.example index 6577ffd9db3ec66683842b2caa9a16f6627bb50c..ddd115f98a4e09d2380b42b15fff7f00c49b56eb 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 22cdb588ffe76771912da15c626edb1a149a5f68..849621c8c362d2f7c07d1a2e6a92ddef5c79b997 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 Binary files a/public/images/icons/coffee.png and b/public/images/icons/coffee.png differ