bootstrap is weird

This commit is contained in:
2019-01-28 13:54:35 +01:00
parent 03a94a7cc7
commit 53ecdd448b
2 changed files with 3 additions and 22 deletions

View File

@@ -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()
})

View File

@@ -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>