esifawafwu
This commit is contained in:
+5
-2
@@ -60,6 +60,9 @@
|
||||
(window.f0ckSession && window.f0ckSession.user && document.querySelector('#a_username[data-username]')?.dataset?.username?.toLowerCase() === window.f0ckSession.user.toLowerCase())
|
||||
);
|
||||
|
||||
// Anonymous uploaders may change the rating of their own item without full manage rights
|
||||
const canRate = canManage || !!document.querySelector('#tags[data-can-rate="true"]');
|
||||
|
||||
// Only remove existing dynamically generated tags
|
||||
[...inner.querySelectorAll(".badge")].forEach(tag => {
|
||||
// Don't remove the one containing the add/toggle buttons, and don't remove the autocomplete input itself
|
||||
@@ -100,7 +103,7 @@
|
||||
span.classList.add('rating-tag', `is-${tag.normalized}`);
|
||||
span.dataset.rating = tag.normalized;
|
||||
if (activePostId) span.dataset.itemId = activePostId;
|
||||
if (canManage) {
|
||||
if (canRate) {
|
||||
span.classList.add('can-cycle');
|
||||
}
|
||||
} else {
|
||||
@@ -144,7 +147,7 @@
|
||||
const hasRating = !!lastRatingTag;
|
||||
if (!hasRating) {
|
||||
const untaggedSpan = document.createElement("span");
|
||||
untaggedSpan.className = `badge badge-untagged rating-tag is-untagged${canManage ? ' can-cycle' : ''}`;
|
||||
untaggedSpan.className = `badge badge-untagged rating-tag is-untagged${canRate ? ' can-cycle' : ''}`;
|
||||
untaggedSpan.dataset.rating = 'untagged';
|
||||
if (activePostId) untaggedSpan.dataset.itemId = activePostId;
|
||||
const lbl = document.createElement("span");
|
||||
|
||||
Reference in New Issue
Block a user