From 00571b84cda007c9cc5b0fbdbd842e4859f5551a Mon Sep 17 00:00:00 2001
From: Ilyaaaaaaaaaaaaa Zhitomirskiy <ilya@joindiaspora.com>
Date: Fri, 29 Jul 2011 11:33:04 -0700
Subject: [PATCH] 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 b5171e8f55..2d2d092ec5 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 0000000000..472aa42a2b
--- /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 6577ffd9db..ddd115f98a 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 22cdb588ff..849621c8c3 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
zcmV<H02Kd=0<{8=7YYyv1^@s6AM^iVks&{S9TF2Ke>s-<0000PbVXQnLvL+uWo~o;
zLvm$dbY)~9cWHEJAV*0}P*;Ht7XSbNkV!;AR5;7s(=iS~Q4j^t<J0PFzy?$nq0p%`
z>c0dX8==!$1y-TcNpwoj*F1@c7vIzUNp2>SOy<tLnW1s9LG=XzXUw3JL2|$xI~<Ev
zi~(2dvB0$WLv9NpM?x24EHV7m#Cyyqj6RuotFiVLlT<_hg(Zc-`@|CMSXVLk5(Jk>
l@H9Wbs>bo8ux`NfJOBukI}OWePr(2H002ovPDHLkV1i)KVK4vy

delta 193
zcmV;y06zb<0*eBW7YYgp1^@s6y}sU@ks&{S92Ox9A0%PY0001sNkl<ZD9@eJtqlTE
z5Cq_lAB&>_8aPD}2pkH7rUV?<2skWN09D{{Bse6G!@Ns?@WS1jWU|?0GqXEcKCwgf
zhXGeCpszhnSmA(kH$&i#Bi5Mb2-N5x<eV_T6eY%5hWL#2g2}HC9}U*tW0o2iy}6_;
vSbQrk(TjZ*>o8$(iw1T00X7YuC&ldx3P(E)>X!`K00000NkvXXu0mjf*Aq)X

-- 
GitLab