This commit is contained in:
syuilo
2017-10-31 22:35:31 +09:00
parent 30a4e839a6
commit 5efb52b9f5
7 changed files with 26 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ let page = null;
export default me => {
route('/', index);
route('/i>mentions', mentions);
route('/channel', channels);
route('/post::post', post);
route('/search::query', search);
route('/:user', user.bind(null, 'home'));
@@ -54,6 +55,10 @@ export default me => {
mount(el);
}
function channels() {
mount(document.createElement('mk-channels-page'));
}
function notFound() {
mount(document.createElement('mk-not-found'));
}

View File

@@ -1,8 +1,7 @@
<mk-channels-page>
<mk-ui ref="ui">
<main>
<h1>%i18n:desktop.tags.mk-bbs-page.title%</h1>
<button onclick={ parent.new }>%i18n:desktop.tags.mk-bbs-page.new%</button>
<button onclick={ parent.new }>%i18n:desktop.tags.mk-channels-page.new%</button>
</main>
</mk-ui>
<style>
@@ -14,16 +13,15 @@
this.mixin('api');
this.on('mount', () => {
document.title = '%i18n:desktop.tags.mk-bbs-page.title%';
});
this.new = () => {
const title = window.prompt('%i18n:desktop.tags.mk-bbs-page.channel-title%');
const title = window.prompt('%i18n:desktop.tags.mk-channels-page.channel-title%');
this.api('bbs/channels/create', {
title: title
}).then(channel => {
location.href = '/bbs/' + channel.id;
location.href = '/channel/' + channel.id;
});
};
</script>

View File

@@ -335,10 +335,10 @@
</a>
</li>
</virtual>
<li class="bbs">
<a href={ CONFIG.url + '/bbs' }>
<i class="fa fa-coffee"></i>
<p>%i18n:desktop.tags.mk-ui-header-nav.bbs%</p>
<li class="channels">
<a href={ CONFIG.url + '/channel' }>
<i class="fa fa-television"></i>
<p>%i18n:desktop.tags.mk-ui-header-nav.channels%</p>
</a>
</li>
<li class="info">