2020-01-29 21:37:25 +02:00
|
|
|
<template>
|
2020-02-15 01:42:21 +02:00
|
|
|
<div>
|
|
|
|
<portal to="icon"><fa :icon="faUserClock"/></portal>
|
2020-07-24 19:56:52 +03:00
|
|
|
<portal to="title">{{ $t('followRequests') }}</portal>
|
2020-02-15 01:42:21 +02:00
|
|
|
|
|
|
|
<mk-pagination :pagination="pagination" class="mk-follow-requests" ref="list">
|
|
|
|
<template #empty>
|
2020-03-28 12:33:11 +02:00
|
|
|
<div class="_fullinfo">
|
2020-03-23 12:06:46 +02:00
|
|
|
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
|
2020-07-24 19:56:52 +03:00
|
|
|
<div>{{ $t('noFollowRequests') }}</div>
|
2020-01-29 21:37:25 +02:00
|
|
|
</div>
|
2020-02-15 01:42:21 +02:00
|
|
|
</template>
|
|
|
|
<template #default="{items}">
|
|
|
|
<div class="user _panel" v-for="req in items" :key="req.id">
|
|
|
|
<mk-avatar class="avatar" :user="req.follower"/>
|
|
|
|
<div class="body">
|
|
|
|
<div class="name">
|
|
|
|
<router-link class="name" :to="req.follower | userPage" v-user-preview="req.follower.id"><mk-user-name :user="req.follower"/></router-link>
|
|
|
|
<p class="acct">@{{ req.follower | acct }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="description" v-if="req.follower.description" :title="req.follower.description">
|
|
|
|
<mfm :text="req.follower.description" :is-note="false" :author="req.follower" :i="$store.state.i" :custom-emojis="req.follower.emojis" :plain="true" :nowrap="true"/>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<button class="_button" @click="accept(req.follower)"><fa :icon="faCheck"/></button>
|
|
|
|
<button class="_button" @click="reject(req.follower)"><fa :icon="faTimes"/></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-29 21:37:25 +02:00
|
|
|
</div>
|
2020-02-15 01:42:21 +02:00
|
|
|
</template>
|
|
|
|
</mk-pagination>
|
|
|
|
</div>
|
2020-01-29 21:37:25 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2020-02-15 01:42:21 +02:00
|
|
|
import { faUserClock, faCheck, faTimes } from '@fortawesome/free-solid-svg-icons';
|
2020-01-29 21:37:25 +02:00
|
|
|
import MkPagination from '../components/ui/pagination.vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
metaInfo() {
|
|
|
|
return {
|
|
|
|
title: this.$t('followRequests') as string
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
components: {
|
|
|
|
MkPagination
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
pagination: {
|
|
|
|
endpoint: 'following/requests/list',
|
|
|
|
limit: 10,
|
|
|
|
},
|
2020-02-15 01:42:21 +02:00
|
|
|
faCheck, faTimes, faUserClock
|
2020-01-29 21:37:25 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
accept(user) {
|
|
|
|
this.$root.api('following/requests/accept', { userId: user.id }).then(() => {
|
|
|
|
this.$refs.list.reload();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
reject(user) {
|
|
|
|
this.$root.api('following/requests/reject', { userId: user.id }).then(() => {
|
|
|
|
this.$refs.list.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mk-follow-requests {
|
|
|
|
> .user {
|
|
|
|
display: flex;
|
|
|
|
padding: 16px;
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
display: block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin: 0 12px 0 0;
|
|
|
|
width: 42px;
|
|
|
|
height: 42px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
display: flex;
|
|
|
|
width: calc(100% - 54px);
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
width: 45%;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .name,
|
|
|
|
> .acct {
|
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
font-size: 16px;
|
|
|
|
line-height: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .acct {
|
|
|
|
font-size: 15px;
|
|
|
|
line-height: 16px;
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .description {
|
|
|
|
width: 55%;
|
|
|
|
line-height: 42px;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
opacity: 0.7;
|
|
|
|
font-size: 14px;
|
|
|
|
padding-right: 40px;
|
|
|
|
padding-left: 8px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .actions {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: auto 0;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|