<%--
/**
 * 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="/order_transitions/init.jsp" %>

<%
CommerceOrder commerceOrder = (CommerceOrder)request.getAttribute("liferay-commerce:order-transitions:commerceOrder");
List<ObjectValuePair<Long, String>> commerceOrderTransitionOVPs = (List<ObjectValuePair<Long, String>>)request.getAttribute("liferay-commerce:order-transitions:commerceOrderTransitionOVPs");
String cssClass = (String)request.getAttribute("liferay-commerce:order-transitions:cssClass");
%>

<c:if test="<%= !commerceOrderTransitionOVPs.isEmpty() %>">
	<div id="<portlet:namespace />orderTransition">

		<%
		for (int i = 0; i < commerceOrderTransitionOVPs.size(); i++) {
			ObjectValuePair<Long, String> transitionOVP = commerceOrderTransitionOVPs.get(i);

			String transitionName = transitionOVP.getValue();
		%>

			<button class="<%= cssClass %> transition-link" data-commerceOrderId="<%= commerceOrder.getCommerceOrderId() %>" data-transitionName="<%= HtmlUtil.escapeAttribute(transitionOVP.getValue()) %>" data-workflowTaskId="<%= transitionOVP.getKey() %>" type="button">
				<%= LanguageUtil.get(request, HtmlUtil.escape(transitionName)) %>
			</button>

		<%
		}
		%>

	</div>
</c:if>