follow_card.vue 1.19 KB
Newer Older
Tae Hoon's avatar
Tae Hoon committed
1
2
3
<template>
  <basic-user-card :user="user">
    <template slot="secondary-area">
Tae Hoon's avatar
Tae Hoon committed
4
5
6
7
      <button
        v-if="showFollow"
        class="btn btn-default"
        @click="followUser"
Tae Hoon's avatar
Tae Hoon committed
8
        :disabled="inProgress"
Tae Hoon's avatar
Tae Hoon committed
9
10
        :title="requestSent ? $t('user_card.follow_again') : ''"
      >
Tae Hoon's avatar
Tae Hoon committed
11
        <template v-if="inProgress">
Tae Hoon's avatar
Tae Hoon committed
12
13
14
15
16
17
18
19
20
          {{ $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>
Tae Hoon's avatar
Tae Hoon committed
21
22
      <button v-if="following" class="btn btn-default pressed" @click="unfollowUser" :disabled="inProgress">
        <template v-if="inProgress">
Tae Hoon's avatar
Tae Hoon committed
23
24
25
26
27
28
          {{ $t('user_card.follow_progress') }}
        </template>
        <template v-else>
          {{ $t('user_card.follow_unfollow') }}
        </template>
      </button>
Tae Hoon's avatar
Tae Hoon committed
29
    </template>
Tae Hoon's avatar
Tae Hoon committed
30
    <template slot="tertiary-area">
Tae Hoon's avatar
Tae Hoon committed
31
32
33
34
35
36
37
38
      <span class="faint" v-if="!noFollowsYou && user.follows_you">
        {{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
      </span>
    </template>
  </basic-user-card>
</template>

<script src="./follow_card.js"></script>