From 332a03219b411b148ce95a6638e51ab0111197a1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 05:01:06 +0200 Subject: [PATCH] add hats to most tables --- files/templates/admin/lottery.html | 2 +- files/templates/admins.html | 2 +- files/templates/agendaposters.html | 4 +- files/templates/banned.html | 8 +- files/templates/followers.html | 2 +- files/templates/following.html | 2 +- files/templates/grassed.html | 2 +- files/templates/hats.html | 2 +- files/templates/leaderboard.html | 313 +++++---------------------- files/templates/loggedin.html | 2 +- files/templates/marseys.html | 4 +- files/templates/patrons.html | 6 +- files/templates/poll_votes.html | 9 +- files/templates/poorcels.html | 2 +- files/templates/shadowbanned.html | 2 +- files/templates/sub/blockers.html | 2 +- files/templates/sub/exilees.html | 9 +- files/templates/sub/mods.html | 2 +- files/templates/sub/subscribers.html | 2 +- files/templates/user_in_table.html | 9 + files/templates/viewers.html | 6 +- files/templates/voters.html | 14 +- files/templates/votes.html | 28 +-- 23 files changed, 113 insertions(+), 321 deletions(-) create mode 100644 files/templates/user_in_table.html diff --git a/files/templates/admin/lottery.html b/files/templates/admin/lottery.html index 03475ccaa..70998ae3a 100644 --- a/files/templates/admin/lottery.html +++ b/files/templates/admin/lottery.html @@ -15,7 +15,7 @@ {% for user in participants %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {{user.currently_held_lottery_tickets}} {% endfor %} diff --git a/files/templates/admins.html b/files/templates/admins.html index 6923393cc..7353a3e32 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -21,7 +21,7 @@ {% for user in admins %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {{user.truecoins}} {{user.modaction_num}} diff --git a/files/templates/agendaposters.html b/files/templates/agendaposters.html index ee3a87042..880bc60c1 100644 --- a/files/templates/agendaposters.html +++ b/files/templates/agendaposters.html @@ -11,8 +11,8 @@ {% for user in users %} {{loop.index}} - {{user.username}} - + {% include "user_in_table.html" %} + {% endfor %} diff --git a/files/templates/banned.html b/files/templates/banned.html index 17ce5b30e..0e0d49d88 100644 --- a/files/templates/banned.html +++ b/files/templates/banned.html @@ -13,9 +13,13 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% if user.ban_reason %}{{user.ban_reason}}{% endif %} - {{user.banned_by.username}} + + {% with user=user.banned_by %} + {% include "user_in_table.html" %} + {% endwith %} + {% endfor %} diff --git a/files/templates/followers.html b/files/templates/followers.html index 97508d708..e3858afe7 100644 --- a/files/templates/followers.html +++ b/files/templates/followers.html @@ -20,7 +20,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% if v.id == u.id %}
Remove follow
{% endif %} diff --git a/files/templates/following.html b/files/templates/following.html index 0f6f5993f..374568037 100644 --- a/files/templates/following.html +++ b/files/templates/following.html @@ -20,7 +20,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% if v.id == u.id %}
Unfollow
{% endif %} diff --git a/files/templates/grassed.html b/files/templates/grassed.html index fcffbc5fa..aca108b07 100644 --- a/files/templates/grassed.html +++ b/files/templates/grassed.html @@ -13,7 +13,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {{user.ban_reason.split('by ')[1]}} {% endfor %} diff --git a/files/templates/hats.html b/files/templates/hats.html index b777ab7b9..3fbab7f16 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -64,7 +64,7 @@ {{hat.name}} {{hat.censored_description(v)}} {% if SITE == 'rdrama.net' %} - {{user.username}} + {% include "user_in_table.html" %} {% endif %} {{hat.number_sold}} {{hat.price}} diff --git a/files/templates/leaderboard.html b/files/templates/leaderboard.html index 0f46b6ddb..628a71807 100644 --- a/files/templates/leaderboard.html +++ b/files/templates/leaderboard.html @@ -37,17 +37,7 @@ {% for user in users1 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.coins}} {% endfor %} @@ -55,15 +45,9 @@ {{pos1}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.coins}} @@ -84,17 +68,7 @@ {% for user in users7 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.coins_spent}} {% endfor %} @@ -102,15 +76,9 @@ {{pos7}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.coins_spent}} @@ -131,17 +99,7 @@ {% for user in users10 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.truecoins}} {% endfor %} @@ -149,15 +107,9 @@ {{pos10}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.truecoins}} @@ -178,17 +130,7 @@ {% for user in users2 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.stored_subscriber_count}} {% endfor %} @@ -196,15 +138,9 @@ {{pos2}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.stored_subscriber_count}} @@ -224,17 +160,7 @@ {% for user in users3 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.post_count}} {% endfor %} @@ -242,15 +168,9 @@ {{pos3}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.post_count}} @@ -270,17 +190,7 @@ {% for user in users4 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.comment_count}} {% endfor %} @@ -288,15 +198,9 @@ {{pos4}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.comment_count}} @@ -316,17 +220,7 @@ {% for user in users5 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.received_award_count}} {% endfor %} @@ -334,15 +228,9 @@ {{pos5}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.received_award_count}} @@ -392,17 +280,7 @@ {% for user, num in users11 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{num}} {% endfor %} @@ -410,15 +288,9 @@ {{pos11[0]}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{pos11[1]}} @@ -443,33 +315,16 @@ {% for user in users6 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.basedcount}} {% endfor %} {% if pos6 > 25 %} - {{pos6}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.basedcount}} @@ -493,17 +348,7 @@ {% for user, num in users12 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{num}} {% endfor %} @@ -511,15 +356,9 @@ {{pos12[0]}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{pos12[1]}} @@ -572,17 +411,7 @@ {% for user in users14 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.winnings}} {% endfor %} @@ -590,15 +419,9 @@ {{pos14}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.winnings}} @@ -618,17 +441,7 @@ {% for user in users15 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{user.winnings}} {% endfor %} @@ -636,15 +449,9 @@ {{pos15}} - -
- - {% if v.hat_active -%} - - {%- endif %} -
- {{v.username}} -
+ {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} {{v.winnings}} @@ -684,17 +491,7 @@ {% for user,num in users16 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{num}} {% endfor %} @@ -713,17 +510,7 @@ {% for user,num in users17 %} {{loop.index}} - - -
- - {% if user.hat_active -%} - - {%- endif %} -
- {{user.username}} -
- + {% include "user_in_table.html" %} {{num}} {% endfor %} diff --git a/files/templates/loggedin.html b/files/templates/loggedin.html index cfa98918c..2545dcd68 100644 --- a/files/templates/loggedin.html +++ b/files/templates/loggedin.html @@ -12,7 +12,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {{user.truecoins}} {% endfor %} diff --git a/files/templates/marseys.html b/files/templates/marseys.html index 86dbf74e7..f2358404d 100644 --- a/files/templates/marseys.html +++ b/files/templates/marseys.html @@ -16,14 +16,14 @@ {% if SITE == 'rdrama.net' %} - {% for marsey, author in marseys %} + {% for marsey, user in marseys %} {{loop.index}} {{marsey.name}} :#{{marsey.name}}: {{marsey.count}} {% if SITE == 'rdrama.net' %} - {{author.username}} + {% include "user_in_table.html" %} {% endif %} {% endfor %} diff --git a/files/templates/patrons.html b/files/templates/patrons.html index d03a3e749..cad2d5522 100644 --- a/files/templates/patrons.html +++ b/files/templates/patrons.html @@ -9,12 +9,12 @@ Tier -{% for u in users %} +{% for user in users %} {{loop.index}} - {{u.username}} + {% include "user_in_table.html" %} - 2{{u.patron}} + 2{{user.patron}} {% endfor %} diff --git a/files/templates/poll_votes.html b/files/templates/poll_votes.html index 0948f18a6..75a6f9ee8 100644 --- a/files/templates/poll_votes.html +++ b/files/templates/poll_votes.html @@ -27,12 +27,9 @@ {% for vote in ups %} - - - - {{vote.user.username}} - - + {% with user=vote.user %} + {% include "user_in_table.html" %} + {% endwith %} {{vote.user.truecoins}} diff --git a/files/templates/poorcels.html b/files/templates/poorcels.html index f3d0221d8..7fe422562 100644 --- a/files/templates/poorcels.html +++ b/files/templates/poorcels.html @@ -17,7 +17,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% endfor %} diff --git a/files/templates/shadowbanned.html b/files/templates/shadowbanned.html index 8e73f5f97..8ad0eebc9 100644 --- a/files/templates/shadowbanned.html +++ b/files/templates/shadowbanned.html @@ -14,7 +14,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {{user.shadowbanned}} {% endfor %} diff --git a/files/templates/sub/blockers.html b/files/templates/sub/blockers.html index 95de0c619..0c65defa9 100644 --- a/files/templates/sub/blockers.html +++ b/files/templates/sub/blockers.html @@ -16,7 +16,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% endfor %} diff --git a/files/templates/sub/exilees.html b/files/templates/sub/exilees.html index 53e7732b5..91f4a2369 100644 --- a/files/templates/sub/exilees.html +++ b/files/templates/sub/exilees.html @@ -17,10 +17,13 @@ {% for user, exile in users %} - {% set exiler=exile.exiler %} {{loop.index}} - {{user.username}} - {{exiler.username}} + {% include "user_in_table.html" %} + + {% with user=exile.exiler %} + {% include "user_in_table.html" %} + {% endwith %} + {% if v.mods(sub.name) %}
diff --git a/files/templates/sub/mods.html b/files/templates/sub/mods.html index d30e0f42b..fed8e8f60 100644 --- a/files/templates/sub/mods.html +++ b/files/templates/sub/mods.html @@ -18,7 +18,7 @@ {% for user, mod in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% if v.id == user.id or v.mod_date(sub.name) and v.mod_date(sub.name) < mod.created_utc %} diff --git a/files/templates/sub/subscribers.html b/files/templates/sub/subscribers.html index 09fff603d..f850bd1f7 100644 --- a/files/templates/sub/subscribers.html +++ b/files/templates/sub/subscribers.html @@ -16,7 +16,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {% include "user_in_table.html" %} {% endfor %} diff --git a/files/templates/user_in_table.html b/files/templates/user_in_table.html new file mode 100644 index 000000000..b10759040 --- /dev/null +++ b/files/templates/user_in_table.html @@ -0,0 +1,9 @@ + +
+ + {% if user.hat_active -%} + + {%- endif %} +
+ {{user.username}} +
\ No newline at end of file diff --git a/files/templates/viewers.html b/files/templates/viewers.html index 72516200d..f9396cf45 100644 --- a/files/templates/viewers.html +++ b/files/templates/viewers.html @@ -12,7 +12,11 @@ {% for view in viewers %} - {{view.viewer.username}} + + {% with user=view.viewer %} + {% include "user_in_table.html" %} + {% endwith %} + {{view.last_view_string}} {% endfor %} diff --git a/files/templates/voters.html b/files/templates/voters.html index 9d4b40a6e..3afd2ed7e 100644 --- a/files/templates/voters.html +++ b/files/templates/voters.html @@ -16,17 +16,21 @@ -{% for user in users %} - +{% for user, num in users %} + {{loop.index}} - {{user[0].username}} - {{user[1]}} + {% include "user_in_table.html" %} + {{num}} {% endfor %} {% if pos and (pos[0] > 25 or not pos[1]) %} {{pos[0]}} - {{v.username}} + + {% with user=v %} + {% include "user_in_table.html" %} + {% endwith %} + {{pos[1]}} {% endif %} diff --git a/files/templates/votes.html b/files/templates/votes.html index 74853a788..de147e25d 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -39,17 +39,9 @@ {% for vote in ups %} - -
- - {% if vote.user.hat_active -%} - - {%- endif %} -
- - {{vote.user.username}} - -
+ {% with user=vote.user %} + {% include "user_in_table.html" %} + {% endwith %} {{vote.user.truecoins}} @@ -72,17 +64,9 @@ {% for vote in downs %} - -
- - {% if vote.user.hat_active -%} - - {%- endif %} -
- - {{vote.user.username}} - -
+ {% with user=vote.user %} + {% include "user_in_table.html" %} + {% endwith %} {{vote.user.truecoins}}