2019-09-09 09:31:08 +02:00
|
|
|
<template>
|
2020-06-25 11:36:35 +02:00
|
|
|
<div>
|
|
|
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
|
|
<ul>
|
|
|
|
<li>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link :to="{ name: RouteName.MODERATION }">{{
|
|
|
|
$t("Moderation")
|
|
|
|
}}</router-link>
|
2020-06-25 11:36:35 +02:00
|
|
|
</li>
|
|
|
|
<li class="is-active">
|
|
|
|
<router-link :to="{ name: RouteName.REPORT_LOGS }">{{
|
|
|
|
$t("Moderation log")
|
|
|
|
}}</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<section>
|
|
|
|
<ul v-if="actionLogs.length > 0">
|
|
|
|
<li v-for="log in actionLogs" :key="log.id">
|
|
|
|
<div class="box">
|
2020-11-30 10:24:11 +01:00
|
|
|
<img
|
|
|
|
class="image"
|
|
|
|
:src="log.actor.avatar.url"
|
|
|
|
v-if="log.actor.avatar"
|
|
|
|
/>
|
2020-06-25 11:36:35 +02:00
|
|
|
<i18n
|
|
|
|
v-if="log.action === ActionLogAction.REPORT_UPDATE_CLOSED"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} closed {report}"
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.REPORT,
|
|
|
|
params: { reportId: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
slot="report"
|
2020-11-30 10:24:11 +01:00
|
|
|
>{{
|
|
|
|
$t("report #{report_number}", {
|
|
|
|
report_number: log.object.id,
|
|
|
|
})
|
|
|
|
}}
|
2020-06-25 11:36:35 +02:00
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.REPORT_UPDATE_OPENED"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} reopened {report}"
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.REPORT,
|
|
|
|
params: { reportId: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
slot="report"
|
2020-11-30 10:24:11 +01:00
|
|
|
>{{
|
|
|
|
$t("report #{report_number}", {
|
|
|
|
report_number: log.object.id,
|
|
|
|
})
|
|
|
|
}}
|
2020-06-25 11:36:35 +02:00
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.REPORT_UPDATE_RESOLVED"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} marked {report} as resolved"
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.REPORT,
|
|
|
|
params: { reportId: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
slot="report"
|
2020-11-30 10:24:11 +01:00
|
|
|
>{{
|
|
|
|
$t("report #{report_number}", {
|
|
|
|
report_number: log.object.id,
|
|
|
|
})
|
|
|
|
}}
|
2020-06-25 11:36:35 +02:00
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.NOTE_CREATION"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} added a note on {report}"
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
v-if="log.object.report"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.REPORT,
|
|
|
|
params: { reportId: log.object.report.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
slot="report"
|
2020-11-30 10:24:11 +01:00
|
|
|
>{{
|
|
|
|
$t("report #{report_number}", {
|
|
|
|
report_number: log.object.report.id,
|
|
|
|
})
|
|
|
|
}}
|
2020-06-25 11:36:35 +02:00
|
|
|
</router-link>
|
2020-11-30 10:24:11 +01:00
|
|
|
<span v-else slot="report">{{
|
|
|
|
$t("a non-existent report")
|
|
|
|
}}</span>
|
2020-06-25 11:36:35 +02:00
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.EVENT_DELETION"
|
|
|
|
tag="span"
|
|
|
|
path='{moderator} deleted an event named "{title}"'
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<b slot="title">{{ log.object.title }}</b>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.ACTOR_SUSPENSION"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} suspended profile {profile}"
|
2020-06-11 19:13:21 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
slot="profile"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>{{ displayNameAndUsername(log.object) }}
|
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.ACTOR_UNSUSPENSION"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} has unsuspended profile {profile}"
|
2020-06-15 19:41:11 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
slot="profile"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>{{ displayNameAndUsername(log.object) }}
|
|
|
|
</router-link>
|
|
|
|
</i18n>
|
|
|
|
<i18n
|
|
|
|
v-else-if="log.action === ActionLogAction.USER_DELETION"
|
|
|
|
tag="span"
|
|
|
|
path="{moderator} has deleted user {user}"
|
2020-06-15 19:41:11 +02:00
|
|
|
>
|
2020-06-25 11:36:35 +02:00
|
|
|
<router-link
|
|
|
|
slot="moderator"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_PROFILE,
|
|
|
|
params: { id: log.actor.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>@{{ log.actor.preferredUsername }}</router-link
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
v-if="log.object.confirmedAt"
|
|
|
|
slot="user"
|
2020-11-30 10:24:11 +01:00
|
|
|
:to="{
|
|
|
|
name: RouteName.ADMIN_USER_PROFILE,
|
|
|
|
params: { id: log.object.id },
|
|
|
|
}"
|
2020-06-25 11:36:35 +02:00
|
|
|
>{{ log.object.email }}
|
|
|
|
</router-link>
|
|
|
|
<b v-else slot="user">{{ log.object.email }}</b>
|
|
|
|
</i18n>
|
|
|
|
<br />
|
|
|
|
<small>{{ log.insertedAt | formatDateTimeString }}</small>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div v-else>
|
|
|
|
<b-message type="is-info">{{ $t("No moderation logs yet") }}</b-message>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
2019-09-09 09:31:08 +02:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Vue } from "vue-property-decorator";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IActionLog } from "@/types/report.model";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { LOGS } from "@/graphql/report";
|
|
|
|
import ReportCard from "@/components/Report/ReportCard.vue";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { ActionLogAction } from "@/types/enums";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2020-06-11 19:13:21 +02:00
|
|
|
import { displayNameAndUsername } from "../../types/actor";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
ReportCard,
|
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
actionLogs: {
|
2020-08-27 11:53:24 +02:00
|
|
|
fetchPolicy: "cache-and-network",
|
2019-09-09 09:31:08 +02:00
|
|
|
query: LOGS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class ReportList extends Vue {
|
|
|
|
actionLogs?: IActionLog[] = [];
|
|
|
|
|
|
|
|
ActionLogAction = ActionLogAction;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-10-03 12:32:20 +02:00
|
|
|
RouteName = RouteName;
|
2020-06-11 19:13:21 +02:00
|
|
|
|
|
|
|
displayNameAndUsername = displayNameAndUsername;
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
|
|
|
</script>
|
2019-12-03 11:29:51 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
img.image {
|
2020-06-09 14:55:48 +02:00
|
|
|
display: inline-block;
|
2020-02-18 08:57:00 +01:00
|
|
|
height: 1.5em;
|
|
|
|
vertical-align: text-bottom;
|
|
|
|
}
|
2020-06-17 15:54:24 +02:00
|
|
|
|
|
|
|
a {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
</style>
|