{% load i18n static sekizai_tags cms_tags %}{% spaceless %}

{% include "shop/djng-form.html" %}

{% if stylesheet_url %}{% addtoblock "css" %}<link href="{{ stylesheet_url }}" rel="stylesheet" type="text/css" />{% endaddtoblock %}{% endif %}

{% with instance_css_classes=instance.css_classes instance_inline_styles=instance.inline_styles %}
{% if many %}
	<div class="alert alert-warning">
	{% blocktrans %}
		Please embed this plugin into a <code>SegmentationPlugin</code> with condition <code>if not many</code>.
	{% endblocktrans %}
	</div>
{% elif data.cancelable %}
	{% page_url "shop-cart" as shop_cart_url %}
	<form name="cancel_order_form" djng-endpoint="{{ request.path_info }}">
		<button ng-click="do(create({cancel: true})).then(showOK()).then(delay(333)).then(reloadPage())"{% if instance_css_classes %} class="{{ instance_css_classes }}"{% endif %}{% if instance_inline_styles %} style="{{ instance_inline_styles }}"{% endif %}>
			{{ icon_left }}{{ button_label }}{{ icon_right }}
		</button>
	</form>
{% else %}
	<div class="{{ instance_css_classes }} disabled">
		{% trans "This Order can't be cancelled" %}
	</div>
{% endif %}
	{% endwith %}
{% endspaceless %}
