pleroma-fe/src/components/extra_buttons/extra_buttons.vue

155 lines
4.1 KiB
Vue
Raw Normal View History

<template>
2020-02-28 16:39:47 +00:00
<Popover
class="ExtraButtons"
trigger="click"
2019-07-11 15:01:12 +00:00
placement="top"
:offset="{ y: 5 }"
:bound-to="{ x: 'container' }"
remove-padding
>
2021-04-07 19:42:34 +00:00
<template v-slot:content="{close}">
2019-05-26 21:13:08 +00:00
<div class="dropdown-menu">
<button
v-if="canMute && !status.thread_muted"
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="muteConversation"
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="eye-slash"
/><span>{{ $t("status.mute_conversation") }}</span>
</button>
<button
v-if="canMute && status.thread_muted"
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="unmuteConversation"
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="eye-slash"
/><span>{{ $t("status.unmute_conversation") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="!status.pinned && canPin"
class="button-default dropdown-item dropdown-item-icon"
2019-07-05 07:17:44 +00:00
@click.prevent="pinStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="thumbtack"
/><span>{{ $t("status.pin") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="status.pinned && canPin"
class="button-default dropdown-item dropdown-item-icon"
2019-07-05 07:17:44 +00:00
@click.prevent="unpinStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="thumbtack"
/><span>{{ $t("status.unpin") }}</span>
</button>
<button
v-if="!status.bookmarked"
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="bookmarkStatus"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
:icon="['far', 'bookmark']"
/><span>{{ $t("status.bookmark") }}</span>
</button>
<button
v-if="status.bookmarked"
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="unbookmarkStatus"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="bookmark"
/><span>{{ $t("status.unbookmark") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="canDelete"
class="button-default dropdown-item dropdown-item-icon"
2019-07-05 07:17:44 +00:00
@click.prevent="deleteStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="times"
/><span>{{ $t("status.delete") }}</span>
</button>
<button
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="copyLink"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
fixed-width
icon="share-alt"
/><span>{{ $t("status.copy_link") }}</span>
</button>
<a
v-if="!status.is_local"
class="button-default dropdown-item dropdown-item-icon"
title="Source"
:href="status.external_url"
target="_blank"
>
<FAIcon
fixed-width
icon="external-link-alt"
/><span>{{ $t("status.external_source") }}</span>
</a>
<button
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="reportStatus"
@click="close"
>
<FAIcon
fixed-width
:icon="['far', 'flag']"
/><span>{{ $t("user_card.report") }}</span>
</button>
</div>
2021-04-07 19:42:34 +00:00
</template>
<template v-slot:trigger>
<button class="button-unstyled popover-trigger">
<FAIcon
class="fa-scale-110 fa-old-padding"
icon="ellipsis-h"
/>
</button>
</template>
2020-02-28 16:39:47 +00:00
</Popover>
</template>
<script src="./extra_buttons.js" ></script>
<style lang="scss">
@import '../../_variables.scss';
.ExtraButtons {
/* override of popover internal stuff */
.popover-trigger-button {
width: auto;
}
.popover-trigger {
position: static;
padding: 10px;
margin: -10px;
&:hover .svg-inline--fa {
color: $fallback--text;
color: var(--text, $fallback--text);
}
}
}
</style>