From ba96d1038a010ac52d117db1f271bc176ef0772c Mon Sep 17 00:00:00 2001 From: EB25Ball Date: Wed, 16 Oct 2024 11:47:26 -0400 Subject: [PATCH] automatic report reasonning --- website/levels/viewer/scripts/level_viewer.js | 2 +- website/src/components/CardLevel.vue | 10 ++++++++-- website/src/components/ModerationPopup.vue | 7 ++++++- website/src/components/ScrollList.vue | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/website/levels/viewer/scripts/level_viewer.js b/website/levels/viewer/scripts/level_viewer.js index 13df3f3..9ca9d1c 100644 --- a/website/levels/viewer/scripts/level_viewer.js +++ b/website/levels/viewer/scripts/level_viewer.js @@ -1024,7 +1024,7 @@ function init() return finalStr.trim(); } - fontLoader.load('./scripts/Roboto_Regular.json', function (font) { + fontLoader.load(import.meta.env.BASE_URL+'./levels/viewer/scripts/Roboto_Regular.json', function (font) { const processedText = processString(signText); const lines = processedText.split('\n'); diff --git a/website/src/components/CardLevel.vue b/website/src/components/CardLevel.vue index 664dc6e..adc4417 100644 --- a/website/src/components/CardLevel.vue +++ b/website/src/components/CardLevel.vue @@ -3,6 +3,7 @@ import { GetLevelReportInfoRequest } from "../requests/GetLevelReportInfoRequest import { mapState } from 'pinia' import { useUserStore } from '@/stores/user' +import { computed } from 'vue' import VLazyImage from 'v-lazy-image' import ReportModerationTools from './ReportModerationTools.vue' @@ -35,7 +36,8 @@ export default { item: Object, moderationItem : Object, index: Number, - listType: String + listType: String, + bestReason: String }, data() { @@ -45,6 +47,11 @@ export default { isHidden: this.item.hidden } }, + provide(){ + return { + bestReason: (computed(()=>this.bestReason)) + } + }, computed: { creators() { @@ -133,7 +140,6 @@ export default { return this.moderationItem !== null }, - ...mapState(useUserStore, ['isVerifier']), ...mapState(useUserStore, ['isAdmin']), ...mapState(useUserStore, ['isSuperModerator']), diff --git a/website/src/components/ModerationPopup.vue b/website/src/components/ModerationPopup.vue index ac9b8b9..1b096d2 100644 --- a/website/src/components/ModerationPopup.vue +++ b/website/src/components/ModerationPopup.vue @@ -15,6 +15,7 @@ export default { config: String, identifier: String }, + inject: ['bestReason'], data() { return { @@ -55,7 +56,11 @@ export default { ...mapState(useUserStore, ['accessToken']), ...mapState(useUserStore, ['isSuperModerator']) }, - + created(){ + if(this.bestReason){ + this.currentSelection=(this.config.includes("level_")?'level_':'user_')+this.bestReason; + } + }, methods: { async doModerationAction() { const reason = this.currentSelection; diff --git a/website/src/components/ScrollList.vue b/website/src/components/ScrollList.vue index 31eecdd..ef9ed14 100644 --- a/website/src/components/ScrollList.vue +++ b/website/src/components/ScrollList.vue @@ -278,7 +278,7 @@ export default {
- +
Loading more items...