removed comments and check.

This commit is contained in:
Sukhamjot Singh 2022-06-16 16:12:42 +05:30
parent 1acc8d5b7a
commit d80ff0733e
7 changed files with 21 additions and 84 deletions

View File

@ -67,22 +67,5 @@ module.exports = {
return m(Layout, {
pathInfo: vnode.attrs,
});
// if (Object.prototype.hasOwnProperty.call(vnode.attrs, 'mMsgId')) {
// return m(Layout, {
// check: 0, // for channel description
// channelId: vnode.attrs.mGroupId,
// msgId: vnode.attrs.mMsgId,
// });
// } else if (Object.prototype.hasOwnProperty.call(vnode.attrs, 'mGroupId')) {
// return m(Layout, {
// check: 1, // for channel description
// id: vnode.attrs.mGroupId,
// });
// }
// return m(Layout, {
// check: 2,
// tab: vnode.attrs.tab,
// });
// this check is implemented for Layout and helps to send in updated list each time.
},
};

View File

@ -166,33 +166,6 @@ const ChannelView = () => {
style: 'display:' + (csubscribed ? 'block' : 'none'),
},
m('h3', 'Posts'),
// plist.map((post) => [
// Object.keys(plist).map((key, index) => [
// m(
// 'div',
// {
// class: 'card',
// onclick: () => {
// m.route.set('/channels/:tab/:mGroupId/:mMsgId', {
// tab: m.route.param().tab,
// mGroupId: v.attrs.id,
// mMsgId: key,
// });
// },
// },
// [
// m('img', {
// class: 'card-img',
// src: 'data:image/png;base64,' + plist[key].mThumbnail.mData.base64,
// alt: 'header',
// }),
// m('div', { class: 'card-info' }, [
// m('h4', { class: 'card-title' }, plist[key].mMeta.mMsgName),
// ]),
// ]
// ),
// ])
),
]
),

View File

@ -24,7 +24,6 @@ const sections = {
};
const Layout = {
// oninit : getForums.load,
onupdate: getForums.load,
view: (vnode) =>
m('.tab-page', [
@ -38,12 +37,12 @@ const Layout = {
m(
'.forum-node-panel',
vnode.attrs.check
Object.prototype.hasOwnProperty.call(vnode.attrs.pathInfo, 'mGroupId')
? m(util.MessageView, {
id: vnode.attrs.id,
id: vnode.attrs.pathInfo.mGroupId,
})
: m(sections[vnode.attrs.tab], {
list: getForums[vnode.attrs.tab],
: m(sections[vnode.attrs.pathInfo.tab], {
list: getForums[vnode.attrs.pathInfo.tab],
})
),
]),
@ -51,16 +50,8 @@ const Layout = {
module.exports = {
view: (vnode) => {
if (Object.prototype.hasOwnProperty.call(vnode.attrs, 'mGroupId')) {
return m(Layout, {
check: true, // for forum description
id: vnode.attrs.mGroupId,
});
}
return m(Layout, {
check: false,
tab: vnode.attrs.tab,
pathInfo: vnode.attrs,
});
// this check is implemented for Layout and helps to send in updated list each time.
},
};

View File

@ -1,11 +1,9 @@
const m = require('mithril');
const Layout = () => {
return{
view: () => [
m('.widget', [m('h2', 'My Forums'), m('hr'), ])
]
};
return {
view: () => [m('.widget', [m('h2', 'My Forums'), m('hr')])],
};
};
module.exports = Layout();

View File

@ -1,11 +1,9 @@
const m = require('mithril');
const Layout = () => {
return{
view: () => [
m('.widget', [m('h2', 'Other Forums'), m('hr'), ])
]
};
return {
view: () => [m('.widget', [m('h2', 'Other Forums'), m('hr')])],
};
};
module.exports = Layout();

View File

@ -9,22 +9,20 @@ const Layout = () => {
m('hr'),
m(
util.Table,
m(
'tbody',
[v.attrs.list.map((forum) =>
m('tbody', [
v.attrs.list.map((forum) =>
m(util.ForumSummary, {
details: forum,
category: 'PopularForums',
}),
})
),
v.attrs.list.map((forum) =>
m(util.DisplayForumsFromList, {
id: forum.mGroupId,
category: 'PopularForums',
}),
})
),
]
)
])
),
]),
],
@ -32,4 +30,3 @@ const Layout = () => {
};
module.exports = Layout;

View File

@ -9,22 +9,20 @@ const Layout = () => {
m('hr'),
m(
util.Table,
m(
'tbody',
[v.attrs.list.map((forum) =>
m('tbody', [
v.attrs.list.map((forum) =>
m(util.ForumSummary, {
details: forum,
category: 'SubscribedForums',
}),
})
),
v.attrs.list.map((forum) =>
m(util.DisplayForumsFromList, {
id: forum.mGroupId,
category: 'SubscribedForums',
}),
})
),
]
)
])
),
]),
],
@ -32,4 +30,3 @@ const Layout = () => {
};
module.exports = Layout;