improvement: make MkAbuseReport more friendly for smaller screen sizes

This commit is contained in:
blueb 2024-10-03 00:02:04 -04:00
parent a357e9bca2
commit a32a8e0404

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<div class="bcekxzvu _margin _panel"> <div class="bcekxzvu _margin _panel" :class="{ resolved: resolved }">
<div class="target"> <div class="target">
<MkA v-user-preview="report.targetUserId" class="info" :to="`/admin/user/${report.targetUserId}`" :behavior="'window'"> <MkA v-user-preview="report.targetUserId" class="info" :to="`/admin/user/${report.targetUserId}`" :behavior="'window'">
<MkAvatar class="avatar" :user="report.targetUser" indicator/> <MkAvatar class="avatar" :user="report.targetUser" indicator/>
@ -13,27 +13,39 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAcct class="acct" :user="report.targetUser" style="display: block;"/> <MkAcct class="acct" :user="report.targetUser" style="display: block;"/>
</div> </div>
</MkA> </MkA>
<br>
<div class="keyvalCtn">
<MkKeyValue> <MkKeyValue>
<template #key>{{ i18n.ts.registeredDate }}</template> <template #key>{{ i18n.ts.registeredDate }}</template>
<template #value>{{ dateString(report.targetUser.createdAt) }} (<MkTime :time="report.targetUser.createdAt"/>)</template> <template #value>{{ dateString(report.targetUser.createdAt) }} (<MkTime :time="report.targetUser.createdAt"/>)</template>
</MkKeyValue> </MkKeyValue>
<MkKeyValue>
<template #key>{{ i18n.ts.reporter }}</template>
<template #value><MkA :to="`/admin/user/${report.reporter.id}`" class="_link" :behavior="'window'">@{{ report.reporter.username }}</MkA></template>
</MkKeyValue>
<MkKeyValue>
<template #key>{{ i18n.ts.createdAt }}</template>
<template #value><MkTime :time="report.createdAt" mode="absolute"/> (<MkTime :time="report.createdAt" mode="relative"/>)</template>
</MkKeyValue>
</div>
<hr>
</div> </div>
<div class="detail"> <div class="detail">
<div> <div>
<Mfm :text="report.comment" :isBlock="true" :linkNavigationBehavior="'window'"/> <Mfm :text="report.comment" :isBlock="true" :linkNavigationBehavior="'window'"/>
</div> </div>
<hr/> <hr/>
<div>{{ i18n.ts.reporter }}: <MkA :to="`/admin/user/${report.reporter.id}`" class="_link" :behavior="'window'">@{{ report.reporter.username }}</MkA></div>
<div v-if="report.assignee"> <div v-if="report.assignee">
{{ i18n.ts.moderator }}: {{ i18n.ts.moderator }}:
<MkAcct :user="report.assignee"/> <MkA :to="`/admin/user/${report.assignee.id}`" class="_link" :behavior="'window'">@{{ report.assignee.username }}</MkA>
<br>
</div> </div>
<div><MkTime :time="report.createdAt"/></div>
<div class="action"> <div class="action">
<MkSwitch v-model="forward" :disabled="report.targetUser.host == null || report.resolved"> <MkSwitch v-model="forward" c:disabled="report.targetUser.host == null || report.resolved">
{{ i18n.ts.forwardReport }} {{ i18n.ts.forwardReport }}
<template #caption>{{ i18n.ts.forwardReportIsAnonymous }}</template> <template #caption>{{ i18n.ts.forwardReportIsAnonymous }}</template>
</MkSwitch> </MkSwitch>
<br v-if="!report.resolved">
<MkButton v-if="!report.resolved" primary @click="resolve">{{ i18n.ts.abuseMarkAsResolved }}</MkButton> <MkButton v-if="!report.resolved" primary @click="resolve">{{ i18n.ts.abuseMarkAsResolved }}</MkButton>
</div> </div>
</div> </div>
@ -58,6 +70,7 @@ const emit = defineEmits<{
}>(); }>();
const forward = ref(props.report.forwarded); const forward = ref(props.report.forwarded);
const resolved = ref(props.report.resolved);
function resolve() { function resolve() {
os.apiWithDialog('admin/resolve-abuse-user-report', { os.apiWithDialog('admin/resolve-abuse-user-report', {
@ -72,13 +85,17 @@ function resolve() {
<style lang="scss" scoped> <style lang="scss" scoped>
.bcekxzvu { .bcekxzvu {
display: flex; display: flex;
flex-direction: column;
transition: .1s;
&.resolved:not(:hover,:focus) {
opacity: 50%;
}
> .target { > .target {
width: 35%;
box-sizing: border-box; box-sizing: border-box;
text-align: left; text-align: left;
padding: 24px; padding: 24px 24px 0px 24px;
border-right: solid 1px var(--divider);
> .info { > .info {
display: flex; display: flex;
@ -100,16 +117,24 @@ function resolve() {
padding: 0 8px; padding: 0 8px;
flex: 1; flex: 1;
white-space: pre;
overflow: hidden;
> .name { > .name {
font-weight: bold; font-weight: bold;
} }
} }
} }
> .keyvalCtn {
display: inline-flex;
gap: 15px;
}
} }
> .detail { > .detail {
flex: 1; flex: 1;
padding: 24px; padding: 0px 24px 24px 24px;
} }
} }
</style> </style>