people: Add congratulations page for activating the new account
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Jun 2019 08:40:11 +0000 (09:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 Jun 2019 08:40:11 +0000 (09:40 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/auth/activated.html [new file with mode: 0644]
src/templates/donate/donate.html
src/web/auth.py
src/web/donate.py

index b3e2d55..f5d759c 100644 (file)
@@ -110,6 +110,7 @@ templatesdir = $(datadir)/templates
 
 templates_auth_DATA = \
        src/templates/auth/activate.html \
+       src/templates/auth/activated.html \
        src/templates/auth/login.html \
        src/templates/auth/register.html \
        src/templates/auth/register-success.html
diff --git a/src/templates/auth/activated.html b/src/templates/auth/activated.html
new file mode 100644 (file)
index 0000000..628ce06
--- /dev/null
@@ -0,0 +1,23 @@
+{% extends "../base.html" %}
+
+{% block title %}{{ _("Thank You for Activating Your Account") }}{% end block %}
+
+{% block content %}
+       <div class="row justify-content-center my-5">
+               <div class="col col-md-4 text-center">
+                       <h5>{{ _("Thank You for Activating Your Account") }}</h5>
+
+                       <p class="my-4">
+                               {{ _("To kick things off, would you like to setup a donation to the IPFire Project?") }}
+                       </p>
+
+                       <a class="btn btn-lg btn-block btn-primary mb-1" href="https://www.ipfire.org/donate?first_name={{ url_escape(account.first_name) }}&last_name={{ url_escape(account.last_name) }}">
+                               <span class="fas fa-heart"></span> {{ _("Donate Now") }}
+                       </a>
+
+                       <a class="text-secondary small" href="/">
+                               {{ _("No thanks, I have already donated") }}
+                       </a>
+               </div>
+       </div>
+{% end block %}
index f70856e..2f8980b 100644 (file)
                                                                                <div class="col-sm-6">
                                                                                        <div class="form-group">
                                                                                                <input type="text" class="form-control" name="first_name"
-                                                                                                       placeholder="{{ _("First Name" )}}" required>
+                                                                                                       placeholder="{{ _("First Name" )}}" required
+                                                                                                       {% if first_name %}value="{{ first_name }}"{% end %}>
                                                                                        </div>
                                                                                </div>
 
                                                                                <div class="col-sm-6">
                                                                                        <div class="form-group">
                                                                                                <input type="text" class="form-control" name="last_name"
-                                                                                                       placeholder="{{ _("Last Name" )}}" required>
+                                                                                                       placeholder="{{ _("Last Name" )}}" required
+                                                                                                       {% if last_name %}value="{{ last_name }}"{% end %}>
                                                                                        </div>
                                                                                </div>
                                                                        </div>
index b091a90..931a00a 100644 (file)
@@ -130,5 +130,5 @@ class ActivateHandler(AuthenticationMixin, base.BaseHandler):
                        # Create session
                        self.login(account)
 
-               # Redirect to main page
-               self.redirect("/")
+               # Redirect to success page
+               self.render("auth/activated.html", account=account)
index 2253610..b198666 100644 (file)
@@ -21,6 +21,8 @@ class DonateHandler(base.BaseHandler):
                        country = None
 
                # Get defaults
+               first_name = self.get_argument("first_name", None)
+               last_name = self.get_argument("last_name", None)
                amount    = self.get_argument_int("amount", None)
                currency  = self.get_argument("currency", None)
                frequency = self.get_argument("frequency", None)
@@ -38,7 +40,8 @@ class DonateHandler(base.BaseHandler):
                        frequency = "one-time"
 
                self.render("donate/donate.html", countries=iso3166.countries,
-                       country=country, amount=amount, currency=currency, frequency=frequency)
+                       country=country, first_name=first_name, last_name=last_name,
+                       amount=amount, currency=currency, frequency=frequency)
 
        @tornado.gen.coroutine
        def post(self):