2019-02-25 19:51:04 -08:00
|
|
|
<template>
|
|
|
|
<basic-user-card :user="user">
|
2019-02-27 08:58:29 -08:00
|
|
|
<div class="follow-card-content-container">
|
2019-02-27 11:01:57 -08:00
|
|
|
<span class="faint" v-if="!noFollowsYou && user.follows_you">
|
2019-02-26 08:00:25 -08:00
|
|
|
{{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
|
|
|
|
</span>
|
2019-03-21 12:03:54 -07:00
|
|
|
<div class="follow-card-follow-button" v-if="showFollow && !loggedIn">
|
2019-03-19 11:36:27 -07:00
|
|
|
<RemoteFollow :user="user" />
|
|
|
|
</div>
|
2019-02-25 19:57:40 -08:00
|
|
|
<button
|
2019-03-19 11:36:27 -07:00
|
|
|
v-if="showFollow && loggedIn"
|
2019-03-21 12:03:54 -07:00
|
|
|
class="btn btn-default follow-card-follow-button"
|
2019-02-25 19:57:40 -08:00
|
|
|
@click="followUser"
|
2019-02-26 07:14:12 -08:00
|
|
|
:disabled="inProgress"
|
2019-02-25 19:57:40 -08:00
|
|
|
:title="requestSent ? $t('user_card.follow_again') : ''"
|
|
|
|
>
|
2019-02-26 07:14:12 -08:00
|
|
|
<template v-if="inProgress">
|
2019-02-25 19:57:40 -08:00
|
|
|
{{ $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>
|
2019-03-21 12:03:54 -07:00
|
|
|
<button v-if="following" class="btn btn-default follow-card-follow-button pressed" @click="unfollowUser" :disabled="inProgress">
|
2019-02-26 07:14:12 -08:00
|
|
|
<template v-if="inProgress">
|
2019-02-25 19:57:40 -08:00
|
|
|
{{ $t('user_card.follow_progress') }}
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
{{ $t('user_card.follow_unfollow') }}
|
|
|
|
</template>
|
|
|
|
</button>
|
2019-02-27 08:58:29 -08:00
|
|
|
</div>
|
2019-02-25 19:51:04 -08:00
|
|
|
</basic-user-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./follow_card.js"></script>
|
2019-02-27 08:58:29 -08:00
|
|
|
|
|
|
|
<style lang="scss">
|
2019-03-21 12:03:54 -07: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 08:58:29 -08:00
|
|
|
|
2019-03-21 12:03:54 -07:00
|
|
|
&-follow-button {
|
2019-02-27 08:58:29 -08:00
|
|
|
margin-top: 0.5em;
|
|
|
|
margin-left: auto;
|
|
|
|
width: 10em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|