mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
added channel sidebar
This commit is contained in:
parent
d325632e83
commit
93a484d3ad
@ -1,25 +1,27 @@
|
||||
const m = require('mithril');
|
||||
const widget = require('widgets');
|
||||
|
||||
const Channel = () => {
|
||||
return {
|
||||
view: () => m('.channel'),
|
||||
};
|
||||
};
|
||||
const sections = {
|
||||
MyForums: require('channels/my_forums'),
|
||||
SubscribedFroums: require('channels/subscribed_forums'),
|
||||
PopularForums: require('channels/popular_forums'),
|
||||
OtherForums: require('channels/other_forums')
|
||||
}
|
||||
|
||||
const MyChannels = () => {
|
||||
return {
|
||||
view: () => m('.widget', [m('h3', 'My channels'), m('hr'), m(Channel)]),
|
||||
};
|
||||
};
|
||||
|
||||
const Layout = () => {
|
||||
return {
|
||||
view: (vnode) => m('.tab-page', [m(MyChannels)]),
|
||||
};
|
||||
const Layout = {
|
||||
view: (vnode) =>
|
||||
m('.tab-page', [
|
||||
m(widget.Sidebar, {
|
||||
tabs: Object.keys(sections),
|
||||
baseRoute: '/channels/',
|
||||
}),
|
||||
m('.node-panel .', vnode.children),
|
||||
]),
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
view: (vnode) => {
|
||||
return m(Layout);
|
||||
const tab = vnode.attrs.tab;
|
||||
return m(Layout, m(sections[tab]));
|
||||
},
|
||||
};
|
||||
|
||||
11
webui-src/app/channels/my_forums.js
Normal file
11
webui-src/app/channels/my_forums.js
Normal file
@ -0,0 +1,11 @@
|
||||
const m = require('mithril');
|
||||
|
||||
const Layout = () => {
|
||||
return{
|
||||
view: () => [
|
||||
m('h2', 'My Forums')
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout();
|
||||
11
webui-src/app/channels/other_forums.js
Normal file
11
webui-src/app/channels/other_forums.js
Normal file
@ -0,0 +1,11 @@
|
||||
const m = require('mithril');
|
||||
|
||||
const Layout = () => {
|
||||
return{
|
||||
view: () => [
|
||||
m('h2', 'Other Forums')
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout();
|
||||
11
webui-src/app/channels/popular_forums.js
Normal file
11
webui-src/app/channels/popular_forums.js
Normal file
@ -0,0 +1,11 @@
|
||||
const m = require('mithril');
|
||||
|
||||
const Layout = () => {
|
||||
return{
|
||||
view: () => [
|
||||
m('h2', 'Popular Forums')
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout();
|
||||
11
webui-src/app/channels/subscribed_forums.js
Normal file
11
webui-src/app/channels/subscribed_forums.js
Normal file
@ -0,0 +1,11 @@
|
||||
const m = require('mithril');
|
||||
|
||||
const Layout = () => {
|
||||
return{
|
||||
view: () => [
|
||||
m('h2', 'Subscribed Forums')
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout();
|
||||
@ -53,7 +53,7 @@ const Layout = () => {
|
||||
chat: '/chat',
|
||||
mail: '/mail/inbox',
|
||||
files: '/files/files',
|
||||
channels: '/channels',
|
||||
channels: '/channels/MyForums',
|
||||
config: '/config/network',
|
||||
},
|
||||
}),
|
||||
@ -94,8 +94,8 @@ m.route(document.getElementById('main'), '/', {
|
||||
'/files/:tab': {
|
||||
render: (v) => m(Layout, m(files, v.attrs)),
|
||||
},
|
||||
'/channels': {
|
||||
render: () => m(Layout, m(channels)),
|
||||
'/channels/:tab': {
|
||||
render: (v) => m(Layout, m(channels,v.attrs)),
|
||||
},
|
||||
'/config/:tab': {
|
||||
render: (v) => m(Layout, m(config, v.attrs)),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user