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

<%
JournalDisplayContext journalDisplayContext = JournalDisplayContext.create(request, liferayPortletRequest, liferayPortletResponse, null, null);

JournalFolder folder = journalDisplayContext.getFolder();
%>

<c:if test="<%= folder != null %>">
	<div class="aspect-ratio aspect-ratio-8-to-3 bg-light mb-4">
		<div class="aspect-ratio-item-center-middle aspect-ratio-item-fluid card-type-asset-icon">
			<div class="text-secondary">
				<svg aria-hidden="true" class="h4 lexicon-icon lexicon-icon-folder reference-mark">
					<use xlink:href="<%= themeDisplay.getPathThemeSpritemap() %>#folder" />
				</svg>
			</div>
		</div>
	</div>

	<c:if test="<%= Validator.isNotNull(folder.getDescription()) %>">
		<div class="asset-content mb-3">
			<%= HtmlUtil.replaceNewLine(HtmlUtil.escape(folder.getDescription())) %>
		</div>
	</c:if>

	<div class="asset-details mb-3">

		<%
		int foldersCount = JournalFolderServiceUtil.getFoldersCount(folder.getGroupId(), folder.getFolderId(), journalDisplayContext.getStatus());
		%>

		<%= foldersCount %> <liferay-ui:message key='<%= (foldersCount == 1) ? "subfolder" : "subfolders" %>' />
	</div>

	<div class="asset-details mb-3">

		<%
		int entriesCount = JournalArticleServiceUtil.getArticlesCount(folder.getGroupId(), folder.getFolderId(), journalDisplayContext.getStatus());
		%>

		<%= entriesCount %> <liferay-ui:message key='<%= (entriesCount == 1) ? "article" : "articles" %>' />
	</div>

	<div class="asset-custom-attributes">
		<liferay-expando:custom-attributes-available
			className="<%= JournalFolder.class.getName() %>"
		>
			<liferay-expando:custom-attribute-list
				className="<%= JournalFolder.class.getName() %>"
				classPK="<%= folder.getFolderId() %>"
				editable="<%= false %>"
				label="<%= true %>"
			/>
		</liferay-expando:custom-attributes-available>
	</div>
</c:if>