diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2017-12-22 17:42:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-22 17:42:03 +0900 |
| commit | e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c (patch) | |
| tree | 5e9dc021c78288097cc02671f0c9a4ef04a83e2d /src/web | |
| parent | Fix bug (diff) | |
| parent | Update create.ts (diff) | |
| download | sharkey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.tar.gz sharkey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.tar.bz2 sharkey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.zip | |
Merge pull request #1028 from syuilo/mute
Mute
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/desktop/tags/settings.tag | 38 | ||||
| -rw-r--r-- | src/web/app/desktop/tags/user.tag | 27 | ||||
| -rw-r--r-- | src/web/docs/api/entities/user.yaml | 6 | ||||
| -rw-r--r-- | src/web/docs/mute.ja.pug | 13 | ||||
| -rw-r--r-- | src/web/docs/search.ja.pug | 16 |
5 files changed, 99 insertions, 1 deletions
diff --git a/src/web/app/desktop/tags/settings.tag b/src/web/app/desktop/tags/settings.tag index 2f36d9b3ec..457b7e2276 100644 --- a/src/web/app/desktop/tags/settings.tag +++ b/src/web/app/desktop/tags/settings.tag @@ -4,6 +4,7 @@ <p class={ active: page == 'web' } onmousedown={ setPage.bind(null, 'web') }>%fa:desktop .fw%Web</p> <p class={ active: page == 'notification' } onmousedown={ setPage.bind(null, 'notification') }>%fa:R bell .fw%通知</p> <p class={ active: page == 'drive' } onmousedown={ setPage.bind(null, 'drive') }>%fa:cloud .fw%%i18n:desktop.tags.mk-settings.drive%</p> + <p class={ active: page == 'mute' } onmousedown={ setPage.bind(null, 'mute') }>%fa:ban .fw%%i18n:desktop.tags.mk-settings.mute%</p> <p class={ active: page == 'apps' } onmousedown={ setPage.bind(null, 'apps') }>%fa:puzzle-piece .fw%アプリ</p> <p class={ active: page == 'twitter' } onmousedown={ setPage.bind(null, 'twitter') }>%fa:B twitter .fw%Twitter</p> <p class={ active: page == 'security' } onmousedown={ setPage.bind(null, 'security') }>%fa:unlock-alt .fw%%i18n:desktop.tags.mk-settings.security%</p> @@ -26,6 +27,11 @@ <mk-drive-setting/> </section> + <section class="mute" show={ page == 'mute' }> + <h1>%i18n:desktop.tags.mk-settings.mute%</h1> + <mk-mute-setting/> + </section> + <section class="apps" show={ page == 'apps' }> <h1>アプリケーション</h1> <mk-authorized-apps/> @@ -386,3 +392,35 @@ }); </script> </mk-drive-setting> + +<mk-mute-setting> + <div class="none ui info" if={ !fetching && users.length == 0 }> + <p>%fa:info-circle%%i18n:desktop.tags.mk-mute-setting.no-users%</p> + </div> + <div class="users" if={ users.length != 0 }> + <div each={ user in users }> + <p><b>{ user.name }</b> @{ user.username }</p> + </div> + </div> + + <style> + :scope + display block + + </style> + <script> + this.mixin('api'); + + this.apps = []; + this.fetching = true; + + this.on('mount', () => { + this.api('mute/list').then(x => { + this.update({ + fetching: false, + users: x.users + }); + }); + }); + </script> +</mk-mute-setting> diff --git a/src/web/app/desktop/tags/user.tag b/src/web/app/desktop/tags/user.tag index b4db47f9dd..b29d1eaebc 100644 --- a/src/web/app/desktop/tags/user.tag +++ b/src/web/app/desktop/tags/user.tag @@ -226,7 +226,9 @@ <mk-user-profile> <div class="friend-form" if={ SIGNIN && I.id != user.id }> <mk-big-follow-button user={ user }/> - <p class="followed" if={ user.is_followed }>フォローされています</p> + <p class="followed" if={ user.is_followed }>%i18n:desktop.tags.mk-user.follows-you%</p> + <p if={ user.is_muted }>%i18n:desktop.tags.mk-user.muted% <a onclick={ unmute }>%i18n:desktop.tags.mk-user.unmute%</a></p> + <p if={ !user.is_muted }><a onclick={ mute }>%i18n:desktop.tags.mk-user.mute%</a></p> </div> <div class="description" if={ user.description }>{ user.description }</div> <div class="birthday" if={ user.profile.birthday }> @@ -311,6 +313,7 @@ this.age = require('s-age'); this.mixin('i'); + this.mixin('api'); this.user = this.opts.user; @@ -325,6 +328,28 @@ user: this.user }); }; + + this.mute = () => { + this.api('mute/create', { + user_id: this.user.id + }).then(() => { + this.user.is_muted = true; + this.update(); + }, e => { + alert('error'); + }); + }; + + this.unmute = () => { + this.api('mute/delete', { + user_id: this.user.id + }).then(() => { + this.user.is_muted = false; + this.update(); + }, e => { + alert('error'); + }); + }; </script> </mk-user-profile> diff --git a/src/web/docs/api/entities/user.yaml b/src/web/docs/api/entities/user.yaml index abc3f300d2..e62ad84db8 100644 --- a/src/web/docs/api/entities/user.yaml +++ b/src/web/docs/api/entities/user.yaml @@ -75,6 +75,12 @@ props: optional: true desc: ja: "自分がこのユーザーにフォローされているか" + - name: "is_muted" + type: "boolean" + optional: true + desc: + ja: "自分がこのユーザーをミュートしているか" + en: "Whether you muted this user" - name: "last_used_at" type: "date" optional: false diff --git a/src/web/docs/mute.ja.pug b/src/web/docs/mute.ja.pug new file mode 100644 index 0000000000..5e79af5f8c --- /dev/null +++ b/src/web/docs/mute.ja.pug @@ -0,0 +1,13 @@ +h1 ミュート + +p ユーザーページから、そのユーザーをミュートすることができます。 + +p ユーザーをミュートすると、そのユーザーに関する次のコンテンツがMisskeyに表示されなくなります: +ul + li タイムラインや投稿の検索結果内の、そのユーザーの投稿(およびそれらの投稿に対する返信やRepost) + li そのユーザーからの通知 + li メッセージ履歴一覧内の、そのユーザーとのメッセージ履歴 + +p ミュートを行ったことは相手に通知されず、ミュートされていることを知ることもできません。 + +p 設定>ミュート から、自分がミュートしているユーザー一覧を確認することができます。 diff --git a/src/web/docs/search.ja.pug b/src/web/docs/search.ja.pug index 41e443d746..552f95c60f 100644 --- a/src/web/docs/search.ja.pug +++ b/src/web/docs/search.ja.pug @@ -30,6 +30,22 @@ section br | null ... 特に限定しない(デフォルト) tr + td mute + td + | mute_all ... ミュートしているユーザーの投稿とその投稿に対する返信やRepostを除外する(デフォルト) + br + | mute_related ... ミュートしているユーザーの投稿に対する返信やRepostだけ除外する + br + | mute_direct ... ミュートしているユーザーの投稿だけ除外する + br + | disabled ... ミュートしているユーザーの投稿とその投稿に対する返信やRepostも含める + br + | direct_only ... ミュートしているユーザーの投稿だけに限定 + br + | related_only ... ミュートしているユーザーの投稿に対する返信やRepostだけに限定 + br + | all_only ... ミュートしているユーザーの投稿とその投稿に対する返信やRepostに限定 + tr td reply td | true ... 返信に限定。 |