Commit 2eb4aecc authored by Mariana Carmin's avatar Mariana Carmin

Lista arquivos na busca

parent e9dcbbc9
......@@ -2,7 +2,11 @@
<% include partials/head %>
<body>
<% include partials/basic-header %>
<p> <%= b %> </p>
<% for(var i=0; i < arquivos.length; i++) { %>
<li class="list-item text-left">
<%= arquivos[i].nome %> - <%= arquivos[i].arquivo %>
</li>
<% } %>
<% include partials/footer %>
</body>
</html>
\ No newline at end of file
No preview for this file type
No preview for this file type
......@@ -66,9 +66,14 @@ router.get('/search', function(req, res) {
})
router.post('/search', function(req, res) {
var bus = req.body.query
console.log(bus);
res.render('search', {b: bus})
//res.render('search', {b: arquivos[0].nome})
Arquivo.find()
.sort([['codigo', 'ascending']])
.exec(function(err, arquivos) {
if(!err) {
return res.render('search', {arquivos: arquivos})
}
})
})
router.get('/logout', function(req, res) {
......@@ -169,7 +174,8 @@ router.post('/conta', role.isLoggedIn(), function(req, res) {
})
router.get('/upload', role.isLoggedIn(), function(req, res) {
Materia.find(function(err, materias) {
Materia.find(function(err, materias)
{
if(!err) {
Professor.find(function(err, professores) {
if(!err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment