forked from AkkomaGang/akkoma-fe
Take over branch and fix some issues
This commit is contained in:
parent
5d0e51cae3
commit
e801d78e9d
5 changed files with 81 additions and 64 deletions
|
@ -26,7 +26,9 @@ const FollowList = {
|
||||||
entries () {
|
entries () {
|
||||||
return this.showFollowers ? this.user.followers : this.user.friends
|
return this.showFollowers ? this.user.followers : this.user.friends
|
||||||
},
|
},
|
||||||
showActions () { return this.$store.state.users.currentUser.id === this.userId }
|
showFollowsYou () {
|
||||||
|
return !this.showFollowers || (this.showFollowers && this.userId !== this.$store.state.users.currentUser.id)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchEntries () {
|
fetchEntries () {
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
<user-card
|
<user-card
|
||||||
v-for="entry in entries"
|
v-for="entry in entries"
|
||||||
:key="entry.id" :user="entry"
|
:key="entry.id" :user="entry"
|
||||||
:showFollows="!showFollowers"
|
:noFollowsYou="!showFollowsYou"
|
||||||
:showActions="showActions"
|
|
||||||
/>
|
/>
|
||||||
<div class="text-center panel-footer">
|
<div class="text-center panel-footer">
|
||||||
<a v-if="error" @click="fetchEntries" class="alert error">
|
<a v-if="error" @click="fetchEntries" class="alert error">
|
||||||
|
|
|
@ -6,9 +6,8 @@ import { requestFollow, requestUnfollow } from '../../services/follow_manipulate
|
||||||
const UserCard = {
|
const UserCard = {
|
||||||
props: [
|
props: [
|
||||||
'user',
|
'user',
|
||||||
'showFollows',
|
'noFollowsYou',
|
||||||
'showApproval',
|
'showApproval'
|
||||||
'showActions'
|
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -26,7 +25,7 @@ const UserCard = {
|
||||||
currentUser () { return this.$store.state.users.currentUser },
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
following () { return this.updated ? this.updated.following : this.user.following },
|
following () { return this.updated ? this.updated.following : this.user.following },
|
||||||
showFollow () {
|
showFollow () {
|
||||||
return this.showActions && (!this.showFollows && !this.following || this.updated && !this.updated.following)
|
return !this.showApproval && (!this.following || this.updated && !this.updated.following)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -3,53 +3,55 @@
|
||||||
<router-link :to="userProfileLink(user)">
|
<router-link :to="userProfileLink(user)">
|
||||||
<UserAvatar class="avatar" @click.prevent.native="toggleUserExpanded" :src="user.profile_image_url"/>
|
<UserAvatar class="avatar" @click.prevent.native="toggleUserExpanded" :src="user.profile_image_url"/>
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="usercard" v-if="userExpanded">
|
<div class="user-card-main-content">
|
||||||
<user-card-content :user="user" :switcher="false"></user-card-content>
|
<div class="usercard" v-if="userExpanded">
|
||||||
</div>
|
<user-card-content :user="user" :switcher="false"></user-card-content>
|
||||||
<div class="name-and-screen-name" v-else>
|
|
||||||
<div :title="user.name" class="user-name">
|
|
||||||
<span v-if="user.name_html" v-html="user.name_html"></span>
|
|
||||||
<span v-else>{{ user.name }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="user-link-action">
|
<div class="name-and-screen-name" v-if="!userExpanded">
|
||||||
<router-link class='user-screen-name' :to="userProfileLink(user)">
|
<div :title="user.name" class="user-name">
|
||||||
@{{user.screen_name}}
|
<span v-if="user.name_html" v-html="user.name_html"></span>
|
||||||
</router-link>
|
<span v-else>{{ user.name }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="user-link-action">
|
||||||
|
<router-link class='user-screen-name' :to="userProfileLink(user)">
|
||||||
|
@{{user.screen_name}}
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="follow-box" v-if="!userExpanded">
|
||||||
|
<span class="faint" v-if="!noFollowsYou && user.follows_you">
|
||||||
|
{{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
v-if="showFollow"
|
||||||
|
class="btn btn-default"
|
||||||
|
@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>
|
||||||
|
<button v-if="following" class="btn btn-default pressed" @click="unfollowUser" :disabled="followRequestInProgress">
|
||||||
|
<template v-if="followRequestInProgress">
|
||||||
|
{{ $t('user_card.follow_progress') }}
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
{{ $t('user_card.follow_unfollow') }}
|
||||||
|
</template>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="approval" v-if="showApproval">
|
||||||
|
<button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
|
||||||
|
<button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="follow-box">
|
|
||||||
<span class="faint" v-if="showFollows && user.follows_you">
|
|
||||||
{{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
v-if="showFollow"
|
|
||||||
class="btn btn-default"
|
|
||||||
@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>
|
|
||||||
<button v-if="showActions && following" class="btn btn-default" @click="unfollowUser" :disabled="followRequestInProgress">
|
|
||||||
<template v-if="followRequestInProgress">
|
|
||||||
{{ $t('user_card.follow_progress') }}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
{{ $t('user_card.follow_unfollow') }}
|
|
||||||
</template>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="approval" v-if="showApproval">
|
|
||||||
<button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
|
|
||||||
<button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -58,9 +60,16 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import '../../_variables.scss';
|
@import '../../_variables.scss';
|
||||||
.name-and-screen-name {
|
|
||||||
|
.user-card-main-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1 1 100%;
|
||||||
margin-left: 0.7em;
|
margin-left: 0.7em;
|
||||||
margin-top: 0.0em;
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-and-screen-name {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
@ -98,22 +107,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.follow-box {
|
.follow-box {
|
||||||
width: 15em;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
line-height: 1.5em;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
position: absolute;
|
margin-top: 0.5em;
|
||||||
bottom: 0;
|
margin-left: auto;
|
||||||
left: 0;
|
width: 10em;
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.usercard {
|
.usercard {
|
||||||
width: fill-available;
|
width: fill-available;
|
||||||
margin: 0.2em 0 0 0.7em;
|
|
||||||
border-radius: $fallback--panelRadius;
|
border-radius: $fallback--panelRadius;
|
||||||
border-radius: var(--panelRadius, $fallback--panelRadius);
|
border-radius: var(--panelRadius, $fallback--panelRadius);
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
@ -134,9 +145,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval {
|
.approval {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
button {
|
button {
|
||||||
width: 100%;
|
margin-top: 0.5em;
|
||||||
margin-bottom: 0.5em;
|
margin-right: 0.5em;
|
||||||
|
flex: 1 1;
|
||||||
|
max-width: 12em;
|
||||||
|
min-width: 8em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -344,7 +344,7 @@
|
||||||
"follow_sent": "Request sent!",
|
"follow_sent": "Request sent!",
|
||||||
"follow_progress": "Requesting…",
|
"follow_progress": "Requesting…",
|
||||||
"follow_again": "Send request again?",
|
"follow_again": "Send request again?",
|
||||||
"follow_unfollow": "Stop following",
|
"follow_unfollow": "Unfollow",
|
||||||
"followees": "Following",
|
"followees": "Following",
|
||||||
"followers": "Followers",
|
"followers": "Followers",
|
||||||
"following": "Following!",
|
"following": "Following!",
|
||||||
|
|
Loading…
Reference in a new issue