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

<%
PDFPreviewConfigurationDisplayContext pdfPreviewConfigurationDisplayContext = (PDFPreviewConfigurationDisplayContext)request.getAttribute(PDFPreviewConfigurationDisplayContext.class.getName());
%>

<aui:form action="<%= pdfPreviewConfigurationDisplayContext.getEditPDFPreviewConfigurationURL() %>" method="post" name="fm">
	<clay:sheet>
		<liferay-ui:error exception="<%= ConfigurationModelListenerException.class %>" message="there-was-an-unknown-error" />

		<liferay-ui:error exception="<%= PDFPreviewException.class %>">
			<liferay-ui:message key="maximum-number-of-pages-limit-is-not-valid" />
		</liferay-ui:error>

		<clay:sheet-header>
			<h2 class="sheet-title">
				<liferay-ui:message key="pdf-preview-configuration-name" />
			</h2>

			<div class="sheet-text">
				<liferay-ui:message key="maximum-number-of-pages-help" />
			</div>
		</clay:sheet-header>

		<clay:sheet-section>
			<span aria-hidden="true" class="loading-animation"></span>

			<react:component
				module="document_library_preview_pdf_settings/js/PDFPreviewLimit"
				props='<%=
					HashMapBuilder.<String, Object>put(
						"maxLimitSize", pdfPreviewConfigurationDisplayContext.getMaxLimitSize()
					).put(
						"namespace", liferayPortletResponse.getNamespace()
					).put(
						"scopeLabel", pdfPreviewConfigurationDisplayContext.getSuperiorScopeLabel()
					).put(
						"value", pdfPreviewConfigurationDisplayContext.getMaxNumberOfPages()
					).build()
				%>'
			/>
		</clay:sheet-section>

		<clay:sheet-footer>
			<aui:button primary="<%= true %>" type="submit" value="save" />
		</clay:sheet-footer>
	</clay:sheet>
</aui:form>