feat: Knowledge Base portal added.

This commit is contained in:
imtodor 2018-11-05 15:54:34 +02:00
Родитель 4f0e954ac4
Коммит af0ccc3236
5 изменённых файлов: 76 добавлений и 6 удалений

Просмотреть файл

@ -25,3 +25,4 @@ install-npm.sh
search.html search.html
start-docs.sh start-docs.sh
watch.sh watch.sh
knowledge-base.html

Просмотреть файл

@ -61,7 +61,7 @@ var searchViewModel = kendo.observable({
}, },
init: function () { init: function () {
var propertyNames = JSON.parse(localStorage.getItem(searchItemsStorageKey)); var propertyNames = false; // JSON.parse(localStorage.getItem(searchItemsStorageKey));
if (!propertyNames) { if (!propertyNames) {
propertyNames = []; propertyNames = [];

Просмотреть файл

@ -12,7 +12,7 @@
<li> <li>
<label class="custom-checkbox unselectable"><input type="checkbox" {% if page.res_type != 'kb' and page.res_type != 'api' %} disabled="true" {% endif %} data-bind="checked: documentation" /><span class="k-icon k-i-check"></span>Search in Documentation</label> <label class="custom-checkbox unselectable"><input type="checkbox" {% if page.res_type != 'kb' and page.res_type != 'api' %} disabled="true" {% endif %} data-bind="checked: documentation" /><span class="k-icon k-i-check"></span>Search in Documentation</label>
</li> </li>
{% if site.has_kb %} {% if site.has_kb_portal %}
<li> <li>
<label class="custom-checkbox unselectable"><input type="checkbox" {% if page.res_type == 'kb' %} disabled="true" {% endif %} data-bind="checked: kb" /><span class="k-icon k-i-check"></span>Search in Knowledge Base</label> <label class="custom-checkbox unselectable"><input type="checkbox" {% if page.res_type == 'kb' %} disabled="true" {% endif %} data-bind="checked: kb" /><span class="k-icon k-i-check"></span>Search in Knowledge Base</label>
</li> </li>
@ -26,10 +26,10 @@
</form> </form>
<script> <script>
var gcsInstance = '{{site.gcs_engine}}'; var gcsInstance = {% if page.slug == 'knowledge_base' %} '{{site.gcs_kb_engine}}' {% else %} '{{site.gcs_engine}}' {% endif %};
var gcsKey = '{{site.gcs_api_key}}'; var gcsKey = '{{site.gcs_api_key}}';
isKbPage = {% if page.res_type == 'kb' %} true {% else %} false {% endif %}; isKbPage = {% if page.res_type == 'kb' %} true {% else %} false {% endif %};
siteHasKbPortal = '{{ site.has_kb_portal }}' siteHasKbPortal = '{{ site.has_kb_portal }}';
</script> </script>
{% javascript "search-results" %} {% javascript "search-results" %}

Просмотреть файл

@ -1,7 +1,6 @@
--- ---
layout: default layout: default
--- ---
{% assign package = page.path | remove:'documentation/' | split:'/' | first %}
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
@ -25,7 +24,7 @@ layout: default
{% else %} {% else %}
<article> <article>
{% endif %} {% endif %}
{{ content }} {{ content }}
</article> </article>
{% if page.enable_prev_next == true %} {% if page.node.prev != null or page.node.next != null %} {% if page.enable_prev_next == true %} {% if page.node.prev != null or page.node.next != null %}

70
knowledge-base.html Normal file
Просмотреть файл

@ -0,0 +1,70 @@
---
title: Knowledge Base
heading: Knowledge Base
description: Knowledge Base Portal
is_search_page: true
sitemap: false
slug: knowledge_base
editable: false
include_in_navigation: {{ site.has_kb_portal }}
isNew: true
position: 1100
published: True
res_type: kb
---
<div class="container-fluid headbanner">
<div class="row">
<div class=" col-sm-10 col-sm-offset-1 col-lg-offset-2">
<div class="row mt-40">
<div class="col-sm-12">
<article>
<h1>{{ page.heading }}</h1>
<div class="local-search mt-20">
{% include search.html %}
</div>
</article>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid mt-30 mb-80">
<div class="row">
<div class="col-sm-10 col-sm-offset-1 col-lg-offset-2">
<div class="row">
<div class="col-sm-12">
<div id="search-container" style="display: none">
<div class="results-message mb-5"></div>
<div id="results" class="mb-20">
</div>
<div class="site-pager"></div>
</div>
<div id="no-results" style="display: none">
<h1>Sorry,</h1>
<h2>There were no results found. Maybe try a broader search or:</h2>
<ul class="list-unstyled">
<li>Make sure all words are spelled correctly.</li>
<li>Try different keywords.</li>
<li>Try more general keywords.</li>
<li class="mt-30"><a href="javascript:history.back()" class="go-back">{% include icons/arrow-left.svg %} Go back</a></li>
</ul>
</div>
<script type="text/x-kendo-template" id="results-template">
<div>
<h2><a href="#= url #">#= title #</a></h2>
<p>#= excerpt #</p>
<p><a href="#= url #">#= url #</a></p>
</div>
</script>
{% if site.old_kb_portal_link %}
Older KB articles can be found <a target="_blank" href="{{ site.old_kb_portal_link }}">here</a>.
{% endif %}
</div>
</div>
</div>
</div>
</div>