From 63a3b5e8727a0a40acd0c81e1d98eddfa4cb6cae Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 29 May 2018 18:16:05 +0100 Subject: [PATCH] Add claim call to action on unclaimed accounts --- app/scss/components.scss | 5 ++++- app/templates/flask_user/login.html | 2 +- app/templates/users/claim.html | 3 +-- app/templates/users/user_profile_page.html | 8 ++++++++ app/views/users.py | 2 +- setup.py | 1 + 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/scss/components.scss b/app/scss/components.scss index a8ec31a..36343ff 100644 --- a/app/scss/components.scss +++ b/app/scss/components.scss @@ -243,13 +243,16 @@ select:not([multiple]) { .alert .alert_right, .alert > form { display: inline-block; margin: 0; - padding: 0; position: absolute; top: 0; right: 0; bottom: 0; } +.alert .alert_right:not(.button) { + padding: 0; +} + .alert .alert_right form { height: 100%; } diff --git a/app/templates/flask_user/login.html b/app/templates/flask_user/login.html index 29f457d..ba5ce8c 100644 --- a/app/templates/flask_user/login.html +++ b/app/templates/flask_user/login.html @@ -71,7 +71,7 @@ Sign in

New here?

-

Create an account using your forum account.

+

Create an account using your forum account or email.

{%trans%}Claim your account{%endtrans%}
diff --git a/app/templates/users/claim.html b/app/templates/users/claim.html index 4f576e8..f561a89 100644 --- a/app/templates/users/claim.html +++ b/app/templates/users/claim.html @@ -11,8 +11,7 @@ Creating an Account

If you have a forum account, you'll need to prove that you own it - to get an account on ContentDB. You don't need a forum account to sign - up however. + to get an account on ContentDB.

{% if current_user.is_authenticated %} diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html index c1cdb00..304649e 100644 --- a/app/templates/users/user_profile_page.html +++ b/app/templates/users/user_profile_page.html @@ -6,6 +6,14 @@ {% block content %} +{% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %} +
+ Is this you? Claim your account now! + + Claim +
+{% endif %} +

{{ user.display_name }}

diff --git a/app/views/users.py b/app/views/users.py index 478596b..94fc30b 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -194,7 +194,7 @@ def user_claim_page(): user = User.query.filter_by(forums_username=username).first() if user is not None and user.rank.atLeast(UserRank.NEW_MEMBER): flash("That user has already been claimed!", "error") - return redirect(url_for("user_claim_page", username=username)) + return redirect(url_for("user_claim_page")) # Get signature sig = None diff --git a/setup.py b/setup.py index 5873067..c58136d 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ def defineDummyData(licenses, tags, ruben): jeija = User("Jeija") jeija.github_username = "Jeija" + jeija.forums_username = "Jeija" db.session.add(jeija)