2019-02-18 14:49:32 +00:00
|
|
|
<template>
|
2019-07-11 00:59:10 +00:00
|
|
|
<div>
|
2020-02-28 16:39:47 +00:00
|
|
|
<Popover
|
2019-07-11 00:59:10 +00:00
|
|
|
trigger="click"
|
2019-07-11 12:33:10 +00:00
|
|
|
class="moderation-tools-popover"
|
2020-02-28 16:39:47 +00:00
|
|
|
placement="bottom"
|
|
|
|
:offset="{ y: 5 }"
|
|
|
|
@show="setToggled(true)"
|
|
|
|
@close="setToggled(false)"
|
2019-07-11 00:59:10 +00:00
|
|
|
>
|
2021-04-07 19:42:34 +00:00
|
|
|
<template v-slot:content>
|
2019-07-11 00:59:10 +00:00
|
|
|
<div class="dropdown-menu">
|
|
|
|
<span v-if="user.is_local">
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2022-08-17 08:41:36 +00:00
|
|
|
@click="toggleRight('admin')"
|
2019-07-11 00:59:10 +00:00
|
|
|
>
|
|
|
|
{{ $t(!!user.rights.admin ? 'user_card.admin_menu.revoke_admin' : 'user_card.admin_menu.grant_admin') }}
|
|
|
|
</button>
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2022-08-17 08:41:36 +00:00
|
|
|
@click="toggleRight('moderator')"
|
2019-07-11 00:59:10 +00:00
|
|
|
>
|
|
|
|
{{ $t(!!user.rights.moderator ? 'user_card.admin_menu.revoke_moderator' : 'user_card.admin_menu.grant_moderator') }}
|
|
|
|
</button>
|
|
|
|
<div
|
|
|
|
role="separator"
|
|
|
|
class="dropdown-divider"
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleActivationStatus()"
|
|
|
|
>
|
|
|
|
{{ $t(!!user.deactivated ? 'user_card.admin_menu.activate_account' : 'user_card.admin_menu.deactivate_account') }}
|
2019-02-18 14:49:32 +00:00
|
|
|
</button>
|
2019-07-11 00:59:10 +00:00
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="deleteUserDialog(true)"
|
|
|
|
>
|
|
|
|
{{ $t('user_card.admin_menu.delete_account') }}
|
2019-02-18 14:49:32 +00:00
|
|
|
</button>
|
2019-07-11 00:59:10 +00:00
|
|
|
<div
|
|
|
|
v-if="hasTagPolicy"
|
|
|
|
role="separator"
|
|
|
|
class="dropdown-divider"
|
|
|
|
/>
|
|
|
|
<span v-if="hasTagPolicy">
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.FORCE_NSFW)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.FORCE_NSFW) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.force_nsfw') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.STRIP_MEDIA)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.STRIP_MEDIA) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.strip_media') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.FORCE_UNLISTED)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.FORCE_UNLISTED) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.force_unlisted') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.SANDBOX)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.SANDBOX) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.sandbox') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
v-if="user.is_local"
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.DISABLE_REMOTE_SUBSCRIPTION)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.DISABLE_REMOTE_SUBSCRIPTION) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.disable_remote_subscription') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
v-if="user.is_local"
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.DISABLE_ANY_SUBSCRIPTION)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.DISABLE_ANY_SUBSCRIPTION) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.disable_any_subscription') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
v-if="user.is_local"
|
2020-11-25 16:33:08 +00:00
|
|
|
class="button-default dropdown-item"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="toggleTag(tags.QUARANTINE)"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="menu-checkbox"
|
|
|
|
:class="{ 'menu-checkbox-checked': hasTag(tags.QUARANTINE) }"
|
|
|
|
/>
|
2021-02-25 08:56:16 +00:00
|
|
|
{{ $t('user_card.admin_menu.quarantine') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</div>
|
2021-04-07 19:42:34 +00:00
|
|
|
</template>
|
|
|
|
<template v-slot:trigger>
|
|
|
|
<button
|
|
|
|
class="btn button-default btn-block moderation-tools-button"
|
|
|
|
:class="{ toggled }"
|
|
|
|
>
|
|
|
|
{{ $t('user_card.admin_menu.moderation') }}
|
|
|
|
<FAIcon icon="chevron-down" />
|
|
|
|
</button>
|
|
|
|
</template>
|
2020-02-28 16:39:47 +00:00
|
|
|
</Popover>
|
2021-04-25 10:45:47 +00:00
|
|
|
<teleport to="#modal">
|
2019-07-11 00:59:10 +00:00
|
|
|
<DialogModal
|
|
|
|
v-if="showDeleteUserDialog"
|
|
|
|
:on-cancel="deleteUserDialog.bind(this, false)"
|
|
|
|
>
|
2021-04-07 19:42:34 +00:00
|
|
|
<template v-slot:header>
|
2019-04-26 04:39:43 +00:00
|
|
|
{{ $t('user_card.admin_menu.delete_user') }}
|
2019-07-11 00:59:10 +00:00
|
|
|
</template>
|
|
|
|
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
|
2021-04-07 19:42:34 +00:00
|
|
|
<template v-slot:footer>
|
2019-07-11 00:59:10 +00:00
|
|
|
<button
|
2020-11-24 10:32:42 +00:00
|
|
|
class="btn button-default"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="deleteUserDialog(false)"
|
|
|
|
>
|
|
|
|
{{ $t('general.cancel') }}
|
|
|
|
</button>
|
|
|
|
<button
|
2020-11-24 10:32:42 +00:00
|
|
|
class="btn button-default danger"
|
2019-07-11 00:59:10 +00:00
|
|
|
@click="deleteUser()"
|
|
|
|
>
|
|
|
|
{{ $t('user_card.admin_menu.delete_user') }}
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
</DialogModal>
|
2021-04-25 10:45:47 +00:00
|
|
|
</teleport>
|
2019-07-11 00:59:10 +00:00
|
|
|
</div>
|
2019-02-18 14:49:32 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./moderation_tools.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2019-07-11 12:33:10 +00:00
|
|
|
.moderation-tools-popover {
|
|
|
|
height: 100%;
|
2022-08-17 08:41:36 +00:00
|
|
|
z-index: 999;
|
2019-07-11 12:33:10 +00:00
|
|
|
.trigger {
|
|
|
|
display: flex !important;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
2021-03-15 14:41:34 +00:00
|
|
|
|
|
|
|
.moderation-tools-button {
|
|
|
|
svg,i {
|
|
|
|
font-size: 0.8em;
|
|
|
|
}
|
|
|
|
}
|
2019-02-18 14:49:32 +00:00
|
|
|
</style>
|