From 1b99f0124100c0db237e159f49d18f614587de5a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 9 Dec 2017 12:06:54 -0500 Subject: [PATCH] Make amounts configurable --- config.ini.example | 6 ++- templates/index.html | 103 +++++++++++++++++++------------------------ 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/config.ini.example b/config.ini.example index f2a0106..f998127 100644 --- a/config.ini.example +++ b/config.ini.example @@ -34,8 +34,10 @@ stripe-publish= # Click here first: https://dashboard.stripe.com/account/bitcoin/enable enable-bitcoin=no -# Pick between 5, 10, 20, or 50 -default-amount=10 +# Separate with spaces +default-amounts=3 5 10 20 +# Which one to pick when they arrive? +default-amount=5 # Pick between "monthly" and "once" default-type=monthly diff --git a/templates/index.html b/templates/index.html index f1d61b5..10b0fe8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -48,69 +48,56 @@ window.email = "{{user.email}}";
-

How much?

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
+

How much?

+
+
+
+ {% for amt in _cfg("default-amounts").split(" ") %} +
+
-
- -

How often?

-
-
- {% if _cfg("enable-bitcoin") == "yes" %} -

Bitcoin is only supported for one-time donations.

- {% endif %} -
-
-
- -
-
- -
-
-
+
+ +

How often?

+
+
+ {% if _cfg("enable-bitcoin") == "yes" %} +

Bitcoin is only supported for one-time donations.

+ {% endif %} +
+
+
+ +
+
+ +
+
+
+
+
{% if len(projects) > 1 %}

What project?