2019-09-09 07:31:08 +00:00
|
|
|
<template>
|
2020-02-18 07:57:00 +00:00
|
|
|
<div class="modal-card">
|
|
|
|
<header class="modal-card-head" v-if="title">
|
|
|
|
<p class="modal-card-title">{{ title }}</p>
|
|
|
|
</header>
|
|
|
|
|
2020-11-30 09:24:11 +00:00
|
|
|
<section
|
|
|
|
class="modal-card-body is-flex"
|
|
|
|
:class="{ 'is-titleless': !title }"
|
|
|
|
>
|
2020-02-18 07:57:00 +00:00
|
|
|
<div class="media">
|
|
|
|
<div class="media-left">
|
|
|
|
<b-icon icon="alert" type="is-warning" size="is-large" />
|
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
|
|
|
<div class="box" v-if="comment">
|
|
|
|
<article class="media">
|
|
|
|
<div class="media-left">
|
|
|
|
<figure class="image is-48x48" v-if="comment.actor.avatar">
|
|
|
|
<img :src="comment.actor.avatar.url" alt="Image" />
|
|
|
|
</figure>
|
2020-11-30 09:24:11 +00:00
|
|
|
<b-icon
|
|
|
|
class="media-left"
|
|
|
|
v-else
|
|
|
|
size="is-large"
|
|
|
|
icon="account-circle"
|
|
|
|
/>
|
2020-02-18 07:57:00 +00:00
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
|
|
|
<div class="content">
|
|
|
|
<strong>{{ comment.actor.name }}</strong>
|
|
|
|
<small>@{{ comment.actor.preferredUsername }}</small>
|
|
|
|
<br />
|
|
|
|
<p v-html="comment.text"></p>
|
2019-09-09 07:31:08 +00:00
|
|
|
</div>
|
2020-02-18 07:57:00 +00:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"The report will be sent to the moderators of your instance. You can explain why you report this content below."
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="control">
|
|
|
|
<b-input
|
|
|
|
v-model="content"
|
|
|
|
type="textarea"
|
|
|
|
@keyup.enter="confirm"
|
|
|
|
:placeholder="$t('Additional comments')"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="control" v-if="outsideDomain">
|
|
|
|
<p>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"The content came from another server. Transfer an anonymous copy of the report?"
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
<b-switch v-model="forward">{{
|
|
|
|
$t("Transfer to {outsideDomain}", { outsideDomain })
|
|
|
|
}}</b-switch>
|
|
|
|
</div>
|
2019-09-09 07:31:08 +00:00
|
|
|
</div>
|
2020-02-18 07:57:00 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<button class="button" ref="cancelButton" @click="close">
|
|
|
|
{{ translatedCancelText }}
|
|
|
|
</button>
|
|
|
|
<button class="button is-primary" ref="confirmButton" @click="confirm">
|
|
|
|
{{ translatedConfirmText }}
|
|
|
|
</button>
|
|
|
|
</footer>
|
|
|
|
</div>
|
2019-09-09 07:31:08 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 07:57:00 +00:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
|
|
import { IComment } from "../../types/comment.model";
|
2019-09-09 07:31:08 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
mounted() {
|
|
|
|
this.$data.isActive = true;
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class ReportModal extends Vue {
|
2020-11-30 09:24:11 +00:00
|
|
|
@Prop({ type: Function }) onConfirm!: (
|
|
|
|
content: string,
|
|
|
|
forward: boolean
|
|
|
|
) => void;
|
2020-02-18 07:57:00 +00:00
|
|
|
|
|
|
|
@Prop({ type: String }) title!: string;
|
|
|
|
|
2019-11-15 17:36:47 +00:00
|
|
|
@Prop({ type: Object }) comment!: IComment;
|
2019-09-09 07:31:08 +00:00
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
@Prop({ type: String, default: "" }) outsideDomain!: string;
|
|
|
|
|
|
|
|
@Prop({ type: String }) cancelText!: string;
|
|
|
|
|
|
|
|
@Prop({ type: String }) confirmText!: string;
|
|
|
|
|
|
|
|
isActive = false;
|
|
|
|
|
|
|
|
content = "";
|
|
|
|
|
|
|
|
forward = false;
|
2019-09-09 07:31:08 +00:00
|
|
|
|
2020-09-30 13:25:30 +00:00
|
|
|
get translatedCancelText(): string {
|
|
|
|
return this.cancelText || (this.$t("Cancel") as string);
|
2019-09-20 16:22:03 +00:00
|
|
|
}
|
|
|
|
|
2020-09-30 13:25:30 +00:00
|
|
|
get translatedConfirmText(): string {
|
|
|
|
return this.confirmText || (this.$t("Send the report") as string);
|
2019-09-20 16:22:03 +00:00
|
|
|
}
|
|
|
|
|
2020-09-30 13:25:30 +00:00
|
|
|
confirm(): void {
|
2019-09-09 07:31:08 +00:00
|
|
|
this.onConfirm(this.content, this.forward);
|
|
|
|
this.close();
|
|
|
|
}
|
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
/**
|
|
|
|
* Close the Dialog.
|
|
|
|
*/
|
2020-09-30 13:25:30 +00:00
|
|
|
close(): void {
|
2019-09-09 07:31:08 +00:00
|
|
|
this.isActive = false;
|
2020-02-18 07:57:00 +00:00
|
|
|
this.$emit("close");
|
2019-09-09 07:31:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2019-11-15 17:36:47 +00:00
|
|
|
<style lang="scss" scoped>
|
2020-02-18 07:57:00 +00:00
|
|
|
.modal-card .modal-card-foot {
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
.modal-card-body {
|
|
|
|
.media-content {
|
|
|
|
.box {
|
|
|
|
.media {
|
|
|
|
padding-top: 0;
|
|
|
|
border-top: none;
|
|
|
|
}
|
2019-09-09 07:31:08 +00:00
|
|
|
}
|
2019-11-15 17:36:47 +00:00
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
& > p {
|
|
|
|
margin-bottom: 2rem;
|
2019-11-15 17:36:47 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-15 17:36:47 +00:00
|
|
|
</style>
|