[git] gnupg-doc - branch, preview, updated. dbfe80a372ea43c9ad3f143676c83de5b5079629

by Werner Koch cvs at cvs.gnupg.org
Tue May 16 18:19:47 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GnuPG website and other docs".

The branch, preview has been updated
       via  dbfe80a372ea43c9ad3f143676c83de5b5079629 (commit)
      from  b69f055cb8abaea19e60ca47e07d25b98712b6ef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dbfe80a372ea43c9ad3f143676c83de5b5079629
Author: Werner Koch <wk at gnupg.org>
Date:   Tue May 16 18:16:30 2017 +0200

    cgi: Allow presetting of amount, currency and paytype.

diff --git a/cgi/procdonate.cgi b/cgi/procdonate.cgi
index 15d1dd9..46fc0dd 100755
--- a/cgi/procdonate.cgi
+++ b/cgi/procdonate.cgi
@@ -1013,6 +1013,7 @@ elsif ($mode eq 'preset') {
     $currency = 'EUR';
     $recur = '12';
     $paytype = 'cc';
+    # First dedicated payment plans.
     if ($q->param('plan') eq '12-5-eur' ) {
         $amount = '5';
     }
@@ -1025,14 +1026,18 @@ elsif ($mode eq 'preset') {
     elsif ($q->param('plan') eq '12-50-eur' ) {
         $amount = '50';
     }
-    elsif ($q->param('plan') eq '12-100-eur' ) {
-        $amount = '100';
-    }
-    elsif ($q->param('plan') eq '12-200-eur' ) {
-        $amount = '200';
-    }
-    elsif ($q->param('plan') eq '12-500-eur' ) {
-        $amount = '500';
+    else {
+        # Then look at arbitrary values
+        # No checking needed.
+        if ($q->param('s_amount') ne '') {
+            $amount = int $q->param('s_amount');
+        }
+        if ($q->param('s_currency') ne '') {
+            $currency = $q->param('s_currency');
+        }
+        if ($q->param('s_paytype') ne '') {
+            $paytype = $q->param('s_paytype');
+        }
     }
 
     write_main_page();
diff --git a/web/donate/donate.org b/web/donate/donate.org
index 05cb3e8..67231c6 100644
--- a/web/donate/donate.org
+++ b/web/donate/donate.org
@@ -1,3 +1,4 @@
+#                                                       -*- html -*-
 #+TITLE: GnuPG - Donate
 #+STARTUP: showall
 #+SETUPFILE: "../share/setup.inc"
@@ -71,40 +72,47 @@
       <!-- Predefined amounts -->
       <div class="form-group">
         <label for="inputType" class="col-md-2 control-label">
-					Amount <!--ERR_AMOUNT-->
-				</label>
-				<div class="col-md-3">
-					<input type="text" class="form-control"
-								 name="amountother" id="amountother" placeholder=""
-								 value=""/><!--AMOUNT-->
-				</div>
-				<div class="col-md-2">
-					<select class="form-control" name="currency" id="currency">
-						<option value="EUR" selected="selected"><!--SEL_EUR-->Euro</option>
-						<option value="USD" ><!--SEL_USD-->US Dollar</option>
-						<option value="GBP" ><!--SEL_GBP-->British Pound</option>
-						<option value="JPY" ><!--SEL_JPY-->Yen</option>
-					</select>
-				</div>
-			</div>
+          Amount <!--ERR_AMOUNT-->
+        </label>
+        <div class="col-md-3">
+          <input type="text" class="form-control"
+                 name="amountother" id="amountother" placeholder=""
+                 value=""/><!--AMOUNT-->
+        </div>
+        <div class="col-md-2">
+          <select class="form-control" name="currency" id="currency">
+            <option value="EUR" selected="selected"><!--SEL_EUR-->Euro</option>
+            <option value="USD" ><!--SEL_USD-->US Dollar</option>
+            <option value="GBP" ><!--SEL_GBP-->British Pound</option>
+            <option value="JPY" ><!--SEL_JPY-->Yen</option>
+          </select>
+        </div>
+      </div>
 
-			<!-- Custom amounts -->
-			<div class="form-group">
-				<div class="col-md-offset-2 col-md-6">
-					<div class="btn-group" role="group" aria-label="suggested amounts">
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-500-eur" class="btn btn-default">500 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-200-eur" class="btn btn-default">200 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-100-eur" class="btn btn-default">100 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-50-eur" class="btn btn-default">50 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-20-eur" class="btn btn-default">20 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-10-eur" class="btn btn-default">10 €</a>
-						<a href="https://preview.gnupg.org/cgi-bin/procdonate.cgi?mode=preset;plan=12-5-eur" class="btn btn-default">5 €</a>
-					</div>
-					<span class="help-block">
-						Suggested amounts.
-					</span>
-				</div>
-			</div>
+      <!-- Custom amounts -->
+      <div class="form-group">
+        <div class="col-md-offset-2 col-md-6">
+          <div class="btn-group" role="group" aria-label="suggested amounts">
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=500"
+               class="btn btn-default">500&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=200"
+               class="btn btn-default">200&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=100"
+               class="btn btn-default">100&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=50"
+               class="btn btn-default">50&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=20"
+               class="btn btn-default">20&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=10"
+               class="btn btn-default">10&#x202f;€</a>
+            <a href="/cgi-bin/procdonate.cgi?mode=preset&s_amount=5"
+               class="btn btn-default">5&#x202f;€</a>
+          </div>
+          <span class="help-block">
+            Suggested amounts.
+          </span>
+        </div>
+      </div>
 
       <!-- Recurring -->
       <div class="form-group">
@@ -123,8 +131,8 @@
       <!-- Pay using -->
       <div class="form-group">
         <label for="paytype" class="col-md-2 control-label">
-					Pay using <!--ERR_PAYTYPE-->
-				</label>
+          Pay using <!--ERR_PAYTYPE-->
+        </label>
         <div class="col-md-6">
           <div class="radio">
             <label>

-----------------------------------------------------------------------

Summary of changes:
 cgi/procdonate.cgi    | 21 ++++++++------
 web/donate/donate.org | 78 ++++++++++++++++++++++++++++-----------------------
 2 files changed, 56 insertions(+), 43 deletions(-)


hooks/post-receive
-- 
The GnuPG website and other docs
http://git.gnupg.org




More information about the Gnupg-commits mailing list