<commit_before>{% extends 'dashboard/layout.html' %}
{% load url from future %}
{% load currency_filters %}
{% load i18n %}
{% load thumbnail %}

{% block body_class %}catalogue{% endblock %}

{% block title %}
{% trans "Product management" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
        <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        <span class="divider">/</span>
    </li>
    <li class="active">{% trans "Product management" %}</li>
</ul>
{% endblock %}

{% block header %}
<div class="page-header action">
    <h1>{% trans "Product management" %}</h1>
</div>
{% endblock header %}

{% block dashboard_content %}
<div class="table-header">
    <h3><i class="icon-search icon-large"></i>{% trans "Search Products" %}</h3>
</div>
<div class="well">
    <form action="." method="get" class="form-inline">
        {% include "partials/form_fields_inline.html" with form=form %}
        <button type="submit" class="btn btn-primary">{% trans "Search" %}</button>
    </form>
</div>

<div class="table-header">
    <h3><i class="icon-sitemap icon-large"></i> {% trans "Create new product" %}</h3>
</div>
<div class="well">
    <form action="{% url 'dashboard:catalogue-product-create' %}" method="get" class="form-inline">
        <span class="control-group">
            <label for="id_promotion_type">{% trans "Create a new product of type" %}</label>
            <select id="id_promotion_type" name="product_class">
                <option> -- {% trans "Choose type" %} --</option>
                {% for product_class in product_classes %}
                <option value="{{ product_class.id }}">{{ product_class.name }}</option>
                {% endfor %}
            </select>
        </span>
        <button class="btn btn-primary" type="submit"><i class="icon-plus"></i> {% trans "New Product" %}</button>
    </form>
</div>

{% if products %}
<div class="table-header">
    <h2><i class="icon-sitemap icon-large"></i>{{ queryset_description }}</h2>
</div>
<form action="." method="post">
    {% csrf_token %}
    <table class="table table-striped table-bordered">
        <tr>
            <th>{% trans "UPC" %}</th>
            <th>{% trans "Image" %}</th>
            <th>{% trans "Title" %}</th>
            <th>{% trans "Product class" %}</th>
            <th>{% trans "Status" %}</th>
            <th>{% trans "Partner" %}</th>
            <th>{% trans "Partner SKU" %}</th>
            <th>{% trans "Price excl. tax" %}</th>
            <th>{% trans "Price incl. tax" %}</th>
            <th>{% trans "Number in stock" %}</th>
            <th>{% trans "Number allocated" %}</th>
            <th>{% trans "Parent" %}</th>
            <th>{% trans "Children" %}</th>
            <th></th>
        </tr>
        {% for product in products %}
        <tr>
                <td>{{ product.upc|default:"-" }}</td>
                <td>
                {% if product.primary_image.original.url %}
                {% with image=product.primary_image %}
                    {% thumbnail image.original "70x70" upscale=False as thumb %}
                        <a href="{{ image.original.url }}" rel="lightbox_{{ product.upc|default:"-" }}" class="sub-image">
                            <img src="{{ thumb.url }}" alt="{{ product.get_title }}" data-description="{% if image.caption %}{{ image.caption }}{% endif %}">
                        </a>
                    {% endthumbnail %}
                {% endwith %}
                {% else %}
                -
                {% endif %}
                </td>
                <td>{{ product.get_title }}</td>
                <td>{{ product.get_product_class.name }}</td>
                <td>{{ product.status|default:"-" }}</td>
                {% with stockrecord=product.stockrecord %}
                    <td>{{ stockrecord.partner.name }}</td>
                    <td>{{ stockrecord.partner_sku }}</td>
                    <td>{{ stockrecord.price_excl_tax|currency }}</td>
                    <td>{{ stockrecord.price_incl_tax|currency }}</td>
                    <td>{{ stockrecord.num_in_stock|default:"-" }}</td>
                    <td>{{ stockrecord.num_allocated }}</td>
                {% endwith %}
                <td>
                    {% if product.parent.id %}
                    <a href="{% url 'dashboard:catalogue-product' product.parent.id %}">{{ product.parent.title }}</a>
                    {% else %}
                    -
                    {% endif %}
                </td>
                <td>{{ product.variants.count }}</td>
                <td>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                                {% trans "Actions" %}
                                <span class="caret"></span>
                            </a><commit_msg>Don't show 'None' in dashboard product list template<commit_after>{% extends 'dashboard/layout.html' %}
{% load url from future %}
{% load currency_filters %}
{% load i18n %}
{% load thumbnail %}

{% block body_class %}catalogue{% endblock %}

{% block title %}
{% trans "Product management" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
        <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        <span class="divider">/</span>
    </li>
    <li class="active">{% trans "Product management" %}</li>
</ul>
{% endblock %}

{% block header %}
<div class="page-header action">
    <h1>{% trans "Product management" %}</h1>
</div>
{% endblock header %}

{% block dashboard_content %}
<div class="table-header">
    <h3><i class="icon-search icon-large"></i>{% trans "Search Products" %}</h3>
</div>
<div class="well">
    <form action="." method="get" class="form-inline">
        {% include "partials/form_fields_inline.html" with form=form %}
        <button type="submit" class="btn btn-primary">{% trans "Search" %}</button>
    </form>
</div>

<div class="table-header">
    <h3><i class="icon-sitemap icon-large"></i> {% trans "Create new product" %}</h3>
</div>
<div class="well">
    <form action="{% url 'dashboard:catalogue-product-create' %}" method="get" class="form-inline">
        <span class="control-group">
            <label for="id_promotion_type">{% trans "Create a new product of type" %}</label>
            <select id="id_promotion_type" name="product_class">
                <option> -- {% trans "Choose type" %} --</option>
                {% for product_class in product_classes %}
                <option value="{{ product_class.id }}">{{ product_class.name }}</option>
                {% endfor %}
            </select>
        </span>
        <button class="btn btn-primary" type="submit"><i class="icon-plus"></i> {% trans "New Product" %}</button>
    </form>
</div>

{% if products %}
<div class="table-header">
    <h2><i class="icon-sitemap icon-large"></i>{{ queryset_description }}</h2>
</div>
<form action="." method="post">
    {% csrf_token %}
    <table class="table table-striped table-bordered">
        <tr>
            <th>{% trans "UPC" %}</th>
            <th>{% trans "Image" %}</th>
            <th>{% trans "Title" %}</th>
            <th>{% trans "Product class" %}</th>
            <th>{% trans "Status" %}</th>
            <th>{% trans "Partner" %}</th>
            <th>{% trans "Partner SKU" %}</th>
            <th>{% trans "Price excl. tax" %}</th>
            <th>{% trans "Price incl. tax" %}</th>
            <th>{% trans "Number in stock" %}</th>
            <th>{% trans "Number allocated" %}</th>
            <th>{% trans "Parent" %}</th>
            <th>{% trans "Children" %}</th>
            <th></th>
        </tr>
        {% for product in products %}
        <tr>
                <td>{{ product.upc|default:"-" }}</td>
                <td>
                {% if product.primary_image.original.url %}
                {% with image=product.primary_image %}
                    {% thumbnail image.original "70x70" upscale=False as thumb %}
                        <a href="{{ image.original.url }}" rel="lightbox_{{ product.upc|default:"-" }}" class="sub-image">
                            <img src="{{ thumb.url }}" alt="{{ product.get_title }}" data-description="{% if image.caption %}{{ image.caption }}{% endif %}">
                        </a>
                    {% endthumbnail %}
                {% endwith %}
                {% else %}
                -
                {% endif %}
                </td>
                <td>{{ product.get_title }}</td>
                <td>{{ product.get_product_class.name }}</td>
                <td>{{ product.status|default:"-" }}</td>
                {% with stockrecord=product.stockrecord %}
                    <td>{{ stockrecord.partner.name }}</td>
                    <td>{{ stockrecord.partner_sku }}</td>
                    <td>{{ stockrecord.price_excl_tax|currency }}</td>
                    <td>{{ stockrecord.price_incl_tax|currency }}</td>
                    <td>{{ stockrecord.num_in_stock|default:"-" }}</td>
                    <td>{{ stockrecord.num_allocated|default:"-" }}</td>
                {% endwith %}
                <td>
                    {% if product.parent.id %}
                    <a href="{% url 'dashboard:catalogue-product' product.parent.id %}">{{ product.parent.title }}</a>
                    {% else %}
                    -
                    {% endif %}
                </td>
                <td>{{ product.variants.count }}</td>
                <td>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                                {% trans "Actions" %}
                                <span class="caret"></span>
                            </a>
{'fraction_non_alphanumeric': 0.1911160132357365, 'fraction_numerical': 0.002807580467261606, 'mean_word_length': 1.8151284222410387, 'pattern_counts': {'":': 0, '<': 257, '<?xml version=': 0, '>': 257, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5710383', 'n_tokens_mistral': 3145, 'n_tokens_neox': 2859, 'n_words': 680}