-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_results.hbs
109 lines (100 loc) · 3.68 KB
/
search_results.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<section class="section hero hero-small">
<header class="hero-inner">
<div class="hero-inner-search">
{{search submit=false instant=settings.instant_search class="search search-full" placeholder="Search knowledge base..."}}
</div>
</header>
</section>
<div class="container">
<nav class="sub-nav">{{breadcrumbs}}</nav>
<div class="search-results">
<h2 class="search-results-heading">
{{#if results_count}}Hiya! {{else}}Oh! {{/if}}
{{t 'results' query=query count=results_count}}
{{#if results_count}} 🎉{{else}} 🙈{{/if}}
</h2>
{{#if results_count}}
<ul class="search-results-list">
{{!-- Knowledge base aritcles --}}
{{#if article_results}}
{{#each article_results}}
<li class="search-result">
<a href="{{url}}" class="search-result-link">{{title}}</a>
<div class="search-result-description">{{text}}</div>
<ul class="meta-group">
<li>
<ol class="breadcrumbs search-result-breadcrumbs">
{{#each path_steps}}
{{#is url '#'}}
<li title="{{name}}">{{name}}</li>
{{else}}
{{!-- blank space around <a> tag is intentional to match {{breadcrumbs}} behavior --}}
<li title="{{name}}"> <a href="{{url}}">{{name}}</a> </li>
{{/is}}
{{/each}}
</ol>
</li>
<li class="meta-data">
{{#if edited_at}}Updated {{date edited_at timeago=true}}
{{else}}Published {{date created_at timeago=true}}{{/if}}
</li>
{{#if vote_sum}}
<li class="meta-data"><span class="search-result-votes meta-count">{{vote_sum}}</span></li>
{{/if}}
{{#if comment_count}}
<li class="meta-data"><span class="search-result-comments meta-count">{{comment_count}}</span></li>
{{/if}}
</ul>
</li>
{{/each}}
{{/if}}
{{!-- Community posts --}}
{{#if help_center.community_enabled}}
{{#if post_results}}
{{#each post_results}}
<li class="search-result">
<a href="{{url}}" class="search-result-link">{{title}}</a>
<div class="search-result-description">{{text}}</div>
<ul class="meta-group">
<li>
<ol class="breadcrumbs search-result-breadcrumbs">
{{#each path_steps}}
{{#is url '#'}}
<li title="{{name}}">{{name}}</li>
{{else}}
{{!-- blank space around <a> tag is intentional to match {{breadcrumbs}} behavior --}}
<li title="{{name}}"> <a href="{{url}}">{{name}}</a> </li>
{{/is}}
{{/each}}
</ol>
</li>
<li class="meta-data">
{{#link 'user_profile' id=author.id}}
{{author.name}}
{{/link}}
</li>
<li class="meta-data">
{{#if edited_at}}Updated {{date edited_at timeago=true}}
{{else}}Posted {{date created_at timeago=true}}{{/if}}
</li>
{{#if vote_sum}}
<li class="meta-data"><span class="search-result-votes meta-count">{{vote_sum}}</span></li>
{{/if}}
{{#if comment_count}}
<li class="meta-data"><span class="search-result-comments meta-count">{{comment_count}}</span></li>
{{/if}}
</ul>
</li>
{{/each}}
{{/if}}
{{/if}}
</ul>
{{else}}
<p>
Sorry, we looked everywhere. Please try a different search, <a href="/hc/en-us#browse-knowledge-base">browse the
knowledge base</a> or <a href="/hc/en-us/requests/new">submit a request</a>.
</p>
{{/if}}
{{pagination}}
</div>
</div>