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

<%
JournalArticle article = journalContentDisplayContext.getArticle();
%>

<liferay-ui:success key='<%= portletDisplay.getId() + "requestProcessed" %>' message="your-request-completed-successfully" />

<div class="visible-interaction">
	<liferay-ui:icon-menu
		cssClass="btn btn-monospaced btn-sm"
		direction="left-side"
		icon="<%= StringPool.BLANK %>"
		markupView="lexicon"
		message="web-content-options"
		showWhenSingleIcon="<%= true %>"
	>
		<c:if test="<%= journalContentDisplayContext.isShowEditArticleIcon() %>">

			<%
			JournalArticle latestArticle = journalContentDisplayContext.getLatestArticle();
			%>

			<liferay-ui:icon
				data='<%=
					HashMapBuilder.<String, Object>put(
						"destroyOnHide", true
					).put(
						"id", HtmlUtil.escape(portletDisplay.getNamespace()) + "editAsset"
					).put(
						"title", HtmlUtil.escape(latestArticle.getTitle(locale))
					).build()
				%>'
				id="editWebContentIcon"
				message="edit-web-content"
				url="<%= journalContentDisplayContext.getURLEdit() %>"
			/>
		</c:if>

		<c:if test="<%= journalContentDisplayContext.isShowEditTemplateIcon() %>">
			<liferay-ui:icon
				id="editTemplateIcon"
				message="edit-template"
				url="<%= journalContentDisplayContext.getURLEditTemplate() %>"
			/>
		</c:if>

		<c:if test="<%= JournalArticlePermission.contains(permissionChecker, article, ActionKeys.PERMISSIONS) %>">
			<liferay-security:permissionsURL
				modelResource="<%= JournalArticle.class.getName() %>"
				modelResourceDescription="<%= HtmlUtil.escape(article.getTitle(locale)) %>"
				resourcePrimKey="<%= String.valueOf(article.getResourcePrimKey()) %>"
				var="permissionsURL"
				windowState="<%= LiferayWindowState.POP_UP.toString() %>"
			/>

			<liferay-ui:icon
				message="permissions"
				method="get"
				url="<%= permissionsURL %>"
				useDialog="<%= true %>"
			/>
		</c:if>

		<c:if test="<%= JournalArticlePermission.contains(permissionChecker, article, ActionKeys.UPDATE) %>">

			<%
			JournalArticle latestArticle = journalContentDisplayContext.getLatestArticle();
			%>

			<liferay-ui:icon
				data='<%=
					HashMapBuilder.<String, Object>put(
						"destroyOnHide", true
					).put(
						"id", HtmlUtil.escape(portletDisplay.getNamespace()) + "editAsset"
					).put(
						"title", HtmlUtil.escape(latestArticle.getTitle(locale))
					).build()
				%>'
				id="basicViewHistoryIcon"
				message="view-history"
				url="<%= journalContentDisplayContext.getURLViewHistory() %>"
			/>
		</c:if>
	</liferay-ui:icon-menu>
</div>