mirror of
https://github.com/bvanroll/yahoo-thing.git
synced 2025-08-29 12:02:48 +00:00
pls
This commit is contained in:
2
index.js
2
index.js
@@ -54,7 +54,7 @@ app.post('/search', (req, res) => {
|
|||||||
temp = client.db().collection("questions").find(query).toArray(function(err, data) {
|
temp = client.db().collection("questions").find(query).toArray(function(err, data) {
|
||||||
arr = splice(data)
|
arr = splice(data)
|
||||||
page = 0 + parseInt(req.body.page, 10)
|
page = 0 + parseInt(req.body.page, 10)
|
||||||
res.render('index', {data: arr[page],page:page,pagenums:Array.from(new Array(arr.length), (x,i) => i),maxpages:arr.length})
|
res.render('index', {search:req.body.title, data: arr[page],page:page,pagenums:Array.from(new Array(arr.length), (x,i) => i),maxpages:arr.length})
|
||||||
client.close()
|
client.close()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@@ -19,4 +19,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class='bottomthing'>
|
||||||
|
<form action='/search'> method='post'>
|
||||||
|
<input type="hidden" value="{{this.search}}">
|
||||||
|
<ul>
|
||||||
|
{{#each this.pagenums}}
|
||||||
|
<li><input type="submit" value="{{this}}">{{this}}</input></li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user