<%--
/**
 * 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="/asset_categories_navigation/init.jsp" %>

<%
AssetCategoriesNavigationDisplayContext assetCategoriesNavigationDisplayContext = new AssetCategoriesNavigationDisplayContext(request, renderResponse);
%>

<c:choose>
	<c:when test="<%= !assetCategoriesNavigationDisplayContext.hasCategories() %>">
		<c:if test="<%= assetCategoriesNavigationDisplayContext.hidePortletWhenEmpty() %>">

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

		</c:if>

		<div class="alert alert-info">
			<liferay-ui:message key="there-are-no-categories" />
		</div>
	</c:when>
	<c:otherwise>
		<div class="categories-tree container-fluid-1280" id="<%= assetCategoriesNavigationDisplayContext.getNamespace() %>categoriesContainer">
			<react:component
				module="asset_categories_navigation/js/AssetCategoriesNavigationTreeView"
				props="<%= assetCategoriesNavigationDisplayContext.getData() %>"
			/>
		</div>
	</c:otherwise>
</c:choose>

<%
if (assetCategoriesNavigationDisplayContext.getCategoryId() > 0) {
	AssetCategoryUtil.addPortletBreadcrumbEntries(assetCategoriesNavigationDisplayContext.getCategoryId(), request, renderResponse.createRenderURL(), false);
}
%>