merge conflicts + updated search.tpl to BS3

v1.18.x
psychobunny 12 years ago
commit 3773f6b44f

@ -11,4 +11,8 @@
height:48px;
margin-right:10px;
}
}
.category.search #topics-container {
margin-left: -38px;
}

@ -55,6 +55,8 @@
<div class="alert alert-notify">
<strong>Minimum Username Length</strong><br /> <input type="text" class="" value="2" data-field="minimumUsernameLength"><br />
<strong>Maximum Username Length</strong><br /> <input type="text" class="" value="16" data-field="maximumUsernameLength"><br />
<strong>Minimum Password Length</strong><br /> <input type="text" class="" value="6" data-field="minimumPasswordLength"><br />
<strong>Maximum Password Length</strong><br /> <input type="text" class="" value="16" data-field="maximumPasswordLength"><br />
</div>
</form>

@ -3,17 +3,15 @@
<li class="active">Search</li>
</ol>
<div class="alert alert-warning {show_no_results}" id="no-search-results">
<strong>No search results for {search_query}.</strong>
</div>
<div class="category row">
<div class="col-md-12">
<div class="category search">
<div class="">
<ul id="topics-container" data-search-query="{search_query}">
<h3>Topics</h3>
<div class="alert alert-info {show_no_topics}">No topics found!</div>
<!-- BEGIN topics -->
<a href="../../topic/{topics.slug}" id="tid-{topics.tid}">
<li class="category-item">
<div class="row">
<div>
<div class="col-md-12 img-thumbnail">
<div class="search-result-post">
<img src="{topics.teaser_userpicture}" />
@ -25,10 +23,12 @@
</li>
</a>
<!-- END topics -->
<h3>Posts</h3>
<div class="alert alert-info {show_no_posts}">No posts found!</div>
<!-- BEGIN posts -->
<a href="../../topic/{posts.topicSlug}#{posts.pid}" id="tid-{posts.tid}">
<li class="category-item">
<div class="row">
<div>
<div class="col-md-12 img-thumbnail">
<div class="search-result-post">
<img src="{posts.picture}" />

@ -183,9 +183,11 @@ var user = require('./../user.js'),
app.get('/api/search', function(req, res) {
return res.json({
show_no_results:'hide',
show_no_topics:'hide',
show_no_posts:'hide',
search_query:'',
posts:[]
posts:[],
topics:[]
});
});
@ -228,9 +230,10 @@ var user = require('./../user.js'),
async.parallel([searchPosts, searchTopics], function(err, results) {
if (err)
return next();
var noresults = !results[0].length && !results[1].length;
return res.json({
show_no_results: noresults?'show':'hide',
show_no_topics: results[1].length? 'hide':'',
show_no_posts: results[0].length? 'hide':'',
search_query:req.params.term,
posts:results[0],
topics:results[1]

Loading…
Cancel
Save