From 9f205af1ebc09f480cfdc985ae02722aa910bf01 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 23 Feb 2024 23:27:11 +0200 Subject: [PATCH] rename data-sort-key to data-sort for consistency --- files/assets/js/core.js | 6 +++--- files/templates/admin/patrons.html | 4 ++-- files/templates/admin/shadowbanned.html | 2 +- files/templates/badges.html | 2 +- files/templates/shop.html | 2 +- files/templates/special/worldcup22_leaderboard.html | 4 ++-- files/templates/user_in_table.html | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index f2c05a38c..3f248662c 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -349,12 +349,12 @@ function sort_table(t) { for (let i = 1; i < rows.length; i++) { const ele = rows[i]; let x = rows[i].getElementsByTagName("TD")[n]; - if (!('sortKey' in x.dataset)) { + if (!x.dataset.sort) { x = x.getElementsByTagName('a')[0] || x; } let attr; - if ('sortKey' in x.dataset) { - attr = x.dataset.sortKey; + if (x.dataset.sort) { + attr = x.dataset.sort; if (/^[\d-,]+$/.test(attr)) { attr = parseInt(attr.replace(/,/g, '')) } diff --git a/files/templates/admin/patrons.html b/files/templates/admin/patrons.html index 5efd75755..dbbc432fe 100644 --- a/files/templates/admin/patrons.html +++ b/files/templates/admin/patrons.html @@ -16,12 +16,12 @@ {{loop.index}} {% include "user_in_table.html" %} - + {% if user.patron > 1 %} 2{{user.patron}} {% endif %} - ${{user.lifetimedonated}} + ${{user.lifetimedonated}} {{user.truescore}} {% endfor %} diff --git a/files/templates/admin/shadowbanned.html b/files/templates/admin/shadowbanned.html index 851fcb527..51af63366 100644 --- a/files/templates/admin/shadowbanned.html +++ b/files/templates/admin/shadowbanned.html @@ -25,7 +25,7 @@ {% for user in users %} - {%- include 'user_in_table.html' -%} + {%- include 'user_in_table.html' -%} {{user.truescore}} {{user.shadowban_reason | safe}} {{user.shadowbanned_by}} diff --git a/files/templates/badges.html b/files/templates/badges.html index 2be731423..cbbdeb5d0 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -26,7 +26,7 @@ {{badge.description}} {%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %} {{ct[0]}} - {{"{:0.3f}".format(ct[1])}}% + {{"{:0.3f}".format(ct[1])}}% {% endfor %} diff --git a/files/templates/shop.html b/files/templates/shop.html index 7fc7c233e..4838b682d 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -65,7 +65,7 @@ {{a['title']}} {% if a['baseprice'] != price %} - + {{a['baseprice']}} {{price}} {% else %} diff --git a/files/templates/special/worldcup22_leaderboard.html b/files/templates/special/worldcup22_leaderboard.html index 5c7335d25..43f8e88da 100644 --- a/files/templates/special/worldcup22_leaderboard.html +++ b/files/templates/special/worldcup22_leaderboard.html @@ -19,12 +19,12 @@ {% set user = users.get(r[0]) %} {{loop.index}} - {%- include 'user_in_table.html' -%} + {%- include 'user_in_table.html' -%} {{r[1]}} {{r[2]}} {% set ratio = r[1]/r[2] %} {% set percent = (ratio*100)|string %} - {{percent[:3].replace('0.0', '0').rstrip('.')}}% + {{percent[:3].replace('0.0', '0').rstrip('.')}}% {{r[3]}} {% endfor %} diff --git a/files/templates/user_in_table.html b/files/templates/user_in_table.html index 9509c0b0f..4d33f1763 100644 --- a/files/templates/user_in_table.html +++ b/files/templates/user_in_table.html @@ -1,7 +1,7 @@ {% if user %} {% if can_see(v, user) %} {%- include 'admin/shadowbanned_tooltip.html' -%} - +
{% if user.hat_active(v)[0] -%}