diff --git a/app/views/shared/_donatepod.html.haml b/app/views/shared/_donatepod.html.haml index 1281ff602..fa0d815ef 100644 --- a/app/views/shared/_donatepod.html.haml +++ b/app/views/shared/_donatepod.html.haml @@ -1,11 +1,17 @@ -%form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post"} - %input{:name => "cmd", :type => "hidden", :value => "_s-xclick"} - %input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig.settings.paypal_hosted_button_id} - %input{:name => "on0", :type => "hidden", :value => "Type"} - %input{:name => "modify", :type => "hidden", :value => "2"} - %select{:name => "os0"} - %option{:value => "Mocha"} Mocha : $3.00USD - %option{:value => "Americano"} Americano : $5.00USD - %option{:value => "Box o' Joe"} Box o' Joe : $20.00USD - %input{:name => "currency_code", :type => "hidden", :value => "USD"} - %input{:name => "submit", :type => "submit", :value => t('aspects.index.donate')} +- if AppConfig.settings.paypal_hosted_button_id.present? + PayPal: + %form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post"} + %input{:name => "cmd", :type => "hidden", :value => "_s-xclick"} + %input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig.settings.paypal_hosted_button_id} + %input{:name => "on0", :type => "hidden", :value => "Type"} + %input{:name => "modify", :type => "hidden", :value => "2"} + %select{:name => "os0"} + %option{:value => "Mocha"} Mocha : $3.00USD + %option{:value => "Americano"} Americano : $5.00USD + %option{:value => "Box o' Joe"} Box o' Joe : $20.00USD + %input{:name => "currency_code", :type => "hidden", :value => "USD"} + %input{:name => "submit", :type => "submit", :value => t('aspects.index.donate')} +- if AppConfig.settings.bitcoin_wallet_id.present? + Bitcoin: + %input{:type => "text", :id => "bitcoin_address", :value => AppConfig.settings.bitcoin_wallet_id, :readonly => true} + \ No newline at end of file diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 4e62a939c..17091f6b0 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -67,7 +67,7 @@ .content != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.post_something'), magic_bookmarklet_link)) -- if AppConfig.settings.paypal_hosted_button_id.present? +- if AppConfig.settings.paypal_hosted_button_id.present? || AppConfig.settings.bitcoin_wallet_id.present? .section .title .icons-coffee diff --git a/config/defaults.yml b/config/defaults.yml index 5ab5f71ae..1717e53fc 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -59,6 +59,7 @@ defaults: open: true count: 25 paypal_hosted_button_id: + bitcoin_wallet_id: community_spotlight: enable: false suggest_email: diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index 18c1ff3fd..21d8ebe9d 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -233,6 +233,11 @@ configuration: ## Section ## we kindly ask your users to donate to the Diaspora Foundation :) #paypal_hosted_button_id: "" + ## Bitcoin donations + ## You can provide the bitcoin address here to kindly ask + ## your users for donations to run their pod. + #bitcoin_wallet_id: "" + ## Community Spotlight ## The community spotlight gives new users a starting point on who ## could be interesting Diasporas community. To add a person diff --git a/features/donations.feature b/features/donations.feature new file mode 100644 index 000000000..1397681ca --- /dev/null +++ b/features/donations.feature @@ -0,0 +1,16 @@ +@javascript +Feature: donations + In order to accept donation + As a podmin + I want a donation box shown on the stream page + + Background: + Given following user exists: + | username | email | + | Alice | alice@alice.alice | + And I sign in as "alice@alice.alice" + + Scenario: Bitcoin donations + Given I have configured a Bitcoin wallet + And I am on the home page + Then I should see the Bitcoin wallet ID \ No newline at end of file diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 858941670..042aea251 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -308,3 +308,11 @@ end When /^I focus the "([^"]+)" field$/ do |field| find_field(field).click end + +Given /^I have configured a Bitcoin wallet$/ do + AppConfig.settings.bitcoin_wallet_id = "AAAAAA" +end + +Then /^I should see the Bitcoin wallet ID$/ do + find("#bitcoin_address")['value'].should == "AAAAAA" +end