mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-15 12:02:06 +00:00
1.) module dependency updated from jade 1.11.0 to pug 2.0.0-beta3 2.) All references to Jade have been changed to Pug 3.) /srv/web/jade.js is renamed to pug.js 4.) all template files renamed accordingly 5.) "mixin somename" is automatically considered a declaration, invocations must use "+somename" 6.) variable interpolation is no longer supported inside element attributes, use direct references and string concatenation instead. 7.) bumped minor version
21 lines
603 B
JavaScript
21 lines
603 B
JavaScript
import { sendPug } from '../pug';
|
|
|
|
export default function initialize(app, channelIndex, maxEntries) {
|
|
app.get('/', (req, res) => {
|
|
channelIndex.listPublicChannels().then((channels) => {
|
|
channels.sort((a, b) => {
|
|
if (a.usercount === b.usercount) {
|
|
return a.uniqueName > b.uniqueName ? -1 : 1;
|
|
}
|
|
|
|
return b.usercount - a.usercount;
|
|
});
|
|
|
|
channels = channels.slice(0, maxEntries);
|
|
|
|
sendPug(res, 'index', {
|
|
channels: channels
|
|
});
|
|
});
|
|
});
|
|
}
|