From dbe2decc59d9e61a630b242edebe36c0669732c1 Mon Sep 17 00:00:00 2001 From: taehoon <th.dev91@gmail.com> Date: Thu, 25 Apr 2019 23:32:56 -0400 Subject: [PATCH] clean up UserCard template --- src/components/user_card/user_card.vue | 63 ++++++++++++-------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5d23bf1e..89b20e77 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -45,34 +45,29 @@ </label> </div> </div> - <div v-if="isOtherUser" class="user-interactions"> - <div class="follow" v-if="loggedIn"> - <span v-if="user.following"> - <!--Following them!--> - <button @click="unfollowUser" class="pressed" :disabled="followRequestInProgress" :title="$t('user_card.follow_unfollow')"> - <template v-if="followRequestInProgress"> - {{ $t('user_card.follow_progress') }} - </template> - <template v-else> - {{ $t('user_card.following') }} - </template> - </button> - </span> - <span v-if="!user.following"> - <button @click="followUser" :disabled="followRequestInProgress" :title="followRequestSent ? $t('user_card.follow_again') : ''"> - <template v-if="followRequestInProgress"> - {{ $t('user_card.follow_progress') }} - </template> - <template v-else-if="followRequestSent"> - {{ $t('user_card.follow_sent') }} - </template> - <template v-else> - {{ $t('user_card.follow') }} - </template> - </button> - </span> + <div v-if="loggedIn && isOtherUser" class="user-interactions"> + <div class="follow"> + <button @click="unfollowUser" class="pressed" :disabled="followRequestInProgress" :title="$t('user_card.follow_unfollow')" v-if="user.following"> + <template v-if="followRequestInProgress"> + {{ $t('user_card.follow_progress') }} + </template> + <template v-else> + {{ $t('user_card.following') }} + </template> + </button> + <button @click="followUser" :disabled="followRequestInProgress" :title="followRequestSent ? $t('user_card.follow_again') : ''" v-else> + <template v-if="followRequestInProgress"> + {{ $t('user_card.follow_progress') }} + </template> + <template v-else-if="followRequestSent"> + {{ $t('user_card.follow_sent') }} + </template> + <template v-else> + {{ $t('user_card.follow') }} + </template> + </button> </div> - <div v-if="loggedIn"> + <div> <ProgressButton :click="subscribeUser" v-if="!user.subscribed"> {{ $t('user_card.subscribe') }} </ProgressButton> @@ -80,7 +75,7 @@ {{ $t('user_card.subscribed') }} </ProgressButton> </div> - <div class='mute' v-if='isOtherUser && loggedIn'> + <div class='mute'> <span v-if='user.muted'> <button @click="unmuteUser" class="pressed"> {{ $t('user_card.muted') }} @@ -92,10 +87,7 @@ </button> </span> </div> - <div v-if='!loggedIn && user.is_local'> - <RemoteFollow :user="user" /> - </div> - <div class='block' v-if='isOtherUser && loggedIn'> + <div class='block'> <span v-if='user.statusnet_blocking'> <button @click="unblockUser" class="pressed"> {{ $t('user_card.blocked') }} @@ -107,14 +99,17 @@ </button> </span> </div> - <div class='block' v-if='isOtherUser && loggedIn'> + <div class='block'> <span> <button @click="reportUser"> {{ $t('user_card.report') }} </button> </span> </div> - <ModerationTools :user='user' v-if='loggedIn.role === "admin"'/> + <ModerationTools :user='user' v-if='loggedIn.role === "admin"' /> + </div> + <div class="user-interactions" v-if="!loggedIn && user.is_local"> + <RemoteFollow :user="user" /> </div> </div> </div>