<commit_before>{% extends "shop/base.html" %}
{% load mezzanine_tags shop_tags i18n future %}

{% block meta_title %}{% trans "Your Cart" %}{% endblock %}
{% block title %}{% trans "Your Cart" %}{% endblock %}

{% block breadcrumb_menu %}
{{ block.super }}
<li>{% trans "Your Cart" %}</li>
{% endblock %}

{% block main %}
{% if request.cart.has_items %}
<form method="post" class="form-cart form-shop">
{% csrf_token %}
{% if cart_formset.errors %}
<div class="control-group error">
<span class="help-inline">
{% for error in cart_formset.errors %}
{% if error.values.0 %}{{ error.values.0 }}{% endif %}
{% endfor %}
</span>
</div>
{% endif %}
{{ cart_formset.management_form }}
<table class="table table-striped">
	<tr>
		<th colspan="2" class="left">{% trans "Item" %}</th>
		<th>{% trans "Unit Price" %}</th>
		<th class="center">{% trans "Qty" %}</th>
		<th>{% trans "Price" %}</th>
		<th class="center">{% trans "Remove?" %}</th>
	</tr>
    {% for form in cart_formset.forms %}
    {% with form.instance as item %}
	<tr>
		<td width="30">
            {{ form.id }}
			{% if item.image %}
			<a href="{{ item.get_absolute_url }}">
                <img alt="{{ item.description }}" src="{{ MEDIA_URL }}{% thumbnail item.image 30 30 %}">
            </a>
			{% endif %}
		</td>
		<td class="left">
		    <a href="{{ item.get_absolute_url }}">{{ item.description }}</a>
        </td>
		<td>{{ item.unit_price|currency }}</td>
		<td class="quantity">{{ form.quantity }}</td>
		<td>{{ item.total_price|currency }}</td>
		<td class="center">{{ form.DELETE }}</td>
	</tr>
	{% endwith %}
	{% endfor %}
	<tr>
		<td colspan="5">{% order_totals %}</td>
		<td>&nbsp;</td>
	</tr>
</table>
<div class="form-actions clearfix">
    <div class="form-actions-wrap">
    <a href="{% url "shop_checkout" %}" class="btn btn-primary btn-large">
        {% if request.session.order.step %}{% trans "Return to Checkout" %}{% else %}{% trans "Go to Checkout" %}{% endif %}
    </a>
    <input type="submit" name="update_cart" class="btn btn-large" value="{% trans "Update Cart" %}">
    </div>
</div>
</form>

{% if discount_form %}
<form method="post" class="discount-form form-horizontal">
    {% fields_for discount_form %}
    <input type="submit" class="btn" style="float:right" value="{% trans 'Apply' %}">
</form>
{% endif %}

{% with request.cart.upsell_products as upsell_products %}
{% if upsell_products %}
<h2>{% trans "You may also like:" %}</h2>
<ul id="related-products" class="thumbnails">
    {% for product in upsell_products %}
    <li>
        <a class="thumbnail" href="{{ product.get_absolute_url }}">
            <div class="img">
	            {% if product.image %}
	            <img src="{{ MEDIA_URL }}{% thumbnail product.image 90 90 %}" />
	            {% endif %}
            </div>
            <h6>{{ product }}</h6>
            {% if product.has_price %}
                {% if product.on_sale %}
                <span class="old-price">{{ product.unit_price|currency }}</span>
                {% endif %}
                <span class="price">{{ product.price|currency }}</span>
            {% endif %}
        </a>
    </li>
    {% endfor %}
</ul>
{% endif %}
{% endwith %}

{% else %}
<p>{% trans "Your Cart is empty." %}</p>
{% endif %}
{% endblock %}
<commit_msg>upgrade to BS3<commit_after>{% extends "shop/base.html" %}
{% load mezzanine_tags shop_tags i18n future %}

{% block meta_title %}{% trans "Your Cart" %}{% endblock %}
{% block title %}{% trans "Your Cart" %}{% endblock %}
{% block body_id %}category{% endblock %}

{% block breadcrumb_menu %}
{{ block.super }}
<li>{% trans "Your Cart" %}</li>
{% endblock %}

{% block main %}
{% if request.cart.has_items %}
<form method="post" class="form-cart form-shop">
{% csrf_token %}
{% if cart_formset.errors %}
<div class="control-group error">
<span class="help-inline">
{% for error in cart_formset.errors %}
{% if error.values.0 %}{{ error.values.0 }}{% endif %}
{% endfor %}
</span>
</div>
{% endif %}
{{ cart_formset.management_form }}
<table class="table table-striped">
	<tr>
		<th colspan="2" class="left">{% trans "Item" %}</th>
		<th>{% trans "Unit Price" %}</th>
		<th class="center">{% trans "Qty" %}</th>
		<th>{% trans "Price" %}</th>
		<th class="center">{% trans "Remove?" %}</th>
	</tr>
    {% for form in cart_formset.forms %}
    {% with form.instance as item %}
	<tr>
		<td width="30">
            {{ form.id }}
			{% if item.image %}
			<a href="{{ item.get_absolute_url }}">
                <img alt="{{ item.description }}" src="{{ MEDIA_URL }}{% thumbnail item.image 30 30 %}">
            </a>
			{% endif %}
		</td>
		<td class="left">
		    <a href="{{ item.get_absolute_url }}">{{ item.description }}</a>
        </td>
		<td>{{ item.unit_price|currency }}</td>
		<td class="quantity">{{ form.quantity }}</td>
		<td>{{ item.total_price|currency }}</td>
		<td class="center">{{ form.DELETE }}</td>
	</tr>
	{% endwith %}
	{% endfor %}
	<tr>
		<td colspan="5">{% order_totals %}</td>
		<td>&nbsp;</td>
	</tr>
</table>
<div class="form-actions clearfix">
    <div class="form-actions-wrap">
    <a href="{% url "shop_checkout" %}" class="btn btn-primary btn-lg">
        {% if request.session.order.step %}{% trans "Return to Checkout" %}{% else %}{% trans "Go to Checkout" %}{% endif %}
    </a>
    <input type="submit" name="update_cart" class="btn btn-default btn-lg" value="{% trans "Update Cart" %}">
    </div>
</div>
</form>

{% if discount_form %}
<form method="post" class="discount-form form-horizontal">
    {% fields_for discount_form %}
    <input type="submit" class="btn" style="float:right" value="{% trans 'Apply' %}">
</form>
{% endif %}

{% with request.cart.upsell_products as upsell_products %}
{% if upsell_products %}
<h2>{% trans "You may also like:" %}</h2>
<div class="row">
    {% for product in upsell_products %}
    <div class="col-sm-4 col-md-3">
        <a class="thumbnail" href="{{ product.get_absolute_url }}">
            <div class="img">
	            {% if product.image %}
	            <img src="{{ MEDIA_URL }}{% thumbnail product.image 90 90 %}" />
	            {% endif %}
            </div>
            <h6>{{ product }}</h6>
            {% if product.has_price %}
                {% if product.on_sale %}
                <span class="old-price">{{ product.unit_price|currency }}</span>
                {% endif %}
                <span class="price">{{ product.price|currency }}</span>
            {% endif %}
        </a>
    </div>
    {% endfor %}
</div>
{% endif %}
{% endwith %}

{% else %}
<p>{% trans "Your Cart is empty." %}</p>
{% endif %}
{% endblock %}

{'fraction_non_alphanumeric': 0.2217509845501363, 'fraction_numerical': 0.006513177824901545, 'mean_word_length': 3.018867924528302, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '658253', 'n_tokens_mistral': 2540, 'n_tokens_neox': 2234, 'n_words': 558}