Changed the name of "multiple_found.jade" to "list.jade" and
Added linkbar to most other pages Made sure that auth.is is called when lookup.get calls that multiple matches are found.
This commit is contained in:
parent
d5528422f7
commit
d7d17de5d8
|
@ -25,7 +25,9 @@ function get(req, res, next, search) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
req.match = database_entry;
|
req.match = database_entry;
|
||||||
res.render('multiple_found', req);
|
require('./auth').is(req, res, function () {
|
||||||
|
res.render('list', req);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
//- list.jade
|
//- list.jade
|
||||||
include header
|
include header
|
||||||
|
include search
|
||||||
|
|
||||||
div=JSON.stringify(match, null, 2)
|
.container
|
||||||
|
ul.found
|
||||||
|
for entry in match
|
||||||
|
li
|
||||||
|
a(href='/rooster/' + entry.name)=entry.name
|
||||||
|
|
||||||
include linkbar
|
include linkbar
|
||||||
|
|
|
@ -11,3 +11,5 @@ include header
|
||||||
input(type="password", name="password")
|
input(type="password", name="password")
|
||||||
div
|
div
|
||||||
input(type="submit", value="Log In").button-primary
|
input(type="submit", value="Log In").button-primary
|
||||||
|
|
||||||
|
include linkbar
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
//- multiple_found.jade
|
|
||||||
include header
|
|
||||||
include search
|
|
||||||
|
|
||||||
.container
|
|
||||||
ul.found
|
|
||||||
for entry in match
|
|
||||||
li
|
|
||||||
a(href='/rooster/' + entry.name)=entry.name
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
//- search.jade
|
//- search.jade
|
||||||
input.search(type="text", name="searchterm", placeholder="Je naam, id, klassennaam, docentencode, lokaalcode", value=path.split('/')[1] == 'klassenlijst' ? 'Leerlingen van ' + match[0].group : match ? ((match.first_name || match.name) + '\'s rooster') : '')
|
input.search(type="text", name="searchterm", placeholder="Je naam, id, klassennaam, docentencode, lokaalcode", value=path.split('/')[1] == 'klassenlijst' ? 'Leerlingen van ' + match[0].group : match ? ((match.first_name || match.name || 'Meerdere mensen hun rooster') + '\'s rooster') : '')
|
||||||
button.search Zoeken
|
button.search Zoeken
|
||||||
|
|
2
web.js
2
web.js
|
@ -49,7 +49,7 @@ app.get('/rooster/:search', [auth.is, schedule.get, function (req, res) {
|
||||||
app.param('list', lookup.list);
|
app.param('list', lookup.list);
|
||||||
|
|
||||||
app.get('/klassenlijst/:list',[auth.is, function (req, res) {
|
app.get('/klassenlijst/:list',[auth.is, function (req, res) {
|
||||||
res.render('multiple_found', req);
|
res.render('list', req);
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
app.listen(config().web_port);
|
app.listen(config().web_port);
|
||||||
|
|
Loading…
Reference in a new issue