forked from mrvautin/openKB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkb.hbs
113 lines (113 loc) · 6.26 KB
/
kb.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
110
111
112
113
<div class="row">
<form action="{{app_context}}/search" id="search_form" method="post">
{{#ifBoth config.settings.show_featured_articles config.settings.show_featured_in_article}}
<div class="col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1 search_bar">
{{else}}
<div class="col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2 search_bar">
{{/ifBoth}}
<div class="input-group">
<input type="text" name="frm_search" id="frm_search" autocomplete="off" class="form-control input-lg" placeholder="{{__ "Search the knowledge base"}}">
<span class="input-group-btn">
<button class="btn btn-success btn-lg" id="btn_search" type="submit">{{__ "Search"}}</button>
</span>
</div>
{{#ifCond config.settings.typeahead_search '===' true}}
<div id="searchResult" class="hidden col-lg-12">
<ul class="list-group searchResultList"></ul>
</div>
{{/ifCond}}
</div>
</form>
</div>
<div class="row">
{{#ifBoth config.settings.show_featured_articles config.settings.show_featured_in_article}}
<div class="col-md-2 col-md-offset-1 col-lg-2 col-lg-offset-1">
<div style="margin-top: 30px;">
<ul class="list-group">
<li class="list-group-item list-group-heading">{{__ "Featured articles"}}</li>
{{#each featured_results}}
{{#if this.kb_permalink}}
<li class="list-group-item"><h5><a href="{{app_context}}/{{@root.config.settings.route_name}}/{{this.kb_permalink}}">{{this.kb_title}}</a></h5></li>
{{else}}
<li class="list-group-item"><h5><a href="{{app_context}}/{{@root.config.settings.route_name}}/{{this._id}}">{{this.kb_title}}</a></h5></li>
{{/if}}
{{/each}}
</ul>
</div>
</div>
<div class="col-md-8 col-lg-8">
{{else}}
<div class="col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2">
{{/ifBoth}}
<h1 style="padding-bottom: 25px;padding-top: 15px;">{{result.kb_title}}</h1>
<div class="body_text">
{{{kb_body}}}
</div>
{{#if config.settings.allow_voting}}
<div class="row">
<div class="voting text-right col-lg-12">
<span>{{__ "Was this article helpful?"}}</span>
<button id="btnUpvote" class="btn btn-sm btn-default"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i></button>
<button id="btnDownvote" class="btn btn-sm btn-default"><i class="fa fa-thumbs-o-down" aria-hidden="true"></i></button>
<span>
<strong>{{__ "Votes"}}:</strong>
{{#if result.kb_votes}}
{{result.kb_votes}}
{{else}}
0
{{/if}}
</span>
</div>
</div>
{{/if}}
{{#if config.settings.show_kb_meta}}
<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary" style="margin-top: 35px;">
<div class="panel-heading">{{__ "Article details"}}:</div>
<div class="panel-body">
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Published date"}}:</strong> {{format_date result.kb_published_date}}
</h5>
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Last updated"}}:</strong> {{format_date result.kb_last_updated}}
{{#if result.kb_last_update_user}}
<span class="text-info">
{{#ifCond config.settings.show_author_email '===' false}}
({{removeEmail result.kb_last_update_user}})
{{else}}
({{result.kb_last_update_user}})
{{/ifCond}}
</span>
{{/if}}
</h5>
{{#if result.kb_permalink}}
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Share article"}}:</strong> <a href="mailto:?subject={{result.kb_title}}&body={{encodeURI current_url}}/{{@root.config.settings.route_name}}/{{encodeURI result.kb_permalink}}" target="_top"><i class="fa fa-envelope" aria-hidden="true"></i></a>
</h5>
{{else}}
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Share article"}}:</strong> <a href="mailto:?subject={{result.kb_title}}&body={{encodeURI current_url}}/{{@root.config.settings.route_name}}/{{result._id}}" target="_top"><i class="fa fa-envelope" aria-hidden="true"></i></a>
</h5>
{{/if}}
{{#if result.kb_author}}
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Author"}}:</strong> <span class="text-info">{{result.kb_author}} {{#ifCond config.settings.show_author_email '===' true}}({{result.kb_author_email}}){{/ifCond}}</span>
</h5>
{{/if}}
{{#if result.kb_permalink}}
<h5 class="col-sm-12 col-lg-6">
<strong>{{__ "Permalink"}}:</strong> <a href="{{current_url}}/{{@root.config.settings.route_name}}/{{result.kb_permalink}}" target="_blank">{{current_url}}/{{@root.config.settings.route_name}}/{{result.kb_permalink}}</a>
</h5>
{{/if}}
</div>
</div>
</div>
</div>
{{/if}}
<h5 class="keywords">
{{{split_keywords result.kb_keywords}}}
</h5>
</div>
<input type="hidden" id="doc_id" value={{result._id}}>
</div>