2019-02-26 03:51:04 +00:00
|
|
|
<template>
|
|
|
|
<basic-user-card :user="user">
|
2019-02-27 16:58:29 +00:00
|
|
|
<div class="follow-card-content-container">
|
2019-02-27 19:01:57 +00:00
|
|
|
<span class="faint" v-if="!noFollowsYou && user.follows_you">
|
2019-02-26 16:00:25 +00:00
|
|
|
{{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
|
|
|
|
</span>
|
2019-04-11 20:34:46 +00:00
|
|
|
<template v-if="!loggedIn">
|
|
|
|
<div class="follow-card-follow-button" v-if="!user.following">
|
|
|
|
<RemoteFollow :user="user" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<button
|
|
|
|
v-if="!user.following"
|
|
|
|
class="btn btn-default follow-card-follow-button"
|
|
|
|
@click="followUser"
|
|
|
|
:disabled="inProgress"
|
|
|
|
:title="requestSent ? $t('user_card.follow_again') : ''"
|
|
|
|
>
|
|
|
|
<template v-if="inProgress">
|
|
|
|
{{ $t('user_card.follow_progress') }}
|
|
|
|
</template>
|
|
|
|
<template v-else-if="requestSent">
|
|
|
|
{{ $t('user_card.follow_sent') }}
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
{{ $t('user_card.follow') }}
|
|
|
|
</template>
|
|
|
|
</button>
|
|
|
|
<button v-else class="btn btn-default follow-card-follow-button pressed" @click="unfollowUser" :disabled="inProgress">
|
|
|
|
<template v-if="inProgress">
|
|
|
|
{{ $t('user_card.follow_progress') }}
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
{{ $t('user_card.follow_unfollow') }}
|
|
|
|
</template>
|
|
|
|
</button>
|
|
|
|
</template>
|
2019-02-27 16:58:29 +00:00
|
|
|
</div>
|
2019-02-26 03:51:04 +00:00
|
|
|
</basic-user-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./follow_card.js"></script>
|
2019-02-27 16:58:29 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
2019-03-21 19:03:54 +00:00
|
|
|
.follow-card {
|
|
|
|
&-content-container {
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
line-height: 1.5em;
|
|
|
|
}
|
2019-02-27 16:58:29 +00:00
|
|
|
|
2019-03-21 19:03:54 +00:00
|
|
|
&-follow-button {
|
2019-02-27 16:58:29 +00:00
|
|
|
margin-top: 0.5em;
|
|
|
|
margin-left: auto;
|
|
|
|
width: 10em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|