v1.18.x
Baris Soner Usakli 11 years ago
parent 9d88b9eed3
commit 27a01f6c61

@ -15,41 +15,54 @@
<div class="category search"> <div class="category search">
<div class="{show_results}"> <div class="{show_results}">
<ul id="topics-container" data-search-query="{search_query}">
<h3>[[topic:topics]]</h3> <h3>[[topic:topics]]</h3>
<!-- IF topic_matches -->
<small>{topic_matches} result(s) matching "{search_query}"</small>
<!-- ENDIF topic_matches -->
<div class="alert alert-info {show_no_topics}">[[topic:no_topics_found]]</div> <div class="alert alert-info {show_no_topics}">[[topic:no_topics_found]]</div>
<!-- BEGIN topics -->
<a href="../../topic/{topics.slug}" id="tid-{topics.tid}"> <ul id="topics-container" data-search-query="{search_query}">
<!-- BEGIN topics -->
<li class="category-item"> <li class="category-item">
<div> <a href="../../topic/{topics.slug}" id="tid-{topics.tid}">
<div class="col-md-12 img-thumbnail"> <div>
<div class="search-result-post"> <div class="col-md-12 img-thumbnail">
<img src="{topics.teaser_userpicture}" /> <div class="search-result-post">
<strong>{topics.teaser_username}</strong>: <span class="search-result-text">{topics.title}</span> <img src="{topics.teaser_userpicture}" />
</div> <strong>{topics.teaser_username}</strong>: <span class="search-result-text">{topics.title}</span>
</div>
</div>
</div> </div>
</div> </a>
</li> </li>
</a> <!-- END topics -->
<!-- END topics --> </ul>
<h3>Posts</h3> <h3>Posts</h3>
<!-- IF post_matches -->
<small>{post_matches} result(s) matching "{search_query}"</small>
<!-- ENDIF post_matches -->
<div class="alert alert-info {show_no_posts}">No posts found!</div> <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}"> <ul id="topics-container" data-search-query="{search_query}">
<!-- BEGIN posts -->
<li class="category-item"> <li class="category-item">
<div> <a href="../../topic/{posts.topicSlug}#{posts.pid}" id="tid-{posts.tid}">
<div class="col-md-12 img-thumbnail"> <div>
<div class="search-result-post"> <div class="col-md-12 img-thumbnail">
<img src="{posts.picture}" /> <div class="search-result-post">
<strong>{posts.username}</strong>: <span class="search-result-text">{posts.content}</span> <img src="{posts.picture}" />
</div> <strong>{posts.username}</strong>: <span class="search-result-text">{posts.content}</span>
</div>
</div>
</div> </div>
</div> </a>
</li> </li>
</a> <!-- END posts -->
<!-- END posts -->
</ul> </ul>
</div> </div>
</div> </div>

@ -270,7 +270,9 @@ var path = require('path'),
show_results: '', show_results: '',
search_query: req.params.term, search_query: req.params.term,
posts: results[0], posts: results[0],
topics: results[1] topics: results[1],
post_matches : results[0].length,
topic_matches : results[1].length
}); });
}); });
} else { } else {

Loading…
Cancel
Save