mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-09 15:37:18 -04:00
(admin) faster profile moderation – moderation queue
This commit is contained in:
parent
5e473c8c12
commit
48544ab3ee
@ -39,12 +39,20 @@
|
||||
<span v-if="s.el.isHandled" class="badge bg-success">
|
||||
Case closed
|
||||
</span>
|
||||
<a v-else-if="allowResolving" href="#" class="badge bg-light text-success border border-success"
|
||||
@click.prevent="handleReport(s.el.id)"
|
||||
>
|
||||
<Icon v="thumbs-up"/>
|
||||
I checked the profile, it's OK.
|
||||
</a>
|
||||
<template v-else>
|
||||
<a v-if="allowQueue && canBeInQueue(s.el)" href="#" class="badge bg-light text-primary border border-primary m-1"
|
||||
@click.prevent="startQueue(s.el)"
|
||||
>
|
||||
<Icon v="play"/>
|
||||
Start a moderation queue here
|
||||
</a>
|
||||
<a v-if="allowResolving" href="#" class="badge bg-light text-success border border-success m-1"
|
||||
@click.prevent="handleReport(s.el.id)"
|
||||
>
|
||||
<Icon v="thumbs-up"/>
|
||||
I checked the profile, it's OK.
|
||||
</a>
|
||||
</template>
|
||||
</td>
|
||||
<td v-if="s.el.snapshot">
|
||||
<a href="#" class="badge bg-info"
|
||||
@ -63,6 +71,7 @@ export default {
|
||||
props: {
|
||||
abuseReports: {required: true},
|
||||
allowResolving: {type: Boolean},
|
||||
allowQueue: {type: Boolean},
|
||||
},
|
||||
methods: {
|
||||
formatComment(comment) {
|
||||
@ -79,6 +88,14 @@ export default {
|
||||
return r;
|
||||
});
|
||||
},
|
||||
canBeInQueue(report) {
|
||||
return report.profiles && report.profiles.split(',').includes(this.config.locale)
|
||||
},
|
||||
startQueue(report) {
|
||||
localStorage.setItem('moderationQueue', [...new Set(this.abuseReports.filter(r => this.canBeInQueue(r)).map(r => r.susUsername))]);
|
||||
localStorage.setItem('moderationQueueCaret', report.susUsername);
|
||||
this.$router.push('/@' + report.susUsername);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -166,6 +166,22 @@
|
||||
</div>
|
||||
</section>
|
||||
<ModerationRules v-if="$isGranted('users')" type="rulesUsers" class="mt-4"/>
|
||||
<div v-if="moderationQueueCaret === user.username" class="btn-group w-100">
|
||||
<button class="btn btn-outline-primary"
|
||||
:disabled="moderationQueueIndex === 0"
|
||||
@click="queuePrevious"
|
||||
>
|
||||
<Icon v="arrow-circle-left"/>
|
||||
Previous profile in the queue
|
||||
</button>
|
||||
<button class="btn btn-primary"
|
||||
:disabled="moderationQueueIndex === moderationQueue.length - 1"
|
||||
@click="queueNext"
|
||||
>
|
||||
<Icon v="arrow-circle-right"/>
|
||||
Next profile in the queue
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -223,7 +239,11 @@ To keep our platform safe and inclusive, please remove this content.
|
||||
|
||||
Thanks!
|
||||
`
|
||||
}
|
||||
},
|
||||
|
||||
moderationQueue: undefined,
|
||||
moderationQueueCaret: undefined,
|
||||
moderationQueueIndex: undefined,
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -238,6 +258,23 @@ Thanks!
|
||||
if (this.messages.length > 0) {
|
||||
this.showMessages = true;
|
||||
}
|
||||
|
||||
if (!process.client) { return; }
|
||||
this.moderationQueue = localStorage.getItem('moderationQueue');
|
||||
this.moderationQueueCaret = localStorage.getItem('moderationQueueCaret');
|
||||
|
||||
if (this.moderationQueue) {
|
||||
this.moderationQueue = this.moderationQueue.split(',')
|
||||
this.moderationQueueIndex = this.moderationQueue.indexOf(this.moderationQueueCaret);
|
||||
if (this.moderationQueueIndex < 0) {
|
||||
this.moderationQueue = undefined;
|
||||
this.moderationQueueCaret = undefined;
|
||||
this.moderationQueueIndex = undefined;
|
||||
localStorage.removeItem('moderationQueue');
|
||||
localStorage.removeItem('moderationQueueCaret');
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async ban() {
|
||||
@ -307,7 +344,17 @@ Thanks!
|
||||
},
|
||||
nl2br(text) {
|
||||
return text.replace(new RegExp('\\n', 'g'), '<br/>');
|
||||
}
|
||||
},
|
||||
queuePrevious() {
|
||||
this.moderationQueueCaret = this.moderationQueue[this.moderationQueueIndex - 1];
|
||||
localStorage.setItem('moderationQueueCaret', this.moderationQueueCaret);
|
||||
this.$router.push('/@' + this.moderationQueueCaret);
|
||||
},
|
||||
queueNext() {
|
||||
this.moderationQueueCaret = this.moderationQueue[this.moderationQueueIndex + 1];
|
||||
localStorage.setItem('moderationQueueCaret', this.moderationQueueCaret);
|
||||
this.$router.push('/@' + this.moderationQueueCaret);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
canApplyBan() {
|
||||
|
@ -47,7 +47,7 @@
|
||||
<ModerationRules type="rulesUsers" emphasise/>
|
||||
<ModerationRules type="susRegexes" label="Keywords for automated triggers"/>
|
||||
<Loading :value="filteredAbuseReports">
|
||||
<AbuseReports :abuseReports="filteredAbuseReports" allowResolving/>
|
||||
<AbuseReports :abuseReports="filteredAbuseReports" allowResolving allowQueue/>
|
||||
</Loading>
|
||||
</section>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user