2020-10-19 05:29:04 -05:00
|
|
|
<template>
|
2022-01-10 09:05:18 -06:00
|
|
|
<XWindow ref="window" :initial-width="400" :initial-height="500" :can-resize="true" @closed="emit('closed')">
|
2020-10-19 05:29:04 -05:00
|
|
|
<template #header>
|
2021-04-20 09:22:59 -05:00
|
|
|
<i class="fas fa-exclamation-circle" style="margin-right: 0.5em;"></i>
|
2022-01-10 09:05:18 -06:00
|
|
|
<I18n :src="i18n.locale.reportAbuseOf" tag="span">
|
2020-10-19 05:29:04 -05:00
|
|
|
<template #name>
|
|
|
|
<b><MkAcct :user="user"/></b>
|
|
|
|
</template>
|
2020-12-25 19:01:32 -06:00
|
|
|
</I18n>
|
2020-10-19 05:29:04 -05:00
|
|
|
</template>
|
2021-04-12 22:43:19 -05:00
|
|
|
<div class="dpvffvvy _monolithic_">
|
|
|
|
<div class="_section">
|
2021-08-06 08:29:19 -05:00
|
|
|
<MkTextarea v-model="comment">
|
2022-01-10 09:05:18 -06:00
|
|
|
<template #label>{{ i18n.locale.details }}</template>
|
|
|
|
<template #caption>{{ i18n.locale.fillAbuseReportDescription }}</template>
|
2021-04-10 22:31:24 -05:00
|
|
|
</MkTextarea>
|
2020-10-19 05:29:04 -05:00
|
|
|
</div>
|
2021-04-12 22:43:19 -05:00
|
|
|
<div class="_section">
|
2022-01-10 09:05:18 -06:00
|
|
|
<MkButton primary full :disabled="comment.length === 0" @click="send">{{ i18n.locale.send }}</MkButton>
|
2020-10-19 05:29:04 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</XWindow>
|
|
|
|
</template>
|
|
|
|
|
2022-01-10 09:05:18 -06:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
2021-11-11 11:02:25 -06:00
|
|
|
import XWindow from '@/components/ui/window.vue';
|
|
|
|
import MkTextarea from '@/components/form/textarea.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import * as os from '@/os';
|
2022-01-10 09:05:18 -06:00
|
|
|
import { i18n } from '@/i18n';
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2022-01-10 09:05:18 -06:00
|
|
|
const props = defineProps<{
|
|
|
|
user: Misskey.entities.User;
|
|
|
|
initialComment?: string;
|
|
|
|
}>();
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2022-01-10 09:05:18 -06:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: 'closed'): void;
|
|
|
|
}>();
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2022-01-10 09:05:18 -06:00
|
|
|
const window = ref<InstanceType<typeof XWindow>>();
|
|
|
|
const comment = ref(props.initialComment || '');
|
2020-10-19 05:29:04 -05:00
|
|
|
|
2022-01-10 09:05:18 -06:00
|
|
|
function send() {
|
|
|
|
os.apiWithDialog('users/report-abuse', {
|
|
|
|
userId: props.user.id,
|
|
|
|
comment: comment.value,
|
|
|
|
}, undefined).then(res => {
|
|
|
|
os.alert({
|
|
|
|
type: 'success',
|
|
|
|
text: i18n.locale.abuseReported
|
|
|
|
});
|
|
|
|
window.value?.close();
|
|
|
|
emit('closed');
|
|
|
|
});
|
|
|
|
}
|
2020-10-19 05:29:04 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.dpvffvvy {
|
2021-04-09 22:40:50 -05:00
|
|
|
--root-margin: 16px;
|
2020-10-19 05:29:04 -05:00
|
|
|
}
|
|
|
|
</style>
|