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

<%
FragmentServiceConfigurationDisplayContext fragmentServiceConfigurationDisplayContext = (FragmentServiceConfigurationDisplayContext)request.getAttribute(FragmentServiceConfigurationDisplayContext.class.getName());
%>

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

		<clay:sheet-header>
			<h2>
				<liferay-ui:message key="fragment-configuration-name" />
			</h2>

			<c:if test="<%= fragmentServiceConfigurationDisplayContext.showInfoMessage() %>">
				<clay:alert
					message="this-configuration-is-not-saved-yet.-the-values-shown-are-the-default"
				/>
			</c:if>
		</clay:sheet-header>

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

				<react:component
					module="js/FragmentServiceConfiguration"
					props='<%=
						HashMapBuilder.<String, Object>put(
							"alreadyPropagateContributedFragmentChanges", fragmentServiceConfigurationDisplayContext.isAlreadyPropagateContributedFragmentChanges()
						).put(
							"namespace", liferayPortletResponse.getNamespace()
						).put(
							"propagateChanges", fragmentServiceConfigurationDisplayContext.isPropagateChangesEnabled()
						).put(
							"propagateContributedFragmentChanges", fragmentServiceConfigurationDisplayContext.isPropagateContributedFragmentChangesEnabled()
						).put(
							"propagateContributedFragmentEntriesChangesURL", fragmentServiceConfigurationDisplayContext.getPropagateContributedFragmentEntriesChangesURL()
						).build()
					%>'
				/>
			</div>
		</clay:sheet-section>

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

			<aui:button type="cancel" />
		</clay:sheet-footer>
	</clay:sheet>
</aui:form>