".format(
diff --git a/scripts/index.js b/scripts/index.js
index 34cf9b7..dd19977 100644
--- a/scripts/index.js
+++ b/scripts/index.js
@@ -91,12 +91,20 @@
var xhr = new XMLHttpRequest();
xhr.open("POST", "donate");
xhr.onload = function() {
- document.getElementById("donation-stuff").classList.add("hidden");
- document.getElementById("thanks").classList.remove("hidden");
var res = JSON.parse(this.responseText);
- if (res.new_account) {
- document.getElementById("new-donor-password").classList.remove("hidden");
- document.getElementById("reset-token").value = res.password_reset;
+ if (res.success) {
+ document.getElementById("donation-stuff").classList.add("hidden");
+ document.getElementById("thanks").classList.remove("hidden");
+ if (res.new_account) {
+ document.getElementById("new-donor-password").classList.remove("hidden");
+ document.getElementById("reset-token").value = res.password_reset;
+ }
+ } else {
+ var errors = document.getElementById("errors");
+ errors.classList.remove("hidden");
+ errors.querySelector("p").textContent = res.reason;
+ e.target.removeAttribute("disabled");
+ e.target.textContent = "Donate";
}
};
xhr.send(data);
diff --git a/templates/how-this-works.html b/templates/how-this-works.html
deleted file mode 100644
index d50a8ed..0000000
--- a/templates/how-this-works.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-Donations accumulate until they reach enough to support a week of full
-time work. Once they get to this amount, a week will be scheduled. The
-amount of time each project receives is planned based on the amount of
-donations received that specify that project in the drop-down.
-
-
-If one project receives a million dollars and another project receives
-one dollar, at least an hour will be spent on the second project.
-
diff --git a/templates/index.html b/templates/index.html
index 3cb61a3..99826a3 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -129,6 +129,9 @@ window.default_type = "{{ _cfg("default-type") }}";
diff --git a/templates/summary.html b/templates/summary.html
index 71df917..342bf9b 100644
--- a/templates/summary.html
+++ b/templates/summary.html
@@ -1,3 +1,9 @@
+{#
+ Try to keep this text short. Too long and it distracts from
+ the donation UI and will reduce the number of conversions you
+ actually get.
+#}
+
Donations accumulate until there's enough to fund one week of
full time development. The project you specify influences which