iceshrimp-legacy/src/web/app/ch/tags/index.tag

38 lines
675 B
HTML
Raw Normal View History

2017-10-31 19:17:14 +01:00
<mk-index>
2017-11-01 16:20:33 +01:00
<mk-header/>
<hr>
2017-10-31 20:11:56 +01:00
<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>
2017-10-31 19:17:14 +01:00
<style>
:scope
display block
</style>
<script>
this.mixin('api');
this.on('mount', () => {
this.api('channels', {
limit: 100
}).then(channels => {
2017-10-31 20:11:56 +01:00
this.update({
channels: channels
});
});
2017-10-31 19:17:14 +01:00
});
2017-10-31 20:11:56 +01:00
this.n = () => {
2017-10-31 19:17:14 +01:00
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>