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

<%
ViewHistoryDisplayContext viewHistoryDisplayContext = (ViewHistoryDisplayContext)request.getAttribute(CTWebKeys.VIEW_HISTORY_DISPLAY_CONTEXT);

SearchContainer<CTProcess> searchContainer = viewHistoryDisplayContext.getSearchContainer();
%>

<clay:navigation-bar
	navigationItems="<%= viewHistoryDisplayContext.getViewNavigationItems() %>"
/>

<clay:management-toolbar
	managementToolbarDisplayContext="<%= new ViewHistoryManagementToolbarDisplayContext(request, liferayPortletRequest, liferayPortletResponse, searchContainer, viewHistoryDisplayContext) %>"
/>

<clay:container-fluid>
	<div class="container-view">
		<c:choose>
			<c:when test="<%= !searchContainer.hasResults() && viewHistoryDisplayContext.isSearch() %>">
				<liferay-ui:empty-result-message
					message="no-publication-has-been-published-yet"
					search="<%= true %>"
				/>
			</c:when>
			<c:when test="<%= !searchContainer.hasResults() %>">
				<liferay-ui:empty-result-message
					message="no-publication-has-been-published-yet"
				/>
			</c:when>
			<c:otherwise>
				<div>
					<span aria-hidden="true" class="loading-animation"></span>

					<react:component
						module="publications/js/PublicationsHistoryView"
						props="<%= viewHistoryDisplayContext.getReactProps() %>"
					/>
				</div>
			</c:otherwise>
		</c:choose>

		<liferay-ui:search-paginator
			markupView="lexicon"
			searchContainer="<%= searchContainer %>"
		/>
	</div>
</clay:container-fluid>