From a7d22973ff12c6117e70fb0486c66bf510e62325 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 16 Nov 2019 00:05:59 +0000 Subject: Fix user profile after blueprints commit --- app/blueprints/users/profile.py | 2 +- app/templates/users/profile.html | 205 +++++++++++++++++++++++++++++ app/templates/users/user_profile_page.html | 205 ----------------------------- 3 files changed, 206 insertions(+), 206 deletions(-) create mode 100644 app/templates/users/profile.html delete mode 100644 app/templates/users/user_profile_page.html diff --git a/app/blueprints/users/profile.py b/app/blueprints/users/profile.py index fd8d7d9..a3c592c 100644 --- a/app/blueprints/users/profile.py +++ b/app/blueprints/users/profile.py @@ -108,7 +108,7 @@ def profile(username): .all() # Process GET or invalid POST - return render_template("users/users.profile.html", + return render_template("users/profile.html", user=user, form=form, packages=packages, topics_to_add=topics_to_add) diff --git a/app/templates/users/profile.html b/app/templates/users/profile.html new file mode 100644 index 0000000..d1edf54 --- /dev/null +++ b/app/templates/users/profile.html @@ -0,0 +1,205 @@ +{% extends "base.html" %} + +{% block title %} + {{ user.username }} +{% endblock %} + +{% block content %} + +{% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %} +
+ Claim + + Is this you? Claim your account now! +
+{% endif %} + +
+
+
+

{{ user.display_name }}

+
+ +
+ + + + + + + + + + {% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.MODERATOR) %} + + + + + {% endif %} + {% if user == current_user %} + + + + + + + + + {% endif %} +
Rank: + {{ user.rank.getTitle() }} +
Links: + {% if user.forums_username %} + + Minetest Forum + + {% elif user == current_user %} + No forum account + {% endif %} + + {% if user.github_username or user == current_user %} + | + {% endif %} + + {% if user.github_username %} + GitHub + {% elif user == current_user %} + Link Github + {% endif %} + + {% if user.website_url %} + | Website + {% endif %} + + {% if user == current_user %} +
+ + 🌎 + Visible to everyone + + {% endif %} +
Admin + {% if user.email %} + + Email + + {% else %} + + Email + + {% endif %} +
Profile Picture: + {% if user.forums_username %} +
+ + +
+ {% endif %} + {% if user.email %} + + Gravatar + + {% else %} + + Gravatar + + {% endif %} +
Password: + {% if user.password %} + Set | Change + {% else %} + Not set | Set + {% endif %} +
+
+
+
+
+ +{% if form %} + {% from "macros/forms.html" import render_field, render_submit_field %} +
+
+
Edit Details
+
+
+ {{ form.hidden_tag() }} + + {% if user.checkPerm(current_user, "CHANGE_DNAME") %} + {{ render_field(form.display_name, tabindex=230) }} + {{ render_field(form.website_url, tabindex=232) }} + {{ render_field(form.donate_url, tabindex=233) }} + {% endif %} + + {% if user.checkPerm(current_user, "CHANGE_EMAIL") %} + {{ render_field(form.email, tabindex=240) }} + We'll send you an email to verify it if changed. + {% endif %} + + {% if user.checkPerm(current_user, "CHANGE_RANK") %} + {{ render_field(form.rank, tabindex=250) }} + {% endif %} + + {{ render_submit_field(form.submit, tabindex=280) }} +
+
+
+
+{% endif %} +
+ +{% from "macros/packagegridtile.html" import render_pkggrid %} +{{ render_pkggrid(packages, show_author=False) }} + +{% if user.donate_url %} +
+ Like {{ user.display_name }}'s work? + Donate now! +
+{% endif %} + +{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %} +
+ +

Unadded topics

+ + {% if topics_to_add %} +

+ List of your forum topics which do not have a matching package. + Topics with a strikethrough have been marked as discarded. +

+ + {% from "macros/topics.html" import render_topics_table %} + {{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }} + {% else %} +

Congrats! You don't have any topics which aren't on CDB.

+ {% endif %} +
+{% endif %} + +{% endblock %} + + +{% block scriptextra %} + + +{% endblock %} diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html deleted file mode 100644 index d1edf54..0000000 --- a/app/templates/users/user_profile_page.html +++ /dev/null @@ -1,205 +0,0 @@ -{% extends "base.html" %} - -{% block title %} - {{ user.username }} -{% endblock %} - -{% block content %} - -{% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %} -
- Claim - - Is this you? Claim your account now! -
-{% endif %} - -
-
-
-

{{ user.display_name }}

-
- -
- - - - - - - - - - {% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.MODERATOR) %} - - - - - {% endif %} - {% if user == current_user %} - - - - - - - - - {% endif %} -
Rank: - {{ user.rank.getTitle() }} -
Links: - {% if user.forums_username %} - - Minetest Forum - - {% elif user == current_user %} - No forum account - {% endif %} - - {% if user.github_username or user == current_user %} - | - {% endif %} - - {% if user.github_username %} - GitHub - {% elif user == current_user %} - Link Github - {% endif %} - - {% if user.website_url %} - | Website - {% endif %} - - {% if user == current_user %} -
- - 🌎 - Visible to everyone - - {% endif %} -
Admin - {% if user.email %} - - Email - - {% else %} - - Email - - {% endif %} -
Profile Picture: - {% if user.forums_username %} -
- - -
- {% endif %} - {% if user.email %} - - Gravatar - - {% else %} - - Gravatar - - {% endif %} -
Password: - {% if user.password %} - Set | Change - {% else %} - Not set | Set - {% endif %} -
-
-
-
-
- -{% if form %} - {% from "macros/forms.html" import render_field, render_submit_field %} -
-
-
Edit Details
-
-
- {{ form.hidden_tag() }} - - {% if user.checkPerm(current_user, "CHANGE_DNAME") %} - {{ render_field(form.display_name, tabindex=230) }} - {{ render_field(form.website_url, tabindex=232) }} - {{ render_field(form.donate_url, tabindex=233) }} - {% endif %} - - {% if user.checkPerm(current_user, "CHANGE_EMAIL") %} - {{ render_field(form.email, tabindex=240) }} - We'll send you an email to verify it if changed. - {% endif %} - - {% if user.checkPerm(current_user, "CHANGE_RANK") %} - {{ render_field(form.rank, tabindex=250) }} - {% endif %} - - {{ render_submit_field(form.submit, tabindex=280) }} -
-
-
-
-{% endif %} -
- -{% from "macros/packagegridtile.html" import render_pkggrid %} -{{ render_pkggrid(packages, show_author=False) }} - -{% if user.donate_url %} -
- Like {{ user.display_name }}'s work? - Donate now! -
-{% endif %} - -{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %} -
- -

Unadded topics

- - {% if topics_to_add %} -

- List of your forum topics which do not have a matching package. - Topics with a strikethrough have been marked as discarded. -

- - {% from "macros/topics.html" import render_topics_table %} - {{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }} - {% else %} -

Congrats! You don't have any topics which aren't on CDB.

- {% endif %} -
-{% endif %} - -{% endblock %} - - -{% block scriptextra %} - - -{% endblock %} -- cgit v1.2.3