user_profile.vue 3.56 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
25
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
58
59
60
61
62
63
64
65
66
67
68
  <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')">
          <div class="timeline">
            <template v-for="statusId in user.pinnedStatuseIds">
              <Conversation
                v-if="timeline.statusesObject[statusId]"
                :key="statusId"
                class="status-fadein"
                :statusoid="timeline.statusesObject[statusId]"
                :collapsable="true"
                :show-pinned="true"
              />
            </template>
          </div>
          <Timeline
            :count="user.statuses_count"
            :embedded="true"
            :title="$t('user_profile.timeline_title')"
            :timeline="timeline"
            :timeline-name="'user'"
            :user-id="userId"
          />
        </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>
69
        </div>
70
        <Timeline
HJ's avatar
HJ committed
71
72
          :label="$t('user_card.media')"
          :disabled="!media.visibleStatuses.length"
73
          :embedded="true"
HJ's avatar
HJ committed
74
75
76
          :title="$t('user_card.media')"
          timeline-name="media"
          :timeline="media"
77
          :user-id="userId"
78
          :excludedStatusIds="user.pinnedStatuseIds"
79
        />
HJ's avatar
HJ committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
        <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>
99
      </div>
HJ's avatar
HJ committed
100
101
102
103
104
105
      <div class="panel-body">
        <span v-if="error">{{ error }}</span>
        <i
          v-else
          class="icon-spin3 animate-spin"
        />
106
107
      </div>
    </div>
lain's avatar
lain committed
108
109
110
111
  </div>
</template>

<script src="./user_profile.js"></script>
lain's avatar
lain committed
112
113
114

<style lang="scss">

115
.user-profile {
HJ's avatar
indents    
HJ committed
116
117
  flex: 2;
  flex-basis: 500px;
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

  .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
    }
  }
143
}
144
145
146
147
148
149
150
151
.user-profile-placeholder {
  .panel-body {
    display: flex;
    justify-content: center;
    align-items: middle;
    padding: 7em;
  }
}
lain's avatar
lain committed
152
</style>