diff --git a/routes/serve-routes.js b/routes/serve-routes.js index 25710854..4a7073fc 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -36,7 +36,7 @@ module.exports = (app) => { const mimetypes = headers['accept'].split(','); if (mimetypes.includes('text/html')) { postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('showLite', { fileInfo }); + res.status(200).render('showLite', { layout: 'show', fileInfo }); } else { postToStats('serve', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); serveFile(fileInfo, res); @@ -67,7 +67,7 @@ module.exports = (app) => { const mimetypes = headers['accept'].split(','); if (mimetypes.includes('text/html')) { postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('showLite', { fileInfo }); + res.status(200).render('showLite', { layout: 'show', fileInfo }); } else { postToStats('serve', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); serveFile(fileInfo, res); diff --git a/routes/show-routes.js b/routes/show-routes.js index ee080bf7..f8d2334d 100644 --- a/routes/show-routes.js +++ b/routes/show-routes.js @@ -79,7 +79,7 @@ module.exports = (app) => { } // serve the file or the show route postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('show', { fileInfo }); + res.status(200).render('show', { layout: 'show', fileInfo }); }) .catch(error => { errorHandlers.handleRequestError('show', originalUrl, ip, error, res); @@ -97,7 +97,7 @@ module.exports = (app) => { } // serve the show route postToStats('show', originalUrl, ip, fileInfo.name, fileInfo.claimId, 'success'); - res.status(200).render('show', { fileInfo }); + res.status(200).render('show', { layout: 'show', fileInfo }); }) .catch(error => { errorHandlers.handleRequestError('show', originalUrl, ip, error, res); diff --git a/speech.js b/speech.js index 11390776..ae6a7e7d 100644 --- a/speech.js +++ b/speech.js @@ -72,22 +72,6 @@ const hbs = expressHandlebars.create({ return options.inverse(this); } }, - grouped_each (every, context, options) { - let out = ''; - let subcontext = []; - let i; - if (context && context.length > 0) { - for (i = 0; i < context.length; i++) { - if (i > 0 && i % every === 0) { - out += options.fn(subcontext); - subcontext = []; - } - subcontext.push(context[i]); - } - out += options.fn(subcontext); - } - return out; - }, }, }); app.engine('handlebars', hbs.engine); diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index a3babda6..dc6c235c 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -7,6 +7,7 @@