iceshrimp-legacy/src/web/app/ch/tags/index.tag
syuilo 9f6cc8bafb 🎨
2017-11-02 00:20:33 +09:00

36 lines
652 B
HTML

<mk-index>
<mk-header/>
<hr>
<button onclick={ n }>%i18n:ch.tags.mk-index.new%</button>
<hr>
<ul if={ channels }>
<li each={ channels }><a href={ '/' + this.id }>{ this.title }</a></li>
</ul>
<style>
:scope
display block
</style>
<script>
this.mixin('api');
this.on('mount', () => {
this.api('channels').then(channels => {
this.update({
channels: channels
});
});
});
this.n = () => {
const title = window.prompt('%i18n:ch.tags.mk-index.channel-title%');
this.api('channels/create', {
title: title
}).then(channel => {
location.href = '/' + channel.id;
});
};
</script>
</mk-index>