mirror of
https://github.com/bvanroll/yahoo-thing.git
synced 2025-08-29 12:02:48 +00:00
bootstrap is weird
This commit is contained in:
3
index.js
3
index.js
@@ -34,11 +34,10 @@ app.get('/about', (req, res) => {
|
||||
})
|
||||
|
||||
app.post('/search', (req, res) => {
|
||||
console.log(req.body.title)
|
||||
MongoClient.connect("mongodb://localhost:27017/yahoo",(err, client) => {
|
||||
if (err) throw err
|
||||
var query = {title: new RegExp(req.body.title, 'gmi') }
|
||||
temp = client.db().collection("questions").find(query, {projection: {_id: 0}}).toArray(function(err, data) {
|
||||
temp = client.db().collection("questions").find(query).toArray(function(err, data) {
|
||||
res.render('index', {data: data})
|
||||
client.close()
|
||||
})
|
||||
|
@@ -5,10 +5,10 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">{{this.title}}</a>
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#{{this._id}}">{{this.title}}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-collapse collapse in">
|
||||
<div id="{{this._id}}" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<h3>description</h3>
|
||||
<p class="description">{{this.description}}</p>
|
||||
@@ -20,21 +20,3 @@
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="panel-group" id="accordion">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1">{{this.title}}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse1" class="panel-collapse collapse in">
|
||||
<div class="panel-body"> <h3>description</h3> <p> {{this.description}}</p> <h3>category</h3> <p>{{this.category}}</p> </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user