Add location to gear route

aedifex-rework
kts of kettek 2022-03-16 17:02:01 -07:00
parent 3ec54868f9
commit bd5f69e20e
1 changed files with 9 additions and 0 deletions

View File

@ -40,9 +40,18 @@ module.exports = (plugin, app) => {
content = app.dot.tables({...req.params, results, type: req.params.type, name: req.params.name, collection: req.params.collection})
}
// build the location
let loc = '<a href="/">'+app.live.conf['shortname']+'</a>'
let crumbs = req.path.split('/')
for (let i = 1; i < crumbs.length; i++) {
if (crumbs[i] == '') continue
loc += ' &#8594 <a href="'+crumbs.slice(0,i).join('/')+'/'+crumbs[i]+'/">'+(crumbs[i].replace('-', ' '))+'</a>'
}
res.render('index', {
content,
menu: app.live.menu,
location: loc,
title: 'gear',
www_name: app.live.conf.www_name,
www_copyright: app.live.conf.www_copyright,