Add location to gear route
parent
3ec54868f9
commit
bd5f69e20e
|
@ -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 += ' → <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,
|
||||
|
|
Loading…
Reference in New Issue