mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue * change modal action names from show::modal to bv::show::modal * check if drops are undefined * fix modal widths - sellModal now using input instead of dropbox * upgrade to bootstrap 4.0beta * include package-lock changes * fix app menu dropdown position * upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position * fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width) * show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ ) * fix package-lock? * fix active button style / app header toggle button * fix package-lock ! * update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable * mixin naming style * fix buyQuestModal marginTop * fix customMenuDropdown position * fix userDropdown items
76 lines
2.3 KiB
Vue
76 lines
2.3 KiB
Vue
<template lang="pug">
|
|
b-modal#report-flag(:title='$t("abuseFlagModalHeading")', size='lg', :hide-footer='true')
|
|
.modal-header
|
|
h4(v-html="$t('abuseFlagModalHeading', reportData)")
|
|
.modal-body
|
|
blockquote
|
|
div(v-markdown='abuseObject.text')
|
|
p(v-html="$t('abuseFlagModalBody', abuseFlagModalBody)")
|
|
.modal-footer
|
|
button.pull-left.btn.btn-danger(@click='clearFlagCount()', v-if='user.contributor.admin && abuseObject.flagCount > 0')
|
|
| Reset Flag Count
|
|
button.btn.btn-primary(@click='close()') {{ $t('cancel') }}
|
|
button.btn.btn-danger(@click='reportAbuse()') {{ $t('abuseFlagModalButton') }}
|
|
</template>
|
|
|
|
<script>
|
|
import { mapState } from 'client/libs/store';
|
|
import notifications from 'client/mixins/notifications';
|
|
import markdownDirective from 'client/directives/markdown';
|
|
|
|
export default {
|
|
mixins: [notifications],
|
|
directives: {
|
|
markdown: markdownDirective,
|
|
},
|
|
computed: {
|
|
...mapState({user: 'user.data'}),
|
|
reportData () {
|
|
let reportMessage = this.abuseObject.user;
|
|
let isSystemMessage = this.abuseObject.uuid === 'system';
|
|
if (isSystemMessage) reportMessage = this.$t('systemMessage');
|
|
return {
|
|
name: `<span class='text-danger'>${reportMessage}</span>`,
|
|
};
|
|
},
|
|
abuseObject () {
|
|
return this.$store.state.flagChatOptions.message;
|
|
},
|
|
groupId () {
|
|
return this.$store.state.flagChatOptions.groupId;
|
|
},
|
|
},
|
|
data () {
|
|
let abuseFlagModalBody = {
|
|
firstLinkStart: '<a href="/static/community-guidelines" target="_blank">',
|
|
secondLinkStart: '<a href="/static/terms" target="_blank">',
|
|
linkEnd: '</a>',
|
|
};
|
|
|
|
return {
|
|
abuseFlagModalBody,
|
|
};
|
|
},
|
|
methods: {
|
|
close () {
|
|
this.$root.$emit('bv::hide::modal', 'report-flag');
|
|
},
|
|
async reportAbuse () {
|
|
this.notify('Thank you for reporting this violation. The moderators have been notified.');
|
|
await this.$store.dispatch('chat:flag', {
|
|
groupId: this.groupId,
|
|
chatId: this.abuseObject.id,
|
|
});
|
|
this.close();
|
|
},
|
|
async clearFlagCount () {
|
|
await this.$store.dispatch('chat:clearFlagCount', {
|
|
groupId: this.groupId,
|
|
chatId: this.abuseObject.id,
|
|
});
|
|
this.close();
|
|
},
|
|
},
|
|
};
|
|
</script>
|