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

Lista arquivos na busca

parent e9dcbbc9
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<% include partials/head %> <% include partials/head %>
<body> <body>
<% include partials/basic-header %> <% 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 %> <% include partials/footer %>
</body> </body>
</html> </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) { ...@@ -66,9 +66,14 @@ router.get('/search', function(req, res) {
}) })
router.post('/search', function(req, res) { router.post('/search', function(req, res) {
var bus = req.body.query //res.render('search', {b: arquivos[0].nome})
console.log(bus); Arquivo.find()
res.render('search', {b: bus}) .sort([['codigo', 'ascending']])
.exec(function(err, arquivos) {
if(!err) {
return res.render('search', {arquivos: arquivos})
}
})
}) })
router.get('/logout', function(req, res) { router.get('/logout', function(req, res) {
...@@ -169,7 +174,8 @@ router.post('/conta', role.isLoggedIn(), function(req, res) { ...@@ -169,7 +174,8 @@ router.post('/conta', role.isLoggedIn(), function(req, res) {
}) })
router.get('/upload', 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) { if(!err) {
Professor.find(function(err, professores) { Professor.find(function(err, professores) {
if(!err) { 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