This commit is contained in:
syuilo 2018-06-02 15:51:43 +09:00
parent 9e8cfd76c8
commit 8dfd892b71
2 changed files with 22 additions and 3 deletions

View file

@ -3,7 +3,12 @@
<span slot="header">%fa:envelope R% %i18n:@title%</span> <span slot="header">%fa:envelope R% %i18n:@title%</span>
<div data-id="c1136cec-1278-49b1-9ea7-412c1ef794f4" :data-darkmode="$store.state.device.darkmode"> <div data-id="c1136cec-1278-49b1-9ea7-412c1ef794f4" :data-darkmode="$store.state.device.darkmode">
<router-link v-for="req in requests" :key="req.id" :to="req.followee | userPage">{{ req.followee | userName }}</router-link> <div v-for="req in requests">
<router-link :key="req.id" :to="req.follower | userPage">{{ req.follower | userName }}</router-link>
<span>
<a @click="accept(req.follower)">%i18n:@accept%</a>|<a @click="reject(req.follower)">%i18n:@reject%</a>
</span>
</div>
</div> </div>
</mk-window> </mk-window>
</template> </template>
@ -24,6 +29,16 @@ export default Vue.extend({
}); });
}, },
methods: { methods: {
accept(user) {
(this as any).api('following/requests/accept', { userId: user.id }).then(() => {
this.requests = this.requests.filter(r => r.follower.id != user.id);
});
},
reject(user) {
(this as any).api('following/requests/reject', { userId: user.id }).then(() => {
this.requests = this.requests.filter(r => r.follower.id != user.id);
});
},
close() { close() {
(this as any).$refs.window.close(); (this as any).$refs.window.close();
} }
@ -39,12 +54,15 @@ root(isDark)
> button > button
margin-bottom 16px margin-bottom 16px
> a > div
display block display flex
padding 16px padding 16px
border solid 1px isDark ? #1c2023 : #eee border solid 1px isDark ? #1c2023 : #eee
border-radius 4px border-radius 4px
> span
margin 0 0 0 auto
[data-id="c1136cec-1278-49b1-9ea7-412c1ef794f4"][data-darkmode] [data-id="c1136cec-1278-49b1-9ea7-412c1ef794f4"][data-darkmode]
root(true) root(true)

View file

@ -238,6 +238,7 @@ root(isDark)
margin-left 4px margin-left 4px
padding 2px 8px padding 2px 8px
font-size 90% font-size 90%
font-style normal
background $theme-color background $theme-color
color $theme-color-foreground color $theme-color-foreground
border-radius 8px border-radius 8px