Make amounts configurable

master
Drew DeVault 7 years ago
parent c7f57856ce
commit 1b99f01241
  1. 6
      config.ini.example
  2. 31
      templates/index.html

@ -34,8 +34,10 @@ stripe-publish=
# Click here first: https://dashboard.stripe.com/account/bitcoin/enable # Click here first: https://dashboard.stripe.com/account/bitcoin/enable
enable-bitcoin=no enable-bitcoin=no
# Pick between 5, 10, 20, or 50 # Separate with spaces
default-amount=10 default-amounts=3 5 10 20
# Which one to pick when they arrive?
default-amount=5
# Pick between "monthly" and "once" # Pick between "monthly" and "once"
default-type=monthly default-type=monthly

@ -52,26 +52,13 @@ window.email = "{{user.email}}";
<div class="row"> <div class="row">
<div class="col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2">
<div class="btn-group btn-group-justified amounts" role="group" aria-label="..."> <div class="btn-group btn-group-justified amounts" role="group" aria-label="...">
{% for amt in _cfg("default-amounts").split(" ") %}
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button data-amount="5" type="button" <button data-amount="{{ amt }}" type="button"
class="btn btn-default {{"active" if _cfgi("default-amount") == 5 else ""}}"> class="btn btn-default {{"active" if _cfg("default-amount") == amt else ""}}"
$5</button> >${{ amt }}</button>
</div>
<div class="btn-group" role="group">
<button data-amount="10" type="button"
class="btn btn-default {{"active" if _cfgi("default-amount") == 10 else ""}}">
$10</button>
</div>
<div class="btn-group" role="group">
<button data-amount="20" type="button"
class="btn btn-default {{"active" if _cfgi("default-amount") == 20 else ""}}">
$20</button>
</div>
<div class="btn-group" role="group">
<button data-amount="50" type="button"
class="btn btn-default {{"active" if _cfgi("default-amount") == 50 else ""}}">
$50</button>
</div> </div>
{% endfor %}
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button data-amount="custom" type="button" class="btn btn-default">Custom</button> <button data-amount="custom" type="button" class="btn btn-default">Custom</button>
</div> </div>
@ -99,13 +86,13 @@ window.email = "{{user.email}}";
<div class="btn-group btn-group-justified frequencies" role="group" aria-label="..."> <div class="btn-group btn-group-justified frequencies" role="group" aria-label="...">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button data-frequency="once" type="button" <button data-frequency="once" type="button"
class="btn btn-default {{"active" if _cfg("default-type")=="once" else ""}}"> class="btn btn-default {{"active" if _cfg("default-type")=="once" else ""}}"
Once</button> >Once</button>
</div> </div>
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button data-frequency="monthly" type="button" <button data-frequency="monthly" type="button"
class="btn btn-default {{"active" if _cfg("default-type")=="monthly" else ""}}"> class="btn btn-default {{"active" if _cfg("default-type")=="monthly" else ""}}"
Monthly</button> >Monthly</button>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save