user_profile.vue 3.13 KB
Newer Older
lain's avatar
lain committed
1
<template>
HJ's avatar
HJ committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <div>
    <div
      v-if="user"
      class="user-profile panel panel-default"
    >
      <UserCard
        :user="user"
        :switcher="true"
        :selected="timeline.viewing"
        rounded="top"
      />
      <tab-switcher
        ref="tabSwitcher"
        :render-only-focused="true"
      >
        <div :label="$t('user_card.statuses')">
          <Timeline
            :count="user.statuses_count"
            :embedded="true"
            :title="$t('user_profile.timeline_title')"
            :timeline="timeline"
            :timeline-name="'user'"
            :user-id="userId"
Tae Hoon's avatar
Tae Hoon committed
25
            :pinned-status-ids="user.pinnedStatuseIds"
HJ's avatar
HJ committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
          />
        </div>
        <div
          v-if="followsTabVisible"
          :label="$t('user_card.followees')"
          :disabled="!user.friends_count"
        >
          <FriendList :user-id="userId">
            <template
              slot="item"
              slot-scope="{item}"
            >
              <FollowCard :user="item" />
            </template>
          </FriendList>
        </div>
        <div
          v-if="followersTabVisible"
          :label="$t('user_card.followers')"
          :disabled="!user.followers_count"
        >
          <FollowerList :user-id="userId">
            <template
              slot="item"
              slot-scope="{item}"
            >
              <FollowCard
                :user="item"
                :no-follows-you="isUs"
              />
            </template>
          </FollowerList>
58
        </div>
59
        <Timeline
HJ's avatar
HJ committed
60
61
          :label="$t('user_card.media')"
          :disabled="!media.visibleStatuses.length"
62
          :embedded="true"
HJ's avatar
HJ committed
63
64
65
          :title="$t('user_card.media')"
          timeline-name="media"
          :timeline="media"
66
67
          :user-id="userId"
        />
HJ's avatar
HJ committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
        <Timeline
          v-if="isUs"
          :label="$t('user_card.favorites')"
          :disabled="!favorites.visibleStatuses.length"
          :embedded="true"
          :title="$t('user_card.favorites')"
          timeline-name="favorites"
          :timeline="favorites"
        />
      </tab-switcher>
    </div>
    <div
      v-else
      class="panel user-profile-placeholder"
    >
      <div class="panel-heading">
        <div class="title">
          {{ $t('settings.profile_tab') }}
        </div>
87
      </div>
HJ's avatar
HJ committed
88
89
90
91
92
93
      <div class="panel-body">
        <span v-if="error">{{ error }}</span>
        <i
          v-else
          class="icon-spin3 animate-spin"
        />
94
95
      </div>
    </div>
lain's avatar
lain committed
96
97
98
99
  </div>
</template>

<script src="./user_profile.js"></script>
lain's avatar
lain committed
100
101
102

<style lang="scss">

103
.user-profile {
HJ's avatar
indents    
HJ committed
104
105
  flex: 2;
  flex-basis: 500px;
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

  .userlist-placeholder {
    display: flex;
    justify-content: center;
    align-items: middle;
    padding: 2em;
  }

  .timeline-heading {
    display: flex;
    justify-content: center;

    .loadmore-button, .alert {
      flex: 1;
    }

    .loadmore-button {
      height: 28px;
      margin: 10px .6em;
    }

    .title, .loadmore-text {
      display: none
    }
  }
131
}
132
133
134
135
136
137
138
139
.user-profile-placeholder {
  .panel-body {
    display: flex;
    justify-content: center;
    align-items: middle;
    padding: 7em;
  }
}
lain's avatar
lain committed
140
</style>