summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-26 16:10:01 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-26 16:10:01 +0900
commitbb204b2ef70a3035fb3449869e90d1d53ac50c60 (patch)
tree1f6a3238dfbf1f77da78d96e993f6d76cad73089 /src/client
parent:v: (diff)
downloadmisskey-bb204b2ef70a3035fb3449869e90d1d53ac50c60.tar.gz
misskey-bb204b2ef70a3035fb3449869e90d1d53ac50c60.tar.bz2
misskey-bb204b2ef70a3035fb3449869e90d1d53ac50c60.zip
wip
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/desktop/views/components/follow-button.vue6
-rw-r--r--src/client/app/desktop/views/pages/user/user.profile.vue51
2 files changed, 46 insertions, 11 deletions
diff --git a/src/client/app/desktop/views/components/follow-button.vue b/src/client/app/desktop/views/components/follow-button.vue
index 30e8cab76f..60c6129f61 100644
--- a/src/client/app/desktop/views/components/follow-button.vue
+++ b/src/client/app/desktop/views/components/follow-button.vue
@@ -19,6 +19,7 @@
<script lang="ts">
import Vue from 'vue';
+
export default Vue.extend({
props: {
user: {
@@ -30,6 +31,7 @@ export default Vue.extend({
default: 'compact'
}
},
+
data() {
return {
wait: false,
@@ -37,6 +39,7 @@ export default Vue.extend({
connectionId: null
};
},
+
mounted() {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
@@ -44,13 +47,14 @@ export default Vue.extend({
this.connection.on('follow', this.onFollow);
this.connection.on('unfollow', this.onUnfollow);
},
+
beforeDestroy() {
this.connection.off('follow', this.onFollow);
this.connection.off('unfollow', this.onUnfollow);
(this as any).os.stream.dispose(this.connectionId);
},
- methods: {
+ methods: {
onFollow(user) {
if (user.id == this.user.id) {
this.user.isFollowing = user.isFollowing;
diff --git a/src/client/app/desktop/views/pages/user/user.profile.vue b/src/client/app/desktop/views/pages/user/user.profile.vue
index 774f300a38..64acbd86b3 100644
--- a/src/client/app/desktop/views/pages/user/user.profile.vue
+++ b/src/client/app/desktop/views/pages/user/user.profile.vue
@@ -3,15 +3,18 @@
<div class="friend-form" v-if="os.isSignedIn && os.i.id != user.id">
<mk-follow-button :user="user" size="big"/>
<p class="followed" v-if="user.isFollowed">%i18n:@follows-you%</p>
- <p class="stalk">
- <span v-if="user.isStalking">%i18n:@stalking% <a @click="unstalk">%i18n:@unstalk%</a></span>
- <span v-if="!user.isStalking"><a @click="stalk">%i18n:@stalk%</a></span>
- </p>
- <p class="mute">
- <span v-if="user.isMuted">%i18n:@muted% <a @click="unmute">%i18n:@unmute%</a></span>
- <span v-if="!user.isMuted"><a @click="mute">%i18n:@mute%</a></span>
+ <p class="stalk" v-if="user.isFollowing">
+ <span v-if="user.isStalking">%i18n:@stalking% <a @click="unstalk">%fa:meh% %i18n:@unstalk%</a></span>
+ <span v-if="!user.isStalking"><a @click="stalk">%fa:user-secret% %i18n:@stalk%</a></span>
</p>
</div>
+ <div class="action-form">
+ <button class="mute ui" @click="user.isMuted ? unmute() : mute()">
+ <span v-if="user.isMuted">%fa:eye% %i18n:@unmute%</span>
+ <span v-if="!user.isMuted">%fa:eye-slash% %i18n:@mute%</span>
+ </button>
+ <button class="mute ui" @click="list">%fa:list% リストに追加</button>
+ </div>
<div class="description" v-if="user.description">{{ user.description }}</div>
<div class="birthday" v-if="user.host === null && user.profile.birthday">
<p>%fa:birthday-cake%{{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)</p>
@@ -32,6 +35,7 @@ import Vue from 'vue';
import * as age from 's-age';
import MkFollowingWindow from '../../components/following-window.vue';
import MkFollowersWindow from '../../components/followers-window.vue';
+import MkUserListsWindow from '../../components/user-lists-window.vue';
export default Vue.extend({
props: ['user'],
@@ -91,6 +95,21 @@ export default Vue.extend({
}, () => {
alert('error');
});
+ },
+
+ list() {
+ const w = (this as any).os.new(MkUserListsWindow);
+ w.$once('choosen', async list => {
+ w.close();
+ await (this as any).api('users/lists/push', {
+ listId: list.id,
+ userId: this.user.id
+ });
+ (this as any).apis.dialog({
+ title: 'Done!',
+ text: `${this.user.name}を${list.title}に追加しました。`
+ });
+ });
}
}
});
@@ -107,11 +126,9 @@ export default Vue.extend({
> .friend-form
padding 16px
+ text-align center
border-top solid 1px #eee
- > .mk-big-follow-button
- width 100%
-
> .followed
margin 12px 0 0 0
padding 0
@@ -122,6 +139,20 @@ export default Vue.extend({
background #eefaff
border-radius 4px
+ > .stalk
+ margin 12px 0 0 0
+
+ > .action-form
+ padding 16px
+ text-align center
+ border-top solid 1px #eee
+
+ > *
+ width 100%
+
+ &:not(:last-child)
+ margin-bottom 12px
+
> .description
padding 16px
color #555