]> git.parisson.com Git - diggersdigest.git/commitdiff
Collect templates for Cartridge.shop
authorThomas Fillon <thomas@parisson.com>
Mon, 7 Sep 2015 12:56:25 +0000 (14:56 +0200)
committerThomas Fillon <thomas@parisson.com>
Mon, 7 Sep 2015 12:56:25 +0000 (14:56 +0200)
25 files changed:
diggersdigest/templates/accounts/account_profile_update.html [new file with mode: 0644]
diggersdigest/templates/email/base.html
diggersdigest/templates/email/order_receipt.html [new file with mode: 0644]
diggersdigest/templates/email/order_receipt.txt [new file with mode: 0644]
diggersdigest/templates/email/receipt.html [new file with mode: 0644]
diggersdigest/templates/email/receipt_rtl.html [new file with mode: 0644]
diggersdigest/templates/pages/category.html [new file with mode: 0644]
diggersdigest/templates/shop/base.html [new file with mode: 0644]
diggersdigest/templates/shop/billing_shipping.html [new file with mode: 0644]
diggersdigest/templates/shop/cart.html [new file with mode: 0644]
diggersdigest/templates/shop/checkout.html [new file with mode: 0644]
diggersdigest/templates/shop/complete.html [new file with mode: 0644]
diggersdigest/templates/shop/confirmation.html [new file with mode: 0644]
diggersdigest/templates/shop/includes/order_details.html [new file with mode: 0644]
diggersdigest/templates/shop/includes/order_details_rtl.html [new file with mode: 0644]
diggersdigest/templates/shop/includes/order_totals.html [new file with mode: 0644]
diggersdigest/templates/shop/includes/order_totals.txt [new file with mode: 0644]
diggersdigest/templates/shop/includes/payment_fields.html [new file with mode: 0644]
diggersdigest/templates/shop/includes/user_panel.html [new file with mode: 0644]
diggersdigest/templates/shop/order_history.html [new file with mode: 0644]
diggersdigest/templates/shop/order_invoice.html [new file with mode: 0644]
diggersdigest/templates/shop/order_invoice_pdf.html [new file with mode: 0644]
diggersdigest/templates/shop/payment.html [new file with mode: 0644]
diggersdigest/templates/shop/product.html [new file with mode: 0644]
diggersdigest/templates/shop/wishlist.html [new file with mode: 0644]

diff --git a/diggersdigest/templates/accounts/account_profile_update.html b/diggersdigest/templates/accounts/account_profile_update.html
new file mode 100644 (file)
index 0000000..9ea1087
--- /dev/null
@@ -0,0 +1,7 @@
+{% extends "accounts/account_form.html" %}
+{% load i18n %}
+
+{% block account_form_actions %}
+{{ block.super }}
+<a class="btn btn-default btn-lg pull-left" href="{% url "shop_order_history" %}">{% trans "View past orders" %}</a>
+{% endblock %}
index 6030db4b5ab4162670e3a30a27bd8033f0b27234..ec4ad78657123210d693cea2bc1e19ddae1748eb 100644 (file)
@@ -1,3 +1,5 @@
-{% block main %}{% endblock %}
+{% load i18n %}
+{% get_current_language_bidi as LANGUAGE_BIDI %}
 
-<br><a href="http://{{ request.get_host }}">http://{{ request.get_host }}</a>
+{% block main %}
+{% endblock %}
diff --git a/diggersdigest/templates/email/order_receipt.html b/diggersdigest/templates/email/order_receipt.html
new file mode 100644 (file)
index 0000000..5a25212
--- /dev/null
@@ -0,0 +1,13 @@
+{% extends "email/base.html" %}
+{% load i18n %}
+
+
+{% block main %}
+
+{% if not LANGUAGE_BIDI %}
+    {% include "email/receipt.html" %}
+{% else %}
+    {% include "email/receipt_rtl.html" %}
+{% endif %}
+
+{% endblock %}
diff --git a/diggersdigest/templates/email/order_receipt.txt b/diggersdigest/templates/email/order_receipt.txt
new file mode 100644 (file)
index 0000000..f4e5e8b
--- /dev/null
@@ -0,0 +1,27 @@
+{% extends "email/base.txt" %}
+{% load shop_tags i18n %}
+
+{% block main %}
+{% trans "Dear" %} {{ order.billing_detail_first_name }},
+
+{% trans "Your order has been successful, details are below." %}
+
+{% trans "Order ID:" %} #{{ order.id }}
+
+{% trans "Billing Details:" %}
+{% for field, value in order_billing_detail_fields %}
+{{ field }}: {{ value }}
+{% endfor %}
+
+{% trans "Shipping Details:" %}
+{% for field, value in order_shipping_detail_fields %}
+{{ field }}: {{ value }}
+{% endfor %}
+
+{% trans "Items Ordered:" %}
+{% for item in order_items %}
+{{ item.quantity }} x {{ item.description }} {{ item.unit_price|currency }} {% trans "each" %}
+{% endfor %}
+
+{% order_totals_text %}
+{% endblock %}
diff --git a/diggersdigest/templates/email/receipt.html b/diggersdigest/templates/email/receipt.html
new file mode 100644 (file)
index 0000000..97709a9
--- /dev/null
@@ -0,0 +1,6 @@
+{% load shop_tags i18n %}
+
+<p>{% trans "Dear" %} {{ order.billing_detail_first_name }},</p>
+<p>{% trans "Your order has been successful, details are below." %}</p>
+{% include "shop/includes/order_details.html" %}
+
diff --git a/diggersdigest/templates/email/receipt_rtl.html b/diggersdigest/templates/email/receipt_rtl.html
new file mode 100644 (file)
index 0000000..19a007c
--- /dev/null
@@ -0,0 +1,6 @@
+{% load shop_tags i18n %}
+
+<p align="right">,{% trans "Dear" %} {{ order.billing_detail_first_name }}</p>
+<p align="right">{% trans "Your order has been successful, details are below." %}</p>
+{% include "shop/includes/order_details_rtl.html" %}
+
diff --git a/diggersdigest/templates/pages/category.html b/diggersdigest/templates/pages/category.html
new file mode 100644 (file)
index 0000000..9a9cae4
--- /dev/null
@@ -0,0 +1,91 @@
+{% extends "pages/page.html" %}
+
+{% load mezzanine_tags shop_tags i18n %}
+{% block body_id %}category{% endblock %}
+
+{% block main %}{{ block.super }}
+
+{% editable page.category.content %}
+{{ page.category.content|safe }}
+{% endeditable %}
+
+{% if child_categories %}
+<div class="row shop-category-list">
+{% if settings.SHOP_CATEGORY_USE_FEATURED_IMAGE %}
+    {% for category in child_categories %}
+    <div class="col-xs-6 col-sm-4 col-lg-3">
+    <a href="{{ category.get_absolute_url }}" class="thumbnail">
+        {% if category.featured_image %}
+        <img src="{{ MEDIA_URL }}{% thumbnail category.featured_image 148 148 %}" />
+        {% else %}
+        <div class="placeholder"></div>
+        {% endif %}
+        <div class="caption">
+            <h4>{{ category.title }}</h4>
+        </div>
+    </a>
+    </div>  
+    {% endfor %}
+{% else %}
+    {% for category in child_categories %}
+    <div class="col-xs-6 col-sm-4 col-lg-3">
+    <a href="{{ category.get_absolute_url }}" class="thumbnail">
+        <div class="caption"><h4>{{ category.title }}</h4></div>
+    </a>
+    </div>
+    {% endfor %}
+{% endif %}
+</div>
+{% endif %}
+
+{% if products.paginator.count != 0 %}
+
+<form class="product-sorting" role="form">
+    <div class="form-group">
+    <label class="control-label" for="sorting-select">{% trans "Sort by" %}</label>
+        <select onchange="location.href = this[this.selectedIndex].value;" class="form-control" id="sorting-select">
+        {% for name, option in settings.SHOP_PRODUCT_SORT_OPTIONS %}
+        {% if "rating" not in option or settings.SHOP_USE_RATINGS %}
+        <option{% if option == products.sort_by %} selected{% endif %}
+            value="{{ category.get_absolute_url }}?sort={{ option }}{{ querystring }}">
+            {{ name }}
+        </option>
+        {% endif %}
+        {% endfor %}
+        </select>
+    </div>
+</form>
+
+<div class="row product-list">
+{% for product in products.object_list %}
+    <div class="col-xs-6 col-sm-4 col-lg-3 product-thumb">
+    <a href="{{ product.get_absolute_url }}" class="thumbnail">
+        {% if product.image %}
+        <img src="{{ MEDIA_URL }}{% thumbnail product.image 148 148 %}">
+        {% else %}
+        <div class="placeholder"></div>
+        {% endif %}
+        <div class="caption">
+        <h6>{{ product }}</h6>
+        <div class="price-info">
+        {% if product.has_price %}
+            {% if product.on_sale %}
+            <span class="old-price">{{ product.unit_price|currency }}</span>
+            {% trans "On sale:" %}
+            {% endif %}
+            <span class="price">{{ product.price|currency }}</span>
+        {% else %}
+            <span class="coming-soon">{% trans "Coming soon" %}</span>
+        {% endif %}
+        </div>
+        </div>
+    </a>
+    </div>
+{% endfor %}
+</div>
+
+{% pagination_for products %}
+
+{% endif %}
+
+{% endblock %}
diff --git a/diggersdigest/templates/shop/base.html b/diggersdigest/templates/shop/base.html
new file mode 100644 (file)
index 0000000..94d9808
--- /dev/null
@@ -0,0 +1 @@
+{% extends "base.html" %}
diff --git a/diggersdigest/templates/shop/billing_shipping.html b/diggersdigest/templates/shop/billing_shipping.html
new file mode 100644 (file)
index 0000000..c0b5464
--- /dev/null
@@ -0,0 +1,49 @@
+{% extends "shop/checkout.html" %}
+{% load staticfiles i18n mezzanine_tags %}
+
+{% block extra_head %}
+{{ block.super }}
+<script src="{% static "cartridge/js/shipping_fields.js" %}"></script>
+{% endblock %}
+
+{% block fields %}
+{% if request.cart.has_items %}
+{% if not request.user.is_authenticated %}
+{% ifinstalled mezzanine.accounts %}
+<p>
+{% url "login" as login_url %}
+{% url "signup" as signup_url %}
+{% with request.path as next %}
+{% blocktrans %}
+If you have an existing account or would like to create one, please
+<a href="{{ login_url }}?next={{ next }}">log in</a> or
+<a href="{{ signup_url }}?next={{ next }}">sign up</a>.
+{% endblocktrans %}
+{% endwith %}
+</p>
+{% endifinstalled %}
+{% endif %}
+
+{% errors_for form %}
+
+<fieldset>
+    <legend>{% trans "Billing Details" %}</legend>
+    {% fields_for form.billing_detail_fields %}
+</fieldset>
+
+<fieldset>
+    <legend>{% trans "Delivery Details" %}</legend>
+    {% fields_for form.same_billing_shipping_field %}
+    <div id="shipping_fields">{% fields_for form.shipping_detail_fields %}</div>
+    {% fields_for form.additional_instructions_field %}
+    {% fields_for form.remember_field %}
+</fieldset>
+
+{% if not settings.SHOP_CHECKOUT_STEPS_SPLIT and settings.SHOP_PAYMENT_STEP_ENABLED %}
+{% include "shop/includes/payment_fields.html" %}
+{% endif %}
+
+{% fields_for form.other_fields %}
+
+{% endif %}
+{% endblock %}
diff --git a/diggersdigest/templates/shop/cart.html b/diggersdigest/templates/shop/cart.html
new file mode 100644 (file)
index 0000000..2a81743
--- /dev/null
@@ -0,0 +1,113 @@
+{% extends "shop/base.html" %}
+{% load mezzanine_tags shop_tags i18n %}
+
+{% block meta_title %}{% trans "Your Cart" %}{% endblock %}
+{% block title %}{% trans "Your Cart" %}{% endblock %}
+{% block body_id %}cart{% endblock %}
+
+{% block breadcrumb_menu %}
+{{ block.super }}
+<li>{% trans "Your Cart" %}</li>
+{% endblock %}
+
+{% block main %}
+{% if cart_formset.forms %}
+<form method="post" class="cart-form">
+{% csrf_token %}
+{% if cart_formset.errors %}
+{% for error in cart_formset.errors %}
+{% if error.values.0 %}{{ error.values.0 }}{% endif %}
+{% endfor %}
+{% endif %}
+{{ cart_formset.management_form }}
+<table class="table table-striped">
+    <thead>
+    <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>
+    </thead>
+    <tbody>
+    {% 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>
+    </tbody>
+</table>
+
+<div class="form-actions">
+    <a href="{% url "shop_checkout" %}" class="btn btn-primary btn-lg pull-right">
+        {% 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 pull-left" value="{% trans "Update Cart" %}">
+</div>
+</form>
+
+{% if discount_form %}
+<form method="post" class="discount-form col-md-12 text-right">
+    {% fields_for discount_form %}
+    <input type="submit" class="btn btn-default" value="{% trans "Apply" %}">
+</form>
+{% endif %}
+
+{% if settings.SHOP_USE_UPSELL_PRODUCTS %}
+{% 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-xs-6 col-sm-4 col-md-3 product-thumb">
+        <a class="thumbnail" href="{{ product.get_absolute_url }}">
+            {% if product.image %}
+            <img src="{{ MEDIA_URL }}{% thumbnail product.image 90 90 %}">
+            {% endif %}
+            <div class="caption">
+            <h6>{{ product }}</h6>
+            <div class="price-info">
+            {% if product.has_price %}
+                {% if product.on_sale %}
+                <span class="old-price">{{ product.unit_price|currency }}</span>
+                {% trans "On sale:" %}
+                {% endif %}
+                <span class="price">{{ product.price|currency }}</span>
+            {% else %}
+                <span class="coming-soon">{% trans "Coming soon" %}</span>
+            {% endif %}
+            </div>
+            </div>
+        </a>
+    </div>
+    {% endfor %}
+</div>
+{% endif %}
+{% endwith %}
+{% endif %}
+
+{% else %}
+<p>{% trans "Your Cart is empty." %}</p>
+{% endif %}
+{% endblock %}
diff --git a/diggersdigest/templates/shop/checkout.html b/diggersdigest/templates/shop/checkout.html
new file mode 100644 (file)
index 0000000..554c601
--- /dev/null
@@ -0,0 +1,83 @@
+{% extends "shop/base.html" %}
+{% load shop_tags mezzanine_tags i18n %}
+
+{% block meta_title %}{% trans "Checkout" %} - {{ step_title }}{% endblock %}
+{% block title %}{% trans "Checkout" %} - {% trans "Step" %} {{ step }} {% trans "of" %} {{ steps|length }}{% endblock %}
+{% block body_id %}checkout{% endblock %}
+
+{% block extra_head %}
+<script>
+var _gaq = [['_trackPageview', '{{ request.path }}{{ step_url }}/']];
+$(function() {$('.middle :input:visible:enabled:first').focus();});
+</script>
+{% endblock %}
+
+{% block breadcrumb_menu %}
+{% for step in steps %}
+<li>
+    {% if step.title == step_title %}
+    <strong>{{ step.title }}</strong>
+    {% else %}
+    {{ step.title }}
+    {% endif %}
+</li>
+{% endfor %}
+<li>{% trans "Complete" %}</li>
+{% endblock %}
+
+{% block main %}
+
+{% block before-form %}{% endblock %}
+<div class="row">
+<form method="post" class="col-md-8 checkout-form">
+    {% csrf_token %}
+
+    {% block fields %}{% endblock %}
+
+    {% block nav-buttons %}
+        {% if request.cart.has_items %}
+            <div class="form-actions">
+                <input type="submit" class="btn btn-lg btn-primary pull-right" value="{% trans "Next" %}">
+                {% if not CHECKOUT_STEP_FIRST %}
+                <input type="submit" class="btn btn-lg btn-default pull-left" name="back" value="{% trans "Back" %}">
+                {% endif %}
+            </div>
+        {% else %}
+            <p>{% trans "Your cart is empty." %}</p>
+            <p>{% trans "This may be due to your session timing out after a period of inactivity." %}</p>
+            <p>{% trans "We apologize for the inconvenience." %}</p>
+            <br>
+            <p><a class="btn btn-lg btn-primary" href="{% url "page" "shop" %}">{% trans "Continue Shopping" %}</a></p>
+        {% endif %}
+    {% endblock %}
+
+</form>
+
+{% if request.cart.has_items %}
+<div class="col-md-4">
+    <div class="panel panel-default checkout-panel">
+    <div class="panel-body">
+    <ul class="media-list">
+    {% for item in request.cart %}
+    <li class="media">
+        {% if item.image %}
+        <img class="pull-left" alt="{{ item.description }}" src="{{ MEDIA_URL }}{% thumbnail item.image 30 30 %}">
+        {% endif %}
+        <div class="media-body">
+            {{ item.quantity }} x {{ item.description }}
+            <span class="price">{{ item.total_price|currency }}</span>
+        </div>
+    </li>
+    {% endfor %}
+    </ul>
+    {% order_totals %}
+    <br style="clear:both;">
+    <a class="btn btn-default" href="{% url "shop_cart" %}">{% trans "Edit Cart" %}</a>
+    </div>
+    </div>
+</div>
+{% endif %}
+
+{% block after-form %}{% endblock %}
+</div>
+{% endblock %}
diff --git a/diggersdigest/templates/shop/complete.html b/diggersdigest/templates/shop/complete.html
new file mode 100644 (file)
index 0000000..e341e6d
--- /dev/null
@@ -0,0 +1,86 @@
+{% extends "shop/base.html" %}
+{% load i18n %}
+
+{% block body_id %}complete{% endblock %}
+
+{% block meta_title %}{% trans "Order Complete" %}{% endblock %}
+
+{% block extra_head %}
+{{ block.super }}
+{% if settings.GOOGLE_ANALYTICS_ID %}
+<script>
+
+var decimal = function(amount) {
+    if (amount.toString().indexOf('.') == -1) {
+        amount += '.00';
+    }
+    return String(amount);
+};
+
+var _gaq = [['_trackPageview'], ['_addTrans',
+    // order ID - required
+    '{{ order.id }}',
+    // affiliation or store name
+    '',
+    // total - required
+    decimal({{ order.item_total }}{% if order.discount_total %} - {{ order.discount_total }}{% endif %}),
+    // tax
+    decimal({% if order.tax_total %}{{ order.tax_total }}{% else %}0{% endif %}),
+    // shipping
+    decimal({{ order.shipping_total }}),
+    // city
+    '{{ order.billing_detail_city|escapejs }}',
+    // state or province
+    '{{ order.billing_detail_state|escapejs }}',
+    // country
+    '{{ order.billing_detail_country|escapejs }}'
+]];
+
+{% for item in items %}
+_gaq.push(['_addItem',
+    // order ID - required
+    '{{ order.id }}',
+    // SKU/code - required
+    '{{ item.sku }}',
+    // product name
+    '{{ item.name|escapejs }}',
+    // category or variation
+    '{{ item.description|escapejs }}',
+    // unit price - required
+    decimal({{ item.unit_price }}),
+    // quantity - required
+    '{{ item.quantity }}'
+]);
+{% endfor %}
+
+// submits transaction to the Analytics servers
+_gaq.push(['_trackTrans']);
+
+</script>
+{% endif %}
+{% endblock %}
+
+{% block title %}{% trans "Order Complete" %}{% endblock %}
+
+{% block breadcrumb_menu %}
+{% for step in steps %}
+<li>{{ step.title }}</li>
+{% endfor %}
+<li><strong>{% trans "Complete" %}</strong></li>
+{% endblock %}
+
+
+{% block main %}
+<p>{% trans "Thank you for shopping with us, your order is complete." %}</p>
+<p>{% trans "We've sent you a receipt via email." %}</p>
+<p>{% trans "You can also view your invoice using one of the links below." %}</p>
+<br>
+<form class="order-complete-form" method="post" action="{% url "shop_invoice_resend" order.id %}?next={{ request.path }}">
+    {% csrf_token %}
+    {% if has_pdf %}
+    <a class="btn btn-primary" href="{% url "shop_invoice" order.id %}?format=pdf">{% trans "Download PDF invoice" %}</a>
+    {% endif %}
+    <a class="btn btn-default" target="_blank" href="{% url "shop_invoice" order.id %}">{% trans "View invoice in your browser" %}</a>
+    <input type="submit" class="btn btn-default" value="{% trans "Re-send order email" %}">
+</form>
+{% endblock %}
diff --git a/diggersdigest/templates/shop/confirmation.html b/diggersdigest/templates/shop/confirmation.html
new file mode 100644 (file)
index 0000000..b87ee60
--- /dev/null
@@ -0,0 +1,80 @@
+{% extends "shop/checkout.html" %}
+{% load i18n shop_tags %}
+
+{% block fields %}
+{% if request.cart.has_items %}
+
+<div class="confirmation col-md-6">
+    <div class="panel panel-default">
+    <div class="panel-body">
+    <h3>{% trans "Billing Details" %}</h3>
+    <ul class="list-unstyled">
+
+        {% for field, value in form.billing_detail_fields.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+    </ul>
+    </div>
+    </div>
+</div>
+
+<div class="confirmation col-md-6">
+    <div class="panel panel-default">
+    <div class="panel-body">
+    <h3>{% trans "Shipping Details" %}</h3>
+    <ul class="list-unstyled">
+
+        {% for field, value in form.shipping_detail_fields.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+        {% for field, value in form.additional_instructions_field.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+    </ul>
+    </div>
+    </div>
+</div>
+{% if settings.SHOP_PAYMENT_STEP_ENABLED %}
+{% comment %}
+<br style="clear:both;">
+<div class="confirmation col-md-6">
+    <div class="panel panel-default">
+    <div class="panel-body">
+    <h3>{% trans "Payment Details" %}</h3>
+    <ul class="list-unstyled">
+
+        {% for field, value in form.card_name_field.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+        {% for field, value in form.card_type_field.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+        <li>
+            {% with form.card_expiry_fields.values as expiry_fields %}
+            {% with expiry_fields.next as month_field %}
+            <label>{{ month_field.0 }}:</label> {{ month_field.1 }}/{{ expiry_fields.next.1 }}
+            {% endwith %}
+            {% endwith %}
+        </li>
+
+        {% for field, value in form.card_fields.values %}
+        <li><label>{{ field }}:</label> {{ value }}</li>
+        {% endfor %}
+
+    </ul>
+    </div>
+    </div>
+</div>
+{% endcomment %}
+{% endif %}
+<br style="clear:both;">
+
+{% for field in form %}{{ field }}{% endfor %}
+
+{% endif %}
+{% endblock %}
diff --git a/diggersdigest/templates/shop/includes/order_details.html b/diggersdigest/templates/shop/includes/order_details.html
new file mode 100644 (file)
index 0000000..b6aa60a
--- /dev/null
@@ -0,0 +1,55 @@
+{% load shop_tags i18n %}
+
+<h1>{{ settings.SITE_TITLE }}</h1>
+
+<table width="100%" border="0">
+    <tr>
+        <td>{% trans "Order ID:" %} {{ order.id }}</td>
+        <td align="right">{{ order.time }}</td>
+    </tr>
+</table>
+
+<h2>{% trans "Your Details" %}</h2>
+<table width="100%" border="1" cellspacing="0" cellpadding="10">
+<tr>
+    <th align="left" width="50%">{% trans "Billing Details" %}</th>
+    <th align="left" width="50%">{% trans "Shipping Details" %}</th>
+</tr>
+<tr>
+    <td valign="top">
+        <table border="0">
+            {% for field, value in order_billing_detail_fields %}
+            <tr><td>{{ field }}:&nbsp;&nbsp;&nbsp;</td><td>{{ value }}</td></tr>
+            {% endfor %}
+        </table>
+    </td>
+    <td valign="top">
+        <table border="0">
+            {% for field, value in order_shipping_detail_fields %}
+            <tr><td>{{ field }}:&nbsp;&nbsp;&nbsp;</td><td>{{ value }}</td></tr>
+            {% endfor %}
+        </table>
+    </td>
+</tr>
+</table>
+
+<h2>{% trans "Items Ordered" %}</h2>
+<table width="100%" border="1" cellspacing="0" cellpadding="10">
+    <tr>
+        <th align="left">{% trans "Item" %}</th>
+        <th align="right">{% trans "Unit Price" %}</th>
+        <th align="right">{% trans "Qty" %}</th>
+        <th align="right">{% trans "Price" %}</th>
+    </tr>
+    {% for item in order.items.all %}
+    <tr>
+        <td>{{ item.description }}</td>
+        <td align="right" valign="top">{{ item.unit_price|currency }}</td>
+        <td align="right" valign="top">{{ item.quantity }}</td>
+        <td align="right" valign="top">{{ item.total_price|currency }}</td>
+    </tr>
+    {% endfor %}
+    <tr>
+        <td colspan="4" align="right">{% order_totals %}</td>
+    </tr>
+</table>
diff --git a/diggersdigest/templates/shop/includes/order_details_rtl.html b/diggersdigest/templates/shop/includes/order_details_rtl.html
new file mode 100644 (file)
index 0000000..e1760a1
--- /dev/null
@@ -0,0 +1,61 @@
+{% load shop_tags i18n %}
+
+<h1 align="right">{{ settings.SITE_TITLE }}</h1>
+
+<table width="100%" border="0">
+    <tr>
+        <td align="left">{{ order.time }}</td>
+        <td align="right">{% trans "Order ID:" %} {{ order.id }}</td>
+    </tr>
+</table>
+
+<h2 align="right">{% trans "Your Details" %}</h2>
+<table width="100%" border="1" cellspacing="0" cellpadding="10">
+<tr>
+    <th align="right" width="50%">{% trans "Billing Details" %}</th>
+    <th align="right" width="50%">{% trans "Shipping Details" %}</th>
+</tr>
+<tr>
+    <td valign="top" align="right">
+        <table border="0">
+            {% for field, value in order_billing_detail_fields %}
+            <tr><td>{{ value }}</td><td> &nbsp;&nbsp;&nbsp;:&nbsp;{{ field }}</td></tr>
+            {% endfor %}
+        </table>
+    </td>
+    <td valign="top" align="right">
+        <table border="0" align="right">
+            {% for field, value in order_shipping_detail_fields %}
+            <tr><td>{{ value }}</td><td> &nbsp;&nbsp;&nbsp;:&nbsp;{{ field }}</td></tr>
+            {% endfor %}
+        </table>
+    </td>
+</tr>
+</table>
+
+<h2 align="right">{% trans "Items Ordered" %}</h2>
+<table width="100%" border="1" cellspacing="0" cellpadding="10">
+    <tr>
+
+
+
+        <th align="left">{% trans "Price" %}</th>
+        <th align="left">{% trans "Qty" %}</th>
+        <th align="left">{% trans "Unit Price" %}</th>
+        <th align="right">{% trans "Item" %}</th>
+    </tr>
+    {% for item in order.items.all %}
+    <tr>
+        <td align="left" valign="top">{{ item.total_price|currency }}</td>
+        <td align="left" valign="top">{{ item.quantity }}</td>
+        <td align="left" valign="top">{{ item.unit_price|currency }}</td>
+        <td align="right">{{ item.description }}</td>
+
+
+
+    </tr>
+    {% endfor %}
+    <tr>
+        <td colspan="4" align="left">{% order_totals %}</td>
+    </tr>
+</table>
diff --git a/diggersdigest/templates/shop/includes/order_totals.html b/diggersdigest/templates/shop/includes/order_totals.html
new file mode 100644 (file)
index 0000000..ffe3cf4
--- /dev/null
@@ -0,0 +1,40 @@
+{% load shop_tags i18n %}
+<div class="order-totals">
+    {% if discount_total or shipping_total %}
+    <div><label>{% trans "Sub total" %}:</label> <span>{{ item_total|currency }}</span></div>
+    {% endif %}
+    {% if discount_total %}
+    <div>
+        <label>
+        {% if discount_type %}
+        {{ discount_type }}:
+        {% else %}
+        {% trans "Discount" %}:
+        {% endif %}
+        </label> <span>{{ discount_total|currency }}</span>
+    </div>
+    {% endif %}
+    {% if shipping_type or shipping_total %}
+    <div>
+        <label>
+        {% if shipping_type %}
+        {{ shipping_type }}:
+        {% else %}
+        {% trans "Shipping" %}:
+        {% endif %}
+        </label> <span>{{ shipping_total|currency }}</span>
+    </div>
+    {% endif %}
+    {% if tax_total %}
+    <div>
+        <label>
+        {% if tax_type %}
+        {{ tax_type }}:
+        {% else %}
+        {% trans "Tax" %}:
+        {% endif %}
+        </label> <span>{{ tax_total|currency }}</span>
+    </div>
+    {% endif %}
+    <div class="total"><label>{% trans "Total" %}:</label> <span>{{ order_total|currency }}</span></div>
+</div>
diff --git a/diggersdigest/templates/shop/includes/order_totals.txt b/diggersdigest/templates/shop/includes/order_totals.txt
new file mode 100644 (file)
index 0000000..fdbb3a8
--- /dev/null
@@ -0,0 +1,11 @@
+{% load shop_tags i18n %}{% if discount_total or shipping_total %}
+{% trans "Sub total" %}: {{ item_total|currency }}
+{% endif %}{% if discount_total %}
+{% if discount_type %}{{ discount_type }}{% else %}{% trans "Discount" %}{% endif %}: {{ discount_total|currency }}
+{% endif %}{% if shipping_type or shipping_total %}
+{% if shipping_type %}{{ shipping_type }}{% else %}{% trans "Shipping" %}{% endif %}: {{ shipping_total|currency }}
+{% endif %} {% if tax_total %}
+{% if tax_type %}{{ tax_type }}{% else %}{% trans "Tax" %}{% endif %}: {{ tax_total|currency }}
+{% endif %}{% trans "Total" %}: {{ order_total|currency }}
+
+
diff --git a/diggersdigest/templates/shop/includes/payment_fields.html b/diggersdigest/templates/shop/includes/payment_fields.html
new file mode 100644 (file)
index 0000000..238a97d
--- /dev/null
@@ -0,0 +1,14 @@
+{% load i18n mezzanine_tags %}
+<fieldset>
+    <legend>{% trans "Payment Details" %}</legend>
+    {% fields_for form.card_name_field %}
+    {% fields_for form.card_type_field %}
+    {% with form.card_expiry_fields as card_expiry_fields %}
+    <div class="form-group card-expiry-fields{% if card_expiry_fields.errors.card_expiry_year %} error{% endif %}">
+        <label>{% trans "Card Expiry" %}</label>
+        {% fields_for card_expiry_fields %}
+    </div>
+    <div class="clearfix"></div>
+    {% endwith %}
+    {% fields_for form.card_fields %}
+</fieldset>
diff --git a/diggersdigest/templates/shop/includes/user_panel.html b/diggersdigest/templates/shop/includes/user_panel.html
new file mode 100644 (file)
index 0000000..db8f64c
--- /dev/null
@@ -0,0 +1,18 @@
+{% load i18n shop_tags mezzanine_tags %}
+{% spaceless %}
+<a href="{% url "shop_cart" %}">
+<span class="glyphicon glyphicon-shopping-cart"></span>
+{% blocktrans count request.cart.total_quantity as cart_quantity %}1 item{% plural %}{{ cart_quantity }} items{% endblocktrans %}
+{% trans "in cart" %}:
+{{ request.cart.total_price|currency }}</a><br>
+{% if request.cart.total_quantity != 0 %}
+<a href="{% url "shop_checkout" %}" class="btn btn-primary">
+    {% if request.session.order.step %}{% trans "Return to Checkout" %}{% else %}{% trans "Go to Checkout" %}{% endif %}
+</a><br>
+{% endif %}
+{% if settings.SHOP_USE_WISHLIST %}
+<a href="{% url "shop_wishlist" %}" class="btn-wishlist">
+<span class="glyphicon glyphicon-star"></span>
+{% blocktrans count request.wishlist|length as wishlist_count %}Wishlist contains 1 item{% plural %} Wishlist contains {{ wishlist_count }} items{% endblocktrans %}</a>
+{% endif %}
+{% endspaceless %}
diff --git a/diggersdigest/templates/shop/order_history.html b/diggersdigest/templates/shop/order_history.html
new file mode 100644 (file)
index 0000000..cb319e0
--- /dev/null
@@ -0,0 +1,51 @@
+{% extends "shop/base.html" %}
+{% load mezzanine_tags shop_tags i18n %}
+
+{% block meta_title %}{% trans "Order History" %}{% endblock %}
+{% block title %}{% trans "Order History" %}{% endblock %}
+
+{% block breadcrumb_menu %}
+{{ block.super }}
+<li>{% trans "Order History" %}</li>
+{% endblock %}
+
+{% block main %}
+
+{% if orders %}
+
+<table class="table table-striped order-history">
+    <thead>
+        <th class="left">ID</th>
+        <th class="left">{% trans "Date" %}</th>
+        <th class="right">{% trans "Qty" %}</th>
+        <th class="right">{% trans "Paid" %}</th>
+        <th>&nbsp;</th>
+    </thead>
+    <tbody>
+    {% for order in orders.object_list %}
+    <tr>
+        <td class="left">{{ order.id }}</td>
+        <td class="left">{{ order.time|date:"SHORT_DATE_FORMAT" }}</td>
+        <td class="right">{{ order.quantity_total }}</td>
+        <td class="right">{{ order.total|currency }}</td>
+        <td class="right">
+            <form class="order-history-form" method="post" action="{% url "shop_invoice_resend" order.id %}?next={{ request.path }}">
+                {% csrf_token %}
+                {% if has_pdf %}
+                <a class="btn btn-sm btn-primary" href="{% url "shop_invoice" order.id %}?format=pdf">{% trans "Download PDF" %}</a>
+                {% endif %}
+                <a class="btn btn-sm btn-default" target="_blank" href="{% url "shop_invoice" order.id %}">{% trans "View invoice" %}</a>
+                <input type="submit" class="btn btn-sm btn-default" value="{% trans "Re-send order email" %}">
+            </form>
+        </td>
+    </tr>
+    {% endfor %}
+    </tbody>
+</table>
+{% pagination_for orders %}
+
+{% else %}
+<p>{% trans "You have not ordered anything from us yet." %}</p>
+{% endif %}
+
+{% endblock %}
diff --git a/diggersdigest/templates/shop/order_invoice.html b/diggersdigest/templates/shop/order_invoice.html
new file mode 100644 (file)
index 0000000..5dcda6c
--- /dev/null
@@ -0,0 +1,5 @@
+{% if not LANGUAGE_BIDI %}
+    {% include "shop/includes/order_details.html" %}
+{% else %}
+    {% include "shop/includes/order_details_rtl.html" %}
+{% endif %}
diff --git a/diggersdigest/templates/shop/order_invoice_pdf.html b/diggersdigest/templates/shop/order_invoice_pdf.html
new file mode 100644 (file)
index 0000000..da6b04f
--- /dev/null
@@ -0,0 +1 @@
+{% extends "shop/order_invoice.html" %}
diff --git a/diggersdigest/templates/shop/payment.html b/diggersdigest/templates/shop/payment.html
new file mode 100644 (file)
index 0000000..6be458e
--- /dev/null
@@ -0,0 +1,10 @@
+{% extends "shop/checkout.html" %}
+{% load i18n mezzanine_tags %}
+
+{% block fields %}
+{% if request.cart.has_items %}
+{% errors_for form %}
+{% include "shop/includes/payment_fields.html" %}
+{% fields_for form.other_fields %}
+{% endif %}
+{% endblock %}
diff --git a/diggersdigest/templates/shop/product.html b/diggersdigest/templates/shop/product.html
new file mode 100644 (file)
index 0000000..4ef715d
--- /dev/null
@@ -0,0 +1,159 @@
+{% extends "shop/base.html" %}
+{% load staticfiles mezzanine_tags shop_tags rating_tags i18n %}
+
+{% block meta_title %}{{ product.meta_title }}{% endblock %}
+{% block body_id %}category{% endblock %}
+
+{% block meta_keywords %}{% metablock %}
+{% for keyword in product.keywords.all %}
+    {% if not forloop.first %}, {% endif %}
+    {{ keyword }}
+{% endfor %}
+{% endmetablock %}{% endblock %}
+
+{% block meta_description %}{% metablock %}
+{{ product.description }}
+{% endmetablock %}{% endblock %}
+
+{% block extra_css %}
+{{ block.super }}
+<link rel="stylesheet" href="{% static "mezzanine/css/magnific-popup.css" %}">
+{% endblock %}
+
+{% block extra_js %}
+{{ block.super }}
+<script src="{% static "mezzanine/js/magnific-popup.js" %}"></script>
+<script>
+$(document).ready(function() {
+    $('#product-images-large').magnificPopup({
+        delegate: 'a',
+        type: 'image',
+        gallery: {
+            enabled: true,
+        }
+    });
+});
+</script>
+{% endblock %}
+
+{% block extra_head %}
+{{ block.super }}
+<script>var variations = {{ variations_json|safe }};</script>
+<script src="{% static "cartridge/js/product_variations.js" %}"></script>
+{% endblock %}
+
+{% block breadcrumb_menu %}
+{{ block.super }}
+<li>{{ product.title }}</li>
+{% endblock %}
+
+{% block title %}
+{% editable product.title %}{{ product.title }}{% endeditable %}
+{% endblock %}
+
+{% block main %}
+
+{% if images %}
+{% spaceless %}
+<ul id="product-images-large" class="list-unstyled list-inline">
+    {% for image in images %}
+    <li id="image-{{ image.id }}-large"{% if not forloop.first %}style="display:none;"{% endif %}>
+        <a class="product-image-large" href="{{ MEDIA_URL }}{{ image.file }}">
+            <img alt="{{ image.description }}" src="{{ MEDIA_URL }}{% thumbnail image.file 0 300 %}" class="img-thumbnail img-responsive col-xs-12">
+        </a>
+    </li>
+    {% endfor %}
+</ul>
+
+{% if images|length != 1 %}
+<ul id="product-images-thumb" class="list-unstyled list-inline">
+    {% for image in images %}
+    <li>
+        <a class="thumbnail" id="image-{{ image.id }}" href="{{ MEDIA_URL }}{{ image.file }}">
+            <img alt="{{ image.description }}" src="{{ MEDIA_URL }}{% thumbnail image.file 75 75 %}">
+        </a>
+    </li>
+    {% endfor %}
+</ul>
+{% endif %}
+
+{% endspaceless %}
+{% endif %}
+
+{% editable product.content %}
+{{ product.content|richtext_filters|safe }}
+{% endeditable %}
+
+{% if product.available and has_available_variations %}
+<ul id="variations" class="list-unstyled">
+    {% for variation in variations %}
+    <li id="variation-{{ variation.sku }}"
+        {% if not variation.default %}style="display:none;"{% endif %}>
+        {% if variation.has_price %}
+            {% if variation.on_sale %}
+                <span class="old-price">{{ variation.unit_price|currency }}</span>
+                {% trans "On sale:" %}
+            {% endif %}
+            <span class="price">{{ variation.price|currency }}</span>
+        {% else %}
+            {% if has_available_variations %}
+            <span class="error-msg">
+            {% trans "The selected options are currently unavailable." %}
+            </span>
+            {% endif %}
+        {% endif %}
+    </li>
+    {% endfor %}
+</ul>
+
+{% errors_for add_product_form %}
+
+<form method="post" id="add-cart" class="shop-form">
+    {% fields_for add_product_form %}
+    <div class="form-actions">
+        <input type="submit" class="btn btn-primary btn-lg pull-right" name="add_cart" value="{% trans "Buy" %}">
+        {% if settings.SHOP_USE_WISHLIST %}
+        <input type="submit" class="btn btn-default btn-lg pull-left" name="add_wishlist" value="{% trans "Save for later" %}">
+        {% endif %}
+    </div>
+</form>
+{% else %}
+<p class="error-msg">{% trans "This product is currently unavailable." %}</p>
+{% endif %}
+
+{% if settings.SHOP_USE_RATINGS %}
+<div class="panel panel-default rating">
+    <div class="panel-body">{% rating_for product %}</div>
+</div>
+{% endif %}
+
+{% if settings.SHOP_USE_RELATED_PRODUCTS and related_products %}
+<h2>{% trans "Related Products" %}</h2>
+<div class="row related-products">
+    {% for product in related_products %}
+    <div class="col-xs-6 col-sm-4 col-md-3 product-thumb">
+        <a class="thumbnail" href="{{ product.get_absolute_url }}">
+            {% if product.image %}
+            <img src="{{ MEDIA_URL }}{% thumbnail product.image 90 90 %}">
+            {% endif %}
+            <div class="caption">
+            <h6>{{ product }}</h6>
+            <div class="price-info">
+            {% if product.has_price %}
+                {% if product.on_sale %}
+                <span class="old-price">{{ product.unit_price|currency }}</span>
+                {% trans "On sale:" %}
+                {% endif %}
+                <span class="price">{{ product.price|currency }}</span>
+            {% else %}
+                <span class="coming-soon">{% trans "Coming soon" %}</span>
+            {% endif %}
+            </div>
+            </div>
+        </a>
+    </div>
+    {% endfor %}
+</div>
+{% endif %}
+
+{% endblock %}
diff --git a/diggersdigest/templates/shop/wishlist.html b/diggersdigest/templates/shop/wishlist.html
new file mode 100644 (file)
index 0000000..fefde92
--- /dev/null
@@ -0,0 +1,46 @@
+{% extends "shop/base.html" %}
+{% load mezzanine_tags shop_tags i18n %}
+
+{% block meta_title %}{% trans "Your Wishlist" %}{% endblock %}
+{% block title %}{% trans "Your Wishlist" %}{% endblock %}
+
+{% block breadcrumb_menu %}
+{{ block.super }}
+<li>{% trans "Your Wishlist" %}</li>
+{% endblock %}
+
+{% block main %}
+{% if error %}{{ error }}{% endif %}
+{% if request.wishlist %}
+<table class="table table-striped wishlist">
+    {% for item in wishlist_items %}
+    <tr>
+    <td width="30">
+        {% if item.image %}
+        <a href="{{ item.get_absolute_url }}"><img alt="{{ item }}" src="{{ MEDIA_URL }}{% thumbnail item.image.file 30 30 %}"></a>
+        {% else %}
+        &nbsp;
+        {% endif %}
+    </td>
+    <td>
+        <a href="{{ item.get_absolute_url }}">{{ item }}</a>
+    </td>
+    <td class="wishlist-actions">
+        <form method="post">
+            {{ item.unit_price|currency }}
+            {% csrf_token %}
+            <input type="hidden" name="sku" value="{{ item.sku }}">
+            <input type="hidden" name="quantity" value="1">
+            <input type="submit" class="btn btn-sm btn-primary" name="add_cart" value="{% trans "Buy" %}">
+            <input type="submit" class="btn btn-sm btn-default" name="remove_wishlist" value="{% trans "Remove" %}">
+        </form>
+    </td>
+    </tr>
+    {% endfor %}
+</table>
+{% else %}
+<p>{% trans "Your wishlist is empty." %}</p>
+<br>
+<p><a class="btn btn-large btn-primary" href="{% url "page" "shop" %}">{% trans "Continue Shopping" %}</a></p>
+{% endif %}
+{% endblock %}