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

<%
boolean manageNotesPermission = commerceOrderContentDisplayContext.hasModelPermission(commerceOrder, CommerceOrderActionKeys.MANAGE_COMMERCE_ORDER_NOTES);
boolean manageRestrictedNotesPermission = commerceOrderContentDisplayContext.hasModelPermission(commerceOrder, CommerceOrderActionKeys.MANAGE_COMMERCE_ORDER_RESTRICTED_NOTES);
%>

<portlet:actionURL name="/commerce_open_order_content/edit_commerce_order" var="editRequestQuoteURL" />

<aui:form action="<%= editRequestQuoteURL %>" method="post" name="requestQuoteFm">
	<liferay-ui:error exception="<%= CommerceOrderNoteContentException.class %>" message="please-enter-valid-content" />

	<aui:model-context model="<%= CommerceOrderNote.class %>" />

	<div class="hide" id="<portlet:namespace />requestQuoteNote">
		<aui:input name="<%= Constants.CMD %>" type="hidden" value="requestQuote" />
		<aui:input name="commerceOrderId" type="hidden" value="<%= commerceOrder.getCommerceOrderId() %>" />

		<c:if test="<%= manageNotesPermission || manageRestrictedNotesPermission %>">
			<aui:input label="" name="content" placeholder="type-your-note-here" type="textarea" />

			<div class="order-notes-submit-actions">
				<c:if test="<%= manageRestrictedNotesPermission %>">
					<aui:input helpMessage="restricted-help" label="private" name="restricted" />
				</c:if>
			</div>
		</c:if>
	</div>
</aui:form>

<liferay-frontend:component
	module="js/requestQuote"
/>