<%--
/**
 * 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="align-items-center d-flex justify-content-end px-3">
						<div class="mr-3"><%= LanguageUtil.get(request, "rules-connector") %></div>
						<div class="mr-3">
							<aui:input checked="<%= commerceDiscount.isRulesConjunction() %>" label="And" name="rulesConjunction" type="radio" value="<%= true %>" />
						</div>

						<div>
							<aui:input checked="<%= !commerceDiscount.isRulesConjunction() %>" label="Or" name="rulesConjunction" type="radio" value="<%= false %>" />
						</div>
					</div>
				</aui:fieldset>

				<clay:headless-data-set-display
					apiURL="<%= commerceDiscountDisplayContext.getDiscountRulesApiURL() %>"
					clayDataSetActionDropdownItems="<%= commerceDiscountDisplayContext.getDiscountRulesClayDataSetActionDropdownItem() %>"
					creationMenu="<%= commerceDiscountDisplayContext.getDiscountRuleCreationMenu() %>"
					formId="fm"
					id="<%= CommercePricingDataSetConstants.COMMERCE_DATA_SET_KEY_DISCOUNT_RULES %>"
					itemsPerPage="<%= 10 %>"
					namespace="<%= liferayPortletResponse.getNamespace() %>"
					pageNumber="<%= 1 %>"
					portletURL="<%= portletDiscountRuleURL %>"
				/>
			</commerce-ui:panel>
		</div>
	</div>
</c:if>