aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-13 23:31:42 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-13 23:33:05 +0100
commitff8bf992a9048e55b58ece46cf25cc3a43edcef7 (patch)
tree02a1a7198a9fd20539465a0ccd378f0dd02f8913 /app/templates
parent31615da169766087a35c104d6aa8797a6eaa7594 (diff)
downloadcheatdb-ff8bf992a9048e55b58ece46cf25cc3a43edcef7.tar.xz
Add user account claiming
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/flask_user/login.html17
-rw-r--r--app/templates/users/claim.html98
2 files changed, 102 insertions, 13 deletions
diff --git a/app/templates/flask_user/login.html b/app/templates/flask_user/login.html
index c19f1f3..c676aca 100644
--- a/app/templates/flask_user/login.html
+++ b/app/templates/flask_user/login.html
@@ -61,26 +61,17 @@ Sign in
{# Submit button #}
{{ render_submit_field(form.submit, tabindex=180) }}
</form>
+
+ <a href="{{ url_for('github_signin_page') }}">GitHub</a>
</div>
<div class="right">
<aside class="box box_grey">
<h2>New here?</h2>
- <div class="box box_grey alert alert-error">
- Please use Github login instead!
- </div>
-
- {% if user_manager.enable_register and not user_manager.require_invitation %}
- <a href="{{ url_for('github_signin_page') }}">{%trans%}Create an account{%endtrans%}</a>
- {% endif %}
- </aside>
+ <p>Create an account using your forum account.</p>
-
- <aside class="box box_grey">
- <h2>OAUTH</h2>
-
- <a href="{{ url_for('github_signin_page') }}">GitHub</a>
+ <a href="{{ url_for('user_claim_page') }}" class="button">{%trans%}Claim your account{%endtrans%}</a>
</aside>
</div>
</div>
diff --git a/app/templates/users/claim.html b/app/templates/users/claim.html
new file mode 100644
index 0000000..f4333d9
--- /dev/null
+++ b/app/templates/users/claim.html
@@ -0,0 +1,98 @@
+{% extends "base.html" %}
+
+{% block title %}
+Verify forum account
+{% endblock %}
+
+{% block content %}
+ <div class="box box_grey">
+ <h2>{{ self.title() }}</h2>
+
+ <p>
+ Create an account by linking it to your forum account and optionally
+ your github account.
+ </p>
+
+ {% if current_user.is_authenticated %}
+ <p>
+ Please log out to continue.
+ </p>
+ <p>
+ <a href="{{ url_for('user.logout', next=url_for('user_claim_page')) }}" class="button">Logout</a>
+ </p>
+ {% else %}
+ <p>
+ <b>Don't have a forum account?</b>
+ Unfortunately, you need a forum account to register.
+ This is because you also need to create forum topics for any packages
+ you may upload.
+ </p>
+
+ <a href="https://forum.minetest.net/ucp.php?mode=register">
+ Create a Forum Account
+ </a>
+ {% endif %}
+ </div>
+
+ {% if not current_user.is_authenticated %}
+ <div class="box box_grey">
+ <h2>Option 1 - Use GitHub field in forum profile</h2>
+
+ <form method="post" action="{{ url_for('user_claim_page') }}">
+ <input type="hidden" name="claim_type" value="github">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+
+ <p>
+ Enter your forum username here:
+ </p>
+
+ <input type="text" name="username" value="{{ username }}" required placeholder="Forum username">
+
+ <p>
+ You'll need to have the GitHub field in your forum profile
+ filled out. Log into the forum and
+ <a href="https://forum.minetest.net/ucp.php?i=173">
+ do that here</a>.
+ </p>
+
+ <input type="submit" value="Next: log in with GitHub">
+ </form>
+ </div>
+
+ <!--<div class="box box_grey">
+ <h2>Option 2 - Paste verification token into signature</h2>
+
+ <form method="post" action="{{ url_for('user_claim_page') }}">
+ <input type="hidden" name="claim_type" value="forum">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+
+ <p>
+ Enter your forum username here:
+ </p>
+
+ <input type="text" name="username" value="{{ username }}" required placeholder="Forum username">
+
+ <p>
+ Go to
+ <a href="https://forum.minetest.net/ucp.php?i=profile&mode=signature">
+ User Control Panel > Profile > Edit signature
+ </a>
+ </p>
+ <p>
+ Paste this into your signature:
+ </p>
+
+ <input type="text" value="{{ key }}" readonly size=32>
+
+ <p>
+ Click next so we can check it.
+ </p>
+ <p>
+ Don't worry, you can remove it after this is done.
+ </p>
+
+ <input type="submit" value="Next">
+ </form>
+ </div>-->
+ {% endif %}
+{% endblock %}