clean up UserCard template

This commit is contained in:
taehoon 2019-04-25 23:32:56 -04:00
parent 3b9ab0e343
commit dbe2decc59

View file

@ -45,34 +45,29 @@
</label> </label>
</div> </div>
</div> </div>
<div v-if="isOtherUser" class="user-interactions"> <div v-if="loggedIn && isOtherUser" class="user-interactions">
<div class="follow" v-if="loggedIn"> <div class="follow">
<span v-if="user.following"> <button @click="unfollowUser" class="pressed" :disabled="followRequestInProgress" :title="$t('user_card.follow_unfollow')" v-if="user.following">
<!--Following them!--> <template v-if="followRequestInProgress">
<button @click="unfollowUser" class="pressed" :disabled="followRequestInProgress" :title="$t('user_card.follow_unfollow')"> {{ $t('user_card.follow_progress') }}
<template v-if="followRequestInProgress"> </template>
{{ $t('user_card.follow_progress') }} <template v-else>
</template> {{ $t('user_card.following') }}
<template v-else> </template>
{{ $t('user_card.following') }} </button>
</template> <button @click="followUser" :disabled="followRequestInProgress" :title="followRequestSent ? $t('user_card.follow_again') : ''" v-else>
</button> <template v-if="followRequestInProgress">
</span> {{ $t('user_card.follow_progress') }}
<span v-if="!user.following"> </template>
<button @click="followUser" :disabled="followRequestInProgress" :title="followRequestSent ? $t('user_card.follow_again') : ''"> <template v-else-if="followRequestSent">
<template v-if="followRequestInProgress"> {{ $t('user_card.follow_sent') }}
{{ $t('user_card.follow_progress') }} </template>
</template> <template v-else>
<template v-else-if="followRequestSent"> {{ $t('user_card.follow') }}
{{ $t('user_card.follow_sent') }} </template>
</template> </button>
<template v-else>
{{ $t('user_card.follow') }}
</template>
</button>
</span>
</div> </div>
<div v-if="loggedIn"> <div>
<ProgressButton :click="subscribeUser" v-if="!user.subscribed"> <ProgressButton :click="subscribeUser" v-if="!user.subscribed">
{{ $t('user_card.subscribe') }} {{ $t('user_card.subscribe') }}
</ProgressButton> </ProgressButton>
@ -80,7 +75,7 @@
{{ $t('user_card.subscribed') }} {{ $t('user_card.subscribed') }}
</ProgressButton> </ProgressButton>
</div> </div>
<div class='mute' v-if='isOtherUser && loggedIn'> <div class='mute'>
<span v-if='user.muted'> <span v-if='user.muted'>
<button @click="unmuteUser" class="pressed"> <button @click="unmuteUser" class="pressed">
{{ $t('user_card.muted') }} {{ $t('user_card.muted') }}
@ -92,10 +87,7 @@
</button> </button>
</span> </span>
</div> </div>
<div v-if='!loggedIn && user.is_local'> <div class='block'>
<RemoteFollow :user="user" />
</div>
<div class='block' v-if='isOtherUser && loggedIn'>
<span v-if='user.statusnet_blocking'> <span v-if='user.statusnet_blocking'>
<button @click="unblockUser" class="pressed"> <button @click="unblockUser" class="pressed">
{{ $t('user_card.blocked') }} {{ $t('user_card.blocked') }}
@ -107,14 +99,17 @@
</button> </button>
</span> </span>
</div> </div>
<div class='block' v-if='isOtherUser && loggedIn'> <div class='block'>
<span> <span>
<button @click="reportUser"> <button @click="reportUser">
{{ $t('user_card.report') }} {{ $t('user_card.report') }}
</button> </button>
</span> </span>
</div> </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> </div>
</div> </div>