<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/display/init.jsp" %>

<%
KBArticle kbArticle = (KBArticle)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_ARTICLE);

KBNavigationDisplayContext kbNavigationDisplayContext = new KBNavigationDisplayContext(renderRequest, portalPreferences, kbDisplayPortletInstanceConfiguration, kbArticle);

request.setAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_NAVIGATION_DISPLAY_CONTEXT, kbNavigationDisplayContext);
%>

<c:choose>
	<c:when test="<%= kbArticle != null %>">
		<clay:row>
			<c:if test="<%= kbNavigationDisplayContext.isLeftNavigationVisible() %>">
				<clay:col
					md="3"
				>
					<liferay-util:include page="/display/view_navigation.jsp" servletContext="<%= application %>" />
				</clay:col>
			</c:if>

			<clay:col
				md='<%= kbNavigationDisplayContext.isLeftNavigationVisible() ? "9" : "12" %>'
			>
				<c:if test="<%= kbNavigationDisplayContext.isTopNavigationVisible() %>">
					<div class="kbarticle-navigation">
						<liferay-util:include page="/display/content_root_selector.jsp" servletContext="<%= application %>" />
					</div>
				</c:if>

				<liferay-util:include page="/display/view_kb_article.jsp" servletContext="<%= application %>" />
			</clay:col>
		</clay:row>
	</c:when>
	<c:otherwise>

		<%
		renderRequest.setAttribute(KBWebKeys.PORTLET_CONFIGURATOR_VISIBILITY, Boolean.TRUE);
		%>

		<div class="alert alert-info portlet-configuration">
			<aui:a href="<%= portletDisplay.getURLConfiguration() %>" label="please-configure-this-portlet-to-make-it-visible-to-all-users" onClick="<%= portletDisplay.getURLConfigurationJS() %>" />
		</div>
	</c:otherwise>
</c:choose>