rename data-sort-key to data-sort for consistency
parent
2b365d4e4b
commit
9f205af1eb
|
@ -349,12 +349,12 @@ function sort_table(t) {
|
||||||
for (let i = 1; i < rows.length; i++) {
|
for (let i = 1; i < rows.length; i++) {
|
||||||
const ele = rows[i];
|
const ele = rows[i];
|
||||||
let x = rows[i].getElementsByTagName("TD")[n];
|
let x = rows[i].getElementsByTagName("TD")[n];
|
||||||
if (!('sortKey' in x.dataset)) {
|
if (!x.dataset.sort) {
|
||||||
x = x.getElementsByTagName('a')[0] || x;
|
x = x.getElementsByTagName('a')[0] || x;
|
||||||
}
|
}
|
||||||
let attr;
|
let attr;
|
||||||
if ('sortKey' in x.dataset) {
|
if (x.dataset.sort) {
|
||||||
attr = x.dataset.sortKey;
|
attr = x.dataset.sort;
|
||||||
if (/^[\d-,]+$/.test(attr)) {
|
if (/^[\d-,]+$/.test(attr)) {
|
||||||
attr = parseInt(attr.replace(/,/g, ''))
|
attr = parseInt(attr.replace(/,/g, ''))
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td>{% include "user_in_table.html" %}</td>
|
<td>{% include "user_in_table.html" %}</td>
|
||||||
<td data-sort-key="{{user.patron}}">
|
<td data-sort="{{user.patron}}">
|
||||||
{% if user.patron > 1 %}
|
{% if user.patron > 1 %}
|
||||||
<img class="contain" alt="2{{user.patron}}" loading="lazy" width=29.33 height=32 src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{user.patron}}.webp?b=11" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{user.patron_tooltip}}">
|
<img class="contain" alt="2{{user.patron}}" loading="lazy" width=29.33 height=32 src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{user.patron}}.webp?b=11" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{user.patron_tooltip}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td data-sort-key="{{user.lifetimedonated}}">${{user.lifetimedonated}}</td>
|
<td data-sort="{{user.lifetimedonated}}">${{user.lifetimedonated}}</td>
|
||||||
<td>{{user.truescore}}</td>
|
<td>{{user.truescore}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr>
|
<tr>
|
||||||
<td data-sort-key="{{user.username.lower() if user else ''}}">{%- include 'user_in_table.html' -%}</td>
|
<td data-sort="{{user.username.lower() if user else ''}}">{%- include 'user_in_table.html' -%}</td>
|
||||||
<td>{{user.truescore}}</td>
|
<td>{{user.truescore}}</td>
|
||||||
<td>{{user.shadowban_reason | safe}}</td>
|
<td>{{user.shadowban_reason | safe}}</td>
|
||||||
<td><a href="/{{user.shadowbanned_by}}">{{user.shadowbanned_by}}</a></td>
|
<td><a href="/{{user.shadowbanned_by}}">{{user.shadowbanned_by}}</a></td>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<td>{{badge.description}}</td>
|
<td>{{badge.description}}</td>
|
||||||
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
||||||
<td class="badges-rarity-qty"><a href="/badge_owners/{{badge.id}}">{{ct[0]}}</a></td>
|
<td class="badges-rarity-qty"><a href="/badge_owners/{{badge.id}}">{{ct[0]}}</a></td>
|
||||||
<td data-sort-key="{{ct[0]}}" class="badges-rarity-ratio">{{"{:0.3f}".format(ct[1])}}%</td>
|
<td data-sort="{{ct[0]}}" class="badges-rarity-ratio">{{"{:0.3f}".format(ct[1])}}%</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<td class="shop-table-icon"><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
<td class="shop-table-icon"><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
||||||
<td class="shop-table-title">{{a['title']}}</td>
|
<td class="shop-table-title">{{a['title']}}</td>
|
||||||
{% if a['baseprice'] != price %}
|
{% if a['baseprice'] != price %}
|
||||||
<td data-sort-key="{{price}}" class="shop-table-price">
|
<td data-sort="{{price}}" class="shop-table-price">
|
||||||
<span class="discounted-price">{{a['baseprice']}}</span> <em class="text-success">{{price}}</em>
|
<span class="discounted-price">{{a['baseprice']}}</span> <em class="text-success">{{price}}</em>
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
<tr>
|
<tr>
|
||||||
{% set user = users.get(r[0]) %}
|
{% set user = users.get(r[0]) %}
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td data-sort-key="{{user.username.lower() if user else ''}}">{%- include 'user_in_table.html' -%}</td>
|
<td data-sort="{{user.username.lower() if user else ''}}">{%- include 'user_in_table.html' -%}</td>
|
||||||
<td>{{r[1]}}</td>
|
<td>{{r[1]}}</td>
|
||||||
<td>{{r[2]}}</td>
|
<td>{{r[2]}}</td>
|
||||||
{% set ratio = r[1]/r[2] %}
|
{% set ratio = r[1]/r[2] %}
|
||||||
{% set percent = (ratio*100)|string %}
|
{% set percent = (ratio*100)|string %}
|
||||||
<td data-sort-key="{{ratio}}">{{percent[:3].replace('0.0', '0').rstrip('.')}}%</td>
|
<td data-sort="{{ratio}}">{{percent[:3].replace('0.0', '0').rstrip('.')}}%</td>
|
||||||
<td>{{r[3]}}</td>
|
<td>{{r[3]}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% if user %}
|
{% if user %}
|
||||||
{% if can_see(v, user) %}
|
{% if can_see(v, user) %}
|
||||||
{%- include 'admin/shadowbanned_tooltip.html' -%}
|
{%- include 'admin/shadowbanned_tooltip.html' -%}
|
||||||
<a data-sort-key="{{user.username.lower()}}" style="color:#{{user.name_color}};font-weight:bold" href="/@{{user.username}}">
|
<a data-sort="{{user.username.lower()}}" style="color:#{{user.name_color}};font-weight:bold" href="/@{{user.username}}">
|
||||||
<div class="profile-pic-20-wrapper mb-2">
|
<div class="profile-pic-20-wrapper mb-2">
|
||||||
<img loading="lazy" src="{{user.profile_url}}" class="pp20">
|
<img loading="lazy" src="{{user.profile_url}}" class="pp20">
|
||||||
{% if user.hat_active(v)[0] -%}
|
{% if user.hat_active(v)[0] -%}
|
||||||
|
|
Loading…
Reference in New Issue