From 34c68420180a587750f684197cffe406b1c1723e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 05:55:41 +0200 Subject: [PATCH 1/3] make the tooltip be "hat - description" --- files/classes/user.py | 4 ++-- files/templates/comments.html | 2 +- files/templates/header.html | 2 +- files/templates/leaderboard.html | 14 +++++++++----- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/user_in_table.html | 2 +- files/templates/userpage.html | 4 ++-- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 791232b1dc..909a4e731e 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -202,7 +202,7 @@ class User(Base): return 'Cakeday.webp' if self.equipped_hats: - return random.choice(self.equipped_hats).name + '.webp' + return random.choice(self.equipped_hats) return '' @@ -215,7 +215,7 @@ class User(Base): return "I've spent another year rotting my brain with dramaposting, please ridicule me 🤓" if self.equipped_hats: - return random.choice(self.equipped_hats).censored_description(v) + return self.hat_active.name + ' - ' + self.hat_active.censored_description(v) return '' diff --git a/files/templates/comments.html b/files/templates/comments.html index 6553faaf8b..abe93a548d 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -171,7 +171,7 @@
{% if c.author.hat_active -%} - + {%- endif %}
{{c.author_name}} diff --git a/files/templates/header.html b/files/templates/header.html index 406584f345..52457b6424 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -207,7 +207,7 @@
{% if v.hat_active -%} - + {% elif request.path == '/hats' %} {%- endif %} diff --git a/files/templates/leaderboard.html b/files/templates/leaderboard.html index 628a718070..389d95122c 100644 --- a/files/templates/leaderboard.html +++ b/files/templates/leaderboard.html @@ -379,17 +379,21 @@ - {% for user in users13 %} - + {% for user, num in users13 %} + {{loop.index}} - {{user[0].username}} - {{user[1]}} + {% include "user_in_table.html" %} + {{num}} {% endfor %} {% if pos13 and (pos13[0] > 25 or not pos13[1]) %} {{pos13[0]}} - {{v.username}} + + {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} + {{pos13[1]}} {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 0e5ab96480..933da33360 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -677,7 +677,7 @@
{% if p.author.hat_active -%} - + {%- endif %}
{{p.author_name}} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index afd8b99765..03014d99f6 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -172,7 +172,7 @@
{% if p.author.hat_active -%} - + {%- endif %}
{{p.author_name}} diff --git a/files/templates/user_in_table.html b/files/templates/user_in_table.html index b107590404..563ded4182 100644 --- a/files/templates/user_in_table.html +++ b/files/templates/user_in_table.html @@ -2,7 +2,7 @@
{% if user.hat_active -%} - + {%- endif %}
{{user.username}} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index e1b0ea2f81..fd816e9029 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -42,7 +42,7 @@ {% if u.hat_active -%} - + {%- endif %}
@@ -407,7 +407,7 @@ {% if u.hat_active -%} - + {%- endif %} From eb3dd36b594da39ee2a73545dbcbb801c354a954 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 05:57:30 +0200 Subject: [PATCH 2/3] add hats to a leaderboard table --- files/templates/leaderboard.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/files/templates/leaderboard.html b/files/templates/leaderboard.html index 389d95122c..e72bf42138 100644 --- a/files/templates/leaderboard.html +++ b/files/templates/leaderboard.html @@ -248,18 +248,22 @@ - {% for user in users9 %} - + {% for user, num in users9 %} + {{loop.index}} - {{user[0].username}} - {{user[1]}} + {% include "user_in_table.html" %} + {{num}} {% endfor %} {% if pos9 and (pos9[0] > 25 or not pos9[1]) %} {{pos9[0]}} - {{v.username}} - {{pos9[1]}} + + {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} + + {{pos9[1]}} {% endif %} From b3b6f1cf34af6960eba68c7a5683f525d5a717aa Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 06:00:19 +0200 Subject: [PATCH 3/3] add hats to all pp20 --- files/templates/settings_blocks.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/templates/settings_blocks.html b/files/templates/settings_blocks.html index 2e109238f7..0ac75789de 100644 --- a/files/templates/settings_blocks.html +++ b/files/templates/settings_blocks.html @@ -53,14 +53,16 @@ {% for block in v.blocking %} + {% set user=block.target %} - - @{{block.target.username}} + {% include "user_in_table.html" %} - {% else %}