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

<%
CommercePriceListDisplayContext commercePriceListDisplayContext = (CommercePriceListDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
%>

<portlet:actionURL name="/commerce_price_list/edit_commerce_price_modifier" var="editCommercePriceModifierActionURL" />

<commerce-ui:modal-content
	title='<%= LanguageUtil.get(request, "add-price-modifier") %>'
>
	<div class="col-12 lfr-form-content">
		<aui:form action="<%= editCommercePriceModifierActionURL %>" cssClass="container-fluid-1280" method="post" name="fm">
			<aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.ADD %>" />
			<aui:input name="redirect" type="hidden" value="<%= currentURL %>" />
			<aui:input name="commercePriceListId" type="hidden" value="<%= commercePriceListDisplayContext.getCommercePriceListId() %>" />

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

			<aui:input label="name" name="title" required="<%= true %>" />

			<aui:select name="target" required="<%= true %>" showEmptyOption="<%= true %>">

				<%
				for (String target : CommercePriceModifierConstants.TARGETS) {
				%>

					<aui:option label="<%= target %>" value="<%= target %>" />

				<%
				}
				%>

			</aui:select>

			<aui:select label="modifier" name="modifierType" required="<%= true %>" showEmptyOption="<%= true %>">

				<%
				for (CommercePriceModifierType commercePriceModifierType : commercePriceListDisplayContext.getCommercePriceModifierTypes()) {
				%>

					<aui:option label="<%= commercePriceModifierType.getLabel(locale) %>" value="<%= commercePriceModifierType.getKey() %>" />

				<%
				}
				%>

			</aui:select>
		</aui:form>
	</div>
</commerce-ui:modal-content>