summaryrefslogtreecommitdiff
path: root/src/web/app
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2017-12-22 17:42:03 +0900
committerGitHub <noreply@github.com>2017-12-22 17:42:03 +0900
commite06dd199a7f3f0b1fd3bd67e06e463c2aa58633c (patch)
tree5e9dc021c78288097cc02671f0c9a4ef04a83e2d /src/web/app
parentFix bug (diff)
parentUpdate create.ts (diff)
downloadmisskey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.tar.gz
misskey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.tar.bz2
misskey-e06dd199a7f3f0b1fd3bd67e06e463c2aa58633c.zip
Merge pull request #1028 from syuilo/mute
Mute
Diffstat (limited to 'src/web/app')
-rw-r--r--src/web/app/desktop/tags/settings.tag38
-rw-r--r--src/web/app/desktop/tags/user.tag27
2 files changed, 64 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>