diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-15 14:58:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-15 14:58:33 +0100 |
commit | 6f6b2ec6906c1fe0bb6ed2b66143f335b71d2023 (patch) | |
tree | b75efcc941e346115d5e0caddbcfd52a48371a64 /src/frontend | |
parent | ac2d14efbba4560bc5f20e532143852e84049970 (diff) | |
download | merchant-6f6b2ec6906c1fe0bb6ed2b66143f335b71d2023.tar.gz merchant-6f6b2ec6906c1fe0bb6ed2b66143f335b71d2023.tar.bz2 merchant-6f6b2ec6906c1fe0bb6ed2b66143f335b71d2023.zip |
merchant support for other currencies
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/index.php (renamed from src/frontend/index.html) | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/frontend/index.html b/src/frontend/index.php index e9cc9992..73884ce7 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.php @@ -1,10 +1,37 @@ <!DOCTYPE html> +<?php +require_once "config.php"; +?> <html lang="en"> <head> <title>Toy "Store" - Taler Demo</title> <link rel="stylesheet" type="text/css" href="style.css"> - <script src="taler-presence.js" type="text/javascript"> - </script> + <script src="taler-presence.js" type="text/javascript"></script> +<script type="text/javascript"> +<?php +echo "\tvar shop_currency = '$SHOP_CURRENCY';\n"; +?> + + function addOption(value, label) { + var s = document.getElementById("taler-donation"); + let e = document.createElement("option"); + e.textContent = label ? label : ("".concat(value, " ", shop_currency)); + e.value = value; + s.appendChild(e); + } + + function init() { + let e = document.getElementById("currency-input"); + e.value = shop_currency; + addOption("0.1"); + addOption("1.0"); + addOption("6.0", ("".concat(5, " ", shop_currency)); + addOption("10"); + } + + document.addEventListener("DOMContentLoaded", init); + +</script> </head> <body> @@ -107,12 +134,9 @@ <input type="radio" name="donation_receiver" value="GNUnet">GNUnet</input> <br> <select id="taler-donation" name="donation_amount"> - <option value="0.1">0.1 KUDOS</option> - <option value="1.0">1 KUDOS</option> - <option value="6.0">5 KUDOS (*)</option> - <option value="10.0">10 KUDOS</option> + <!-- options will be added dynamically --> </select> - <input type="hidden" name="donation_currency" value="KUDOS"/> + <input id="currency-input" type="hidden" name="donation_currency"/> <input type="submit" name="keyName" value="Donate!"/> <br> <br> |