{% extends 'dashboard/layout.html' %} {% load url from future %} {% load i18n %} {% load thumbnail %} {% load staticfiles %} {% load form_tags %} {% block body_class %}create-page catalogue{% endblock %} {% block title %} {{ title }} | {% trans "Product management" %} | {{ block.super }} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block headertext %}{{ title }}{% endblock %} {% block dashboard_content %}
{% csrf_token %}
{% block tab_nav %} {% endblock tab_nav %}
{% block product_overview %} {% if product %}

{% trans "Overview" %}

{% block product_overview_content %}

{{ product.get_title }}


{% if product.primary_image.original.url %} {% with image=product.primary_image %} {% thumbnail image.original "240" upscale=False as thumb %} {{ product.get_title }} {% endthumbnail %} {% endwith %} {% endif %}

{% trans "Description" %}
{{ product.description|safe }}

{% with stats=product.stats %}
{% trans "Views" %} {{ stats.num_views|default:0 }}
{% trans "Baskets" %} {{ stats.num_basket_additions|default:0 }}
{% trans "Purchases" %} {{ stats.num_purchases|default:0 }}
{% endwith %}

{% trans "Categories" %}

{% if product.categories.all %} {% for category in product.categories.all %} {% endfor %} {% else %} {% endif %}
{{ category.full_name }}
{% trans "No categories setup for this product" %}

{% trans "Ranges" %}

{% for range in product.includes.all %} {% empty %} {% endfor %}
{{ range.name }}
{% trans "No ranges currently include this product for this product" %}
{% endblock product_overview_content %}
{% endif %} {% endblock product_overview %} {% block product_details %}

{% trans "Product Details" %}

{% block product_details_content %} {{ form.non_field_errors }} {% for field in form.hidden_fields %} {{ field }} {% endfor %} {% for field in form.visible_fields %} {% if 'attr' not in field.id_for_label %} {% comment %} Make the field widget type available to templates so we can mark-up checkboxes differently to other widgets. {% endcomment %} {% annotate_form_field field %} {% comment %} We use a separate template for each field so that forms can be rendered field-by-field easily #} {% endcomment %} {% if field.widget_type == 'CheckboxInput' %} {% include 'partials/form_field_checkbox.html' with field=field %} {% else %} {% include 'partials/form_field.html' with field=field %} {% endif %} {% endif %} {% endfor %} {% with parent=product.parent %} {% if parent %}
{% endif %} {% endwith %} {% endblock product_details_content %}
{% endblock product_details %} {% block product_variants %} {% with variants=product.variants.all %} {% if variants %}
{% block product_variants_content %} {% with parent=product.parent %} {% if parent %} {% endif %} {% endwith %} {% for variant in variants %} {% endfor %}
{% trans "Variants" %}
{% trans "Parent" %}
{{ parent.title }} {% trans "Edit" %}
{% trans "Children" %}
{{ variant.get_title }} {{ variant.attribute_summary }} {% trans "Edit" %}
{% endblock product_variants_content %}
{% endif %} {% endwith %} {% endblock product_variants %} {% block product_attributes %}
{% block product_attributes_content %} {% for field in form %} {% if 'attr' in field.id_for_label %} {% endif %} {% endfor %}
{% trans "Product Attributes" %} {% trans "Product class:" %} {{ product_class }}
{% trans "Attribute name" %} {% trans "Attribute option" %}
{{ field.label }}{% if field.field.required %} *{% endif %} {% if field.is_hidden %} {{ field }} {% else %} {{ field }} {% for error in field.errors %} {{ error }} {% endfor %} {% if field.help_text %} {{ field.help_text }} {% endif %} {% endif %}
{% endblock product_attributes_content %}
{% endblock product_attributes %} {% block product_categories %}
{% block product_categories_content %} {{ category_formset.management_form }} {{ category_formset.non_form_errors }} {% for category_form in category_formset %} {% endfor %}
{% trans "Category" %}
{% include "partials/form_fields_inline.html" with form=category_form %}
{% endblock product_categories_content %}
{% endblock product_categories %} {% block product_images %}
{% block product_images_content %}

{% trans "Upload, change or remove images" %}

{{ image_formset.management_form }} {{ image_formset.non_form_errors }}
    {% for image_form in image_formset %} {% include "dashboard/partials/product_images.html" with form=image_form %} {% endfor %}
{% endblock product_images_content %}
{% endblock product_images %} {% block stockrecords %}
{% block stockrecords_content %} {{ stockrecord_formset.management_form }} {{ stockrecord_formset.non_form_errors }} {% for stockrecord_form in stockrecord_formset %} {% if stockrecord_form.non_field_errors %} {% endif %} {% endfor %}
{% trans "Stock and price information" %}
Partner SKU Num in stock Num allocated Low stock threshold Currency Cost price Price (excl tax) Retail price Delete?
{% for error in stockrecord_form.non_field_errors %} {{ error }} {% endfor %}
{% include "partials/form_field.html" with field=stockrecord_form.partner nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.partner_sku nolabel=True %} {% if stockrecord_form.num_in_stock %} {% include "partials/form_field.html" with field=stockrecord_form.num_in_stock nolabel=True %} {% else %} - {% endif %} {{ stockrecord_form.instance.num_allocated|default:"-" }} {% include "partials/form_field.html" with field=stockrecord_form.low_stock_threshold nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.price_currency nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.cost_price nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.price_excl_tax nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.price_retail nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.id nolabel=True %} {% include "partials/form_field.html" with field=stockrecord_form.DELETE nolabel=True %}
{% endblock stockrecords_content %}
{% endblock stockrecords %} {% block recommended_products %} {% endblock recommended_products %}
{% block fixed_actions_group %}
{% trans "Cancel" %} {% trans "or" %}
{% if product %} {% trans "View on site" %} {% endif %}
{% endblock fixed_actions_group %}
{% endblock dashboard_content %}