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

<c:if test="<%= hasPermission %>">
	<div class="row">
		<div class="col-12">
			<commerce-ui:panel
				bodyClasses="p-0"
				title='<%= LanguageUtil.get(request, "rules") %>'
			>
				<aui:fieldset helpMessage="select-whether-rules-should-be-evaluated-in-and-or-or">
					<div class="d-flex justify-content-end p-3">
						<div class="font-weight-bold mr-3 small"><liferay-ui:message key="rules-connector" /></div>
						<div class="mr-3">
							<aui:input checked="<%= commerceDiscount.isRulesConjunction() %>" label='<%= LanguageUtil.get(request, "and") %>' name="rulesConjunction" type="radio" value="<%= true %>" />
						</div>

						<div>
							<aui:input checked="<%= !commerceDiscount.isRulesConjunction() %>" label='<%= LanguageUtil.get(request, "or") %>' name="rulesConjunction" type="radio" value="<%= false %>" />
						</div>
					</div>
				</aui:fieldset>

				<frontend-data-set:headless-display
					apiURL="<%= commerceDiscountDisplayContext.getDiscountRulesApiURL() %>"
					creationMenu="<%= commerceDiscountDisplayContext.getDiscountRuleCreationMenu() %>"
					fdsActionDropdownItems="<%= commerceDiscountDisplayContext.getDiscountRulesFDSActionDropdownItem() %>"
					formName="fm"
					id="<%= CommercePricingFDSNames.DISCOUNT_RULES %>"
					itemsPerPage="<%= 10 %>"
				/>
			</commerce-ui:panel>
		</div>
	</div>
</c:if>