Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix indent to 2 spaces and code formatting

Krzysztof Białogłowicz374677f12954
diff --git a/templates/dashboard/base.html b/templates/dashboard/base.html
index 1f824d2926..08b98362ea 100644
--- a/templates/dashboard/base.html
+++ b/templates/dashboard/base.html
@@ -4,140 +4,198 @@
{% load version %}
<html lang="{{ LANGUAGE_CODE }}" class="no-js">
-<head>
- <title>{% block title %}{% trans "Dashboard - Saleor" context "Dashboard default page title" %}{% endblock %}</title>
+ <head>
+ <title>
+ {% block title %}
+ {% trans "Dashboard - Saleor" context "Dashboard default page title" %}
+ {% endblock %}
+ </title>
{% block meta %}
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
{% endblock meta %}
+
{% include 'favicon.html' %}
{% render_bundle 'vendor' 'css' %}
{% render_bundle 'dashboard' 'css' %}
<link rel="stylesheet" type="text/css" href="{% static "versatileimagefield/css/versatileimagefield.css" %}">
- {% block custom_css %}
- {% endblock %}
-</head>
+ {% block custom_css %}{% endblock %}
+ </head>
-<body class="{% block body_class %}body-home{% endblock %}">
+ <body class="{% block body_class %}body-home{% endblock %}">
<header>
<nav class="top-nav" id="top-nav">
<div class="nav-wrapper">
<div class="right">
<ul id="user-action" class="dropdown-content">
- <li class="user-name">{{ request.user }}</li>
+ <li class="user-name">
+ {{ request.user }}
+ </li>
<li class="divider"></li>
- <li><a href="/" target="_blank" class="waves-effect waves-teal">
+ <li>
+ <a href="/" target="_blank" class="waves-effect waves-teal">
{% trans "Visit storefront" context "Dashboard top navigation action" %}
- </a></li>
- <li><a href="{% url 'account_logout' %}" class="waves-effect waves-teal">
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'account_logout' %}" class="waves-effect waves-teal">
{% trans "Log out" context "Dashboard top navigation action" %}
- </a></li>
+ </a>
+ </li>
</ul>
- <a class="dropdown-button" data-constrainwidth="false" href="#" data-activates="user-action"><i class="material-icons">account_circle</i></a>
+ <a class="dropdown-button" data-constrainwidth="false" href="#" data-activates="user-action">
+ <i class="material-icons">account_circle</i>
+ </a>
{% if SEARCH_IS_ENABLED %}
- <a href="{% url "dashboard:search" %}" class="hide-on-med-and-up dropdown-button"><i class="material-icons">search</i></a>
+ <a href="{% url "dashboard:search" %}" class="hide-on-med-and-up dropdown-button">
+ <i class="material-icons">search</i>
+ </a>
{% endif %}
</div>
<ul class="left">
- <li><a href="#" id="toggle-menu" class="show-on-large"><i class="material-icons">menu</i></a></li>
- <li><a href="{% url 'dashboard:index' %}" class="logo">
- <img src="{% static "images/dashboard-logo.svg" %}" alt="Saleor">
- </a></li>
+ <li>
+ <a href="#" id="toggle-menu" class="show-on-large">
+ <i class="material-icons">menu</i>
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'dashboard:index' %}" class="logo">
+ <img src="{% static "images/dashboard-logo.svg" %}" alt="Saleor">
+ </a>
+ </li>
<li class="search">
{% if SEARCH_IS_ENABLED %}
<form method="get" action="{% url "dashboard:search" %}" class="hide-on-small-only">
- <div class="input-field">
- <input id="search" type="search" placeholder="{% trans "Search" context "Dashboard search placeholder" %}" name="q" value="{% if query %}{{ query }}{% endif %}">
- <label>
- <i class="material-icons">search</i>
- </label>
- </div>
+ <div class="input-field">
+ <input id="search" type="search" placeholder="{% trans "Search" context "Dashboard search placeholder" %}" name="q" value="{% if query %}{{ query }}{% endif %}">
+ <label>
+ <i class="material-icons">search</i>
+ </label>
+ </div>
</form>
{% endif %}
</li>
</ul>
<ul class="side-nav">
- <li class="nav-home"><a href="{% url 'dashboard:index' %}">
+ <li class="nav-home">
+ <a href="{% url 'dashboard:index' %}">
{% trans "Home" context "Dashboard side navigation link" %}
- </a></li>
+ </a>
+ </li>
<li class="side-nav-section" id="first">
- <p>{% trans "Catalogue" context "Dashboard side navigation title" %}</p>
+ <p>
+ {% trans "Catalogue" context "Dashboard side navigation title" %}
+ </p>
<ul>
- <li class="{% block menu_products_class %}{% endblock %}"><a href="{% url 'dashboard:product-list' %}">
- {% trans "Products" context "Dashboard side navigation link" %}
- </a></li>
- <li class="{% block menu_categories_class %}{% endblock %}"><a href="{% url 'dashboard:category-list' %}">
+ <li class="{% block menu_products_class %}{% endblock %}">
+ <a href="{% url 'dashboard:product-list' %}">
+ {% trans "Products" context "Dashboard side navigation link" %}
+ </a>
+ </li>
+ <li class="{% block menu_categories_class %}{% endblock %}">
+ <a href="{% url 'dashboard:category-list' %}">
{% trans "Categories" context "Dashboard side navigation link" %}
- </a></li>
- <li class="{% block menu_location_class %}{% endblock %}"><a href="{% url 'dashboard:product-stock-location-list' %}">
- {% trans "Stock locations" context "Dashboard side navigation link" %}
- </a></li>
+ </a>
+ </li>
+ <li class="{% block menu_location_class %}{% endblock %}">
+ <a href="{% url 'dashboard:product-stock-location-list' %}">
+ {% trans "Stock locations" context "Dashboard side navigation link" %}
+ </a>
+ </li>
</ul>
</li>
<li class="side-nav-section">
- <p>{% trans "Discounts" context "Dashboard side navigation title" %}</p>
+ <p>
+ {% trans "Discounts" context "Dashboard side navigation title" %}
+ </p>
<ul>
- <li class="{% block menu_sales_class %}{% endblock %}"><a href="{% url 'dashboard:sale-list' %}">
+ <li class="{% block menu_sales_class %}{% endblock %}">
+ <a href="{% url 'dashboard:sale-list' %}">
{% trans "Sales" context "Dashboard side navigation link" %}
- </a></li>
- <li class="{% block menu_vouchers_class %}{% endblock %}"><a href="{% url 'dashboard:voucher-list' %}">
- {% trans "Vouchers" context "Dashboard side navigation link" %}</a></li>
+ </a>
+ </li>
+ <li class="{% block menu_vouchers_class %}{% endblock %}">
+ <a href="{% url 'dashboard:voucher-list' %}">
+ {% trans "Vouchers" context "Dashboard side navigation link" %}
+ </a>
+ </li>
</ul>
</li>
<li class="side-nav-section">
- <p>{% trans "Sales" context "Dashboard side navigation title. `Sales' is noun of to sell" %}</p>
+ <p>
+ {% trans "Sales" context "Dashboard side navigation title. `Sales' is noun of to sell" %}
+ </p>
<ul>
- <li class="{% block menu_orders_class %}{% endblock %}"><a href="{% url 'dashboard:orders' %}">
+ <li class="{% block menu_orders_class %}{% endblock %}">
+ <a href="{% url 'dashboard:orders' %}">
{% trans "Orders" %}
- </a></li>
- <li class="{% block menu_customers_class %}{% endblock %}"><a href="{% url 'dashboard:customers' %}">
+ </a>
+ </li>
+ <li class="{% block menu_customers_class %}{% endblock %}">
+ <a href="{% url 'dashboard:customers' %}">
{% trans "Customers" context "Dashboard side navigation link" %}
- </a></li>
+ </a>
+ </li>
</ul>
</li>
<li class="side-nav-section">
- <p>{% trans "Configuration" context "Dashboard side navigation title" %}</p>
+ <p>
+ {% trans "Configuration" context "Dashboard side navigation title" %}
+ </p>
<ul>
- <li class="{% block menu_product_classes_class %}{% endblock %}"><a href="{% url 'dashboard:product-class-list' %}">
- {% trans "Product types" context "Dashboard side navigation link" %}</a></li>
- <li class="{% block menu_attributes_class %}{% endblock %}"><a href="{% url 'dashboard:product-attributes' %}">
- {% trans "Attributes" context "Dashboard side navigation link" %}</a></li>
- <li class="{% block menu_delivery_class %}{% endblock %}"><a href="{% url 'dashboard:shipping-methods' %}">
- {% trans "Shipping methods" context "Dashboard side navigation link" %}</a></li>
- <li class="{% block menu_settings_class %}{% endblock %}"><a href="{% url 'dashboard:site-index' %}">
- {% trans "Site settings" context "Dashboard side navigation link" %}</a></li>
+ <li class="{% block menu_product_classes_class %}{% endblock %}">
+ <a href="{% url 'dashboard:product-class-list' %}">
+ {% trans "Product types" context "Dashboard side navigation link" %}
+ </a>
+ </li>
+ <li class="{% block menu_attributes_class %}{% endblock %}">
+ <a href="{% url 'dashboard:product-attributes' %}">
+ {% trans "Attributes" context "Dashboard side navigation link" %}
+ </a>
+ </li>
+ <li class="{% block menu_delivery_class %}{% endblock %}">
+ <a href="{% url 'dashboard:shipping-methods' %}">
+ {% trans "Shipping methods" context "Dashboard side navigation link" %}
+ </a>
+ </li>
+ <li class="{% block menu_settings_class %}{% endblock %}">
+ <a href="{% url 'dashboard:site-index' %}">
+ {% trans "Site settings" context "Dashboard side navigation link" %}
+ </a>
+ </li>
</ul>
</li>
{% if request.user.is_superuser %}
- <li class="side-nav-section" id="version-indicator">
- <p>{% trans "Release" context "Dashboard software version" %}: {% version %}</p>
- </li>
+ <li class="side-nav-section" id="version-indicator">
+ <p>
+ {% trans "Release" context "Dashboard software version" %}: {% version %}
+ </p>
+ </li>
{% endif %}
</ul>
</div>
</nav>
</header>
-
<div class="subheader top-nav">
<div class="nav-wrapper container">
{% block breadcrumbs %}
<ul class="breadcrumbs">
- <li class="visible-s"><a href="#">{% trans "Home" context "Dashboard homepage breadcrumbs" %}</a></li>
+ <li class="visible-s">
+ <a href="#">
+ {% trans "Home" context "Dashboard homepage breadcrumbs" %}
+ </a>
+ </li>
</ul>
{% endblock %}
{% block header_extra %}{% endblock %}
</div>
</div>
-
<main class="main">
- <div class="container">
- {% block content %}
- {% endblock %}
- </div>
+ <div class="container">
+ {% block content %}{% endblock %}
+ </div>
</main>
-
-
<div id="base-modal" class="modal"></div>
<div id="base-modal-fixed" class="modal modal-fixed-footer"></div>
@@ -148,5 +206,5 @@
{% include "dashboard/includes/_messages.html" %}
{% block custom_js %}{% endblock %}
-</body>
+ </body>
</html>
diff --git a/templates/dashboard/category/category_confirm_delete.html b/templates/dashboard/category/category_confirm_delete.html
index 0fed81b8d0..475da40d8d 100644
--- a/templates/dashboard/category/category_confirm_delete.html
+++ b/templates/dashboard/category/category_confirm_delete.html
@@ -2,61 +2,61 @@
{% load i18n %}
{% load mptt_tags %}
-{% block title %}{% trans "Delete category" context "Delete category page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete category" context "Delete category page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-categories{% endblock %}
{% block content %}
- <form class="form form-horizontal" action="" method="post" novalidate>
- {% csrf_token %}
-
- <div class="row">
- <div class="col-lg-12">
- <h1 class="page-header">
- {% blocktrans trimmed with category=category context "Delete category title" %}
- Are you sure you want to delete the category {{ category }}?
- {% endblocktrans %}
- </h1>
- </div>
- </div>
-
- <div class="row">
- <div class="col-lg-12">
- {% if descendants %}
- {% trans "The following child categories will be deleted:" context "Delete category form text about descendant categories" %}
- <ul>
- {% recursetree descendants %}
- <li>{{ node.name }}
- {% if not node.is_leaf_node %}
- <ul class="children">
- {{ children }}
- </ul>
- {% endif %}
- </li>
- {% endrecursetree %}
- </ul>
- {% endif %}
-
- {% if products_count %}
- {% blocktrans count counter=products_count trimmed context "Delete category form text about products" %}
- There is one product in this category that will be deleted.
- {% plural %}
- There are {{ counter }} products in this category that will be deleted.
- {% endblocktrans %}
- {% endif %}
- </div>
- </div>
+ <form class="form form-horizontal" action="" method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ <div class="col-lg-12">
+ <h1 class="page-header">
+ {% blocktrans trimmed with category=category context "Delete category title" %}
+ Are you sure you want to delete the category {{ category }}?
+ {% endblocktrans %}
+ </h1>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-12">
+ {% if descendants %}
+ {% trans "The following child categories will be deleted:" context "Delete category form text about descendant categories" %}
+ <ul>
+ {% recursetree descendants %}
+ <li>{{ node.name }}
+ {% if not node.is_leaf_node %}
+ <ul class="children">
+ {{ children }}
+ </ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+ {% endif %}
- <div class="form-group">
- <div class="col-md-6">
- <button class="btn btn-danger" type="submit"><i class="glyphicon glyphicon-trash"></i>
- {% trans "Delete" context "Delete category form primary action" %}
- </button>
- <a class="btn btn-default" href="{% url 'dashboard:category-list' root_pk=category.pk %}">
- <i class="glyphicon glyphicon-remove"></i>
- {% trans "Cancel" context "Delete category form secondary action" %}
- </a>
- </div>
- </div>
- </form>
+ {% if products_count %}
+ {% blocktrans count counter=products_count trimmed context "Delete category form text about products" %}
+ There is one product in this category that will be deleted.
+ {% plural %}
+ There are {{ counter }} products in this category that will be deleted.
+ {% endblocktrans %}
+ {% endif %}
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-md-6">
+ <button class="btn btn-danger" type="submit">
+ <i class="glyphicon glyphicon-trash"></i>
+ {% trans "Delete" context "Delete category form primary action" %}
+ </button>
+ <a class="btn btn-default" href="{% url 'dashboard:category-list' root_pk=category.pk %}">
+ <i class="glyphicon glyphicon-remove"></i>
+ {% trans "Cancel" context "Delete category form secondary action" %}
+ </a>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/category/detail.html b/templates/dashboard/category/detail.html
index 0761b9ec3d..2f0f5d206a 100644
--- a/templates/dashboard/category/detail.html
+++ b/templates/dashboard/category/detail.html
@@ -3,78 +3,99 @@
{% load i18n %}
{% load mptt_tags %}
-{% block title %}{% if category.pk %}{{ category }}{% else %}{% trans "Add new category" context "Category detail page title" %}{% endif %} - {% trans "Categories" context "Category detail page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if category.pk %}
+ {{ category }}
+ {% else %}
+ {% trans "Add new category" context "Category detail page title" %}
+ {% endif %}
+ - {% trans "Categories" context "Category detail page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-categories{% endblock %}
{% block menu_categories_class %}active{% endblock %}
-{% block page_title %}{% if category.pk %}{{ category }}{% else %}{% trans "Add new category" context "Category detail page title" %}{% endif %}{% endblock %}
+{% block page_title %}
+ {% if category.pk %}
+ {{ category }}
+ {% else %}
+ {% trans "Add new category" context "Category detail page title" %}
+ {% endif %}
+{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:category-list'%}" class="breadcrumbs--ellipsed-item">{% trans "Categories" context "Category detail breadcrumbs" %}</a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:category-list' %}" class="breadcrumbs--ellipsed-item"> <i class="material-icons">arrow_back</i>
- </a></li>
- <li>
- {% if category.pk %}
- <span class="breadcrumbs--ellipsed-item">{{ category }}</span>
- {% else %}
- <span class="breadcrumbs--ellipsed-item">
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:category-list'%}" class="breadcrumbs--ellipsed-item">
+ {% trans "Categories" context "Category detail breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:category-list' %}" class="breadcrumbs--ellipsed-item">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ {% if category.pk %}
+ <span class="breadcrumbs--ellipsed-item">{{ category }}</span>
+ {% else %}
+ <span class="breadcrumbs--ellipsed-item">
{% trans "Add new category" context "Category detail breadcrumbs" %}
</span>
- {% endif %}
- </li>
- </ul>
+ {% endif %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" id="form-category" enctype="multipart/form-data" novalidate>
- <div class="card-content">
- {% csrf_token %}
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.description|materializecss }}
- </div>
- </div>
- <div class="col s12 m4">
- <div class="row">
- {{ form.hidden|materializecss:"input-field s12" }}
- </div>
- </div>
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if category.parent %}
- <a href="{% url 'dashboard:category-list' root_pk=category.parent.pk %}" class="btn btn-flat">
- {% trans "Cancel" context "Category form secondary action" %}</a>
- {% else %}
- <a href="{% url 'dashboard:category-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Category form secondary action" %}</a>
- {% endif %}
- {% if category.pk %}
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Category form primary action" %}
- </button>
- {% else %}
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Category form primary action" %}
- </button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" id="form-category" enctype="multipart/form-data" novalidate>
+ <div class="card-content">
+ {% csrf_token %}
+ <div class="row">
+ {{ form.name|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.description|materializecss }}
+ </div>
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.hidden|materializecss:"input-field s12" }}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="card-action right-align">
+ {% if category.parent %}
+ <a href="{% url 'dashboard:category-list' root_pk=category.parent.pk %}" class="btn btn-flat">
+ {% trans "Cancel" context "Category form secondary action" %}
+ </a>
+ {% else %}
+ <a href="{% url 'dashboard:category-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Category form secondary action" %}
+ </a>
+ {% endif %}
+ {% if category.pk %}
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Category form primary action" %}
+ </button>
+ {% else %}
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Category form primary action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/category/list.html b/templates/dashboard/category/list.html
index c5847b22e8..5dd4d7ad45 100644
--- a/templates/dashboard/category/list.html
+++ b/templates/dashboard/category/list.html
@@ -10,110 +10,123 @@
{% block menu_categories_class %}active{% endblock %}
{% block header_menu %}
- {% if root %}
- {% if root.parent %}
- {% url 'dashboard:category-list' root_pk=root.parent.pk as url %}
- {% else %}
- {% url 'dashboard:category-list' as url %}
- {% endif %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% if root %}
+ {% if root.parent %}
+ {% url 'dashboard:category-list' root_pk=root.parent.pk as url %}
{% else %}
- {{ block.super }}
+ {% url 'dashboard:category-list' as url %}
{% endif %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% else %}
+ {{ block.super }}
+ {% endif %}
{% endblock %}
{% block header_extra %}
- <div class="fixed-action-btn">
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal"
- title="{% trans "Add category" context "Category list add button text" %}"
- href="
- {% if root %}{% url 'dashboard:category-add' root_pk=root.pk %}{% else %}{% url 'dashboard:category-add' %}{% endif %}">
- <i class="material-icons">add</i>
+ <div class="fixed-action-btn">
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal"
+ title="{% trans "Add category" context "Category list add button text" %}"
+ href="{% if root %}{% url 'dashboard:category-add' root_pk=root.pk %}{% else %}{% url 'dashboard:category-add' %}{% endif %}">
+ <i class="material-icons">add</i>
+ </a>
+ </div>
+ {% if root %}
+ <a class="dropdown-button right" href="#" data-activates="category-delete" data-constrainwidth="false">
+ <i class="material-icons">more_vert</i>
+ </a>
+ <ul id="category-delete" class="dropdown-content">
+ <li>
+ <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-edit' root_pk=root.pk %}" href="#base-modal">
+ {% trans "Edit category" context "Category list action link" %}
</a>
- </div>
-
- {% if root %}
- <a class="dropdown-button right" href="#" data-activates="category-delete" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ </li>
+ <li>
+ <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-delete' pk=root.pk %}" href="#base-modal">
+ {% trans "Remove category" context "Category list action link" %}
</a>
- <ul id="category-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-edit' root_pk=root.pk %}"
- href="#base-modal">
- {% trans "Edit category" context "Category list action link" %}
- </a>
- </li>
-
- <li>
- <a class="modal-trigger-custom" data-href="{% url 'dashboard:category-delete' pk=root.pk %}"
- href="#base-modal">
- {% trans "Remove category" context "Category list action link" %}
- </a>
- </li>
- </ul>
- {% endif %}
+ </li>
+ </ul>
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- {% if path %}
- <li><a href="{% url 'dashboard:category-list' %}">{% trans "Categories" context "Category list breadcrumbs" %}</a></li>
+ <ul class="breadcrumbs breadcrumbs--history">
+ {% if path %}
+ <li>
+ <a href="{% url 'dashboard:category-list' %}">
+ {% trans "Categories" context "Category list breadcrumbs" %}
+ </a>
+ </li>
+ {% else %}
+ <li class="visible-s">
+ <span>
+ {% trans "Categories" context "Category list breadcrumbs" %}
+ </span>
+ </li>
+ {% endif %}
+ {% if path %}
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:category-list' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ {% for node in path %}
+ {% if forloop.last %}
+ <li title="{{ node.name }}">
+ <span class="breadcrumbs--ellipsed-item">
+ {{ node.name }}
+ </span>
+ </li>
{% else %}
- <li class="visible-s"><span>{% trans "Categories" context "Category list breadcrumbs" %}</span></li>
+ <li class="hide-on-med-and-down">
+ <a title="{{ node.name }}" href="{% url 'dashboard:category-list' root_pk=node.pk %}" class="breadcrumbs--ellipsed-item">
+ {{ node.name }}
+ </a>
+ </li>
{% endif %}
- {% if path %}
- <li class="back-mobile"><a href="{% url 'dashboard:category-list' %}"><i
- class="material-icons">arrow_back</i></a></li>
- {% for node in path %}
- {% if forloop.last %}
- <li title="{{ node.name }}">
- <span class="breadcrumbs--ellipsed-item">{{ node.name }}</span>
- </li>
- {% else %}
- <li class="hide-on-med-and-down">
- <a title="{{ node.name }}" href="{% url 'dashboard:category-list' root_pk=node.pk %}"
- class="breadcrumbs--ellipsed-item">
- {{ node.name }}
- </a>
- </li>
- {% endif %}
- {% endfor %}
- {% endif %}
- </ul>
+ {% endfor %}
+ {% endif %}
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- {% if categories %}
- <ul class="collection list">
- {% for node in categories %}
- <li class="collection-item list-item">
- <a class="list-item-name" href="{% url "dashboard:category-list" root_pk=node.pk %}">
- {{ node.name }}
- </a>
-
- <p class="list-item-desc"><span>
- {% if node.description %}
- {{ node.description }}
- {% else %}
- &nbsp;
- {% endif %}
- </span></p>
-
- {% if node.hidden %}
- <span class="list-item-icon"><i class="material-icons">visibility_off</i></span>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- {% else %}
- <div class="not-found">
- {% if root %}
- <p class="grey-text">{% trans "No subcategories." context "Empty Category list message" %}</p>
- {% else %}
- <p class="grey-text">{% trans "No categories." context "Empty Category list message" %}</p>
- {% endif %}
- </div>
- {% endif %}
+ {% if categories %}
+ <ul class="collection list">
+ {% for node in categories %}
+ <li class="collection-item list-item">
+ <a class="list-item-name" href="{% url "dashboard:category-list" root_pk=node.pk %}">
+ {{ node.name }}
+ </a>
+ <p class="list-item-desc">
+ <span>
+ {% if node.description %}
+ {{ node.description }}
+ {% else %}
+ &nbsp;
+ {% endif %}
+ </span>
+ </p>
+ {% if node.hidden %}
+ <span class="list-item-icon">
+ <i class="material-icons">visibility_off</i>
+ </span>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <div class="not-found">
+ {% if root %}
+ <p class="grey-text">
+ {% trans "No subcategories." context "Empty Category list message" %}
+ </p>
+ {% else %}
+ <p class="grey-text">
+ {% trans "No categories." context "Empty Category list message" %}
+ </p>
+ {% endif %}
+ </div>
+ {% endif %}
{% endblock %}
diff --git a/templates/dashboard/category/modal_delete.html b/templates/dashboard/category/modal_delete.html
index b10b0a30d4..606eea5365 100644
--- a/templates/dashboard/category/modal_delete.html
+++ b/templates/dashboard/category/modal_delete.html
@@ -2,52 +2,50 @@
{% load mptt_tags %}
<form method="post" id="form-category" class="form-async" action="{% url "dashboard:category-delete" pk=category.pk %}" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <div class="row">
- <div class="col s12">
- <h5>
- {% blocktrans with category=category trimmed context "Delete category modal title" %}
- Are you sure you want to delete the category {{ category }}?
- {% endblocktrans %}
- </h5>
- </div>
- </div>
-
- {% if descendants %}
- <div class="row">
- <div class="col s12">
- {% trans "The following child categories will be deleted:" context "Delete category form text about descendant categories" %}
- <ul>
- {% recursetree descendants %}
- <li>{{ node.name }}
- {% if not node.is_leaf_node %}
- <ul class="children">
- {{ children }}
- </ul>
- {% endif %}
- </li>
- {% endrecursetree %}
- </ul>
- </div>
- </div>
- {% endif %}
-
- {% if products_count %}
- {% blocktrans count counter=products_count trimmed context "Delete category form text about products" %}
- There is one product in this category that will be deleted.
- {% plural %}
- There are {{ counter }} products in this category that will be deleted.
- {% endblocktrans %}
- {% endif %}
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Delete category form primary action" %}
- </button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Delete category form secondary action" %}
- </a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <div class="row">
+ <div class="col s12">
+ <h5>
+ {% blocktrans with category=category trimmed context "Delete category modal title" %}
+ Are you sure you want to delete the category {{ category }}?
+ {% endblocktrans %}
+ </h5>
+ </div>
</div>
+ {% if descendants %}
+ <div class="row">
+ <div class="col s12">
+ {% trans "The following child categories will be deleted:" context "Delete category form text about descendant categories" %}
+ <ul>
+ {% recursetree descendants %}
+ <li>
+ {{ node.name }}
+ {% if not node.is_leaf_node %}
+ <ul class="children">
+ {{ children }}
+ </ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+ {% if products_count %}
+ {% blocktrans count counter=products_count trimmed context "Delete category form text about products" %}
+ There is one product in this category that will be deleted.
+ {% plural %}
+ There are {{ counter }} products in this category that will be deleted.
+ {% endblocktrans %}
+ {% endif %}
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Delete category form primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Delete category form secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/category/modal_edit.html b/templates/dashboard/category/modal_edit.html
index 2f23ad642a..44d7b09afb 100644
--- a/templates/dashboard/category/modal_edit.html
+++ b/templates/dashboard/category/modal_edit.html
@@ -7,19 +7,19 @@
<div class="modal-content">
<div class="row">
<div class="col s12">
- <h5>{% blocktrans trimmed context "Edit category modal title" %}
- Edit {{ category }}
- {% endblocktrans %}</h5>
+ <h5>
+ {% blocktrans trimmed context "Edit category modal title" %}
+ Edit {{ category }}
+ {% endblocktrans %}
+ </h5>
</div>
</div>
-
<div class="row">
{{ form.name|materializecss:"s8 m10" }}
{{ form.hidden|materializecss:"s4 m2" }}
{{ form.description|materializecss }}
</div>
</div>
-
<div class="modal-footer">
<button type="submit" class="modal-action btn-flat">
{% trans "Update" context "Edit category form primary action" %}
diff --git a/templates/dashboard/customer/detail.html b/templates/dashboard/customer/detail.html
index ab69477008..89ad2c6fa9 100644
--- a/templates/dashboard/customer/detail.html
+++ b/templates/dashboard/customer/detail.html
@@ -3,109 +3,132 @@
{% load i18n %}
{% load status %}
-{% block title %}{{ customer }} - {% trans "Customers" context "Customer detail page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {{ customer }} - {% trans "Customers" context "Customer detail page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-customers{% endblock %}
{% block menu_customers_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:customers" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:customers" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:customers" %}">{% trans "Customers" context "Customer details breadcrumbs" %}</a></li>
- <li class="back-mobile">
- <a href="{% url "dashboard:customers" %}">
- <i class="material-icons">arrow_back</i></a>
- </li>
- <li><span class="breadcrumbs--elipsed-item">{{ customer }}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:customers" %}">
+ {% trans "Customers" context "Customer details breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:customers" %}">
+ <i class="material-icons">arrow_back</i></a>
+ </li>
+ <li><span class="breadcrumbs--elipsed-item">{{ customer }}</span></li>
+ </ul>
{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 l8">
- <div class="card">
- <div class="data-table-header{% if not customer_orders %} data-table-header--no-data{% endif %}">
- <h5 class="data-table-title">
- {% trans "Order history" context "Customer orders table title" %}
- </h5>
- </div>
-
- {% if customer_orders %}
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Number" context "Customer orders table header" %}</th>
- <th>{% trans "Placed on" context "Customer orders table header" %}</th>
- <th>{% trans "Order status" context "Customer orders table header" %}</th>
- <th class="right-align">{% trans "Total" context "Customer orders table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for order in customer_orders %}
- <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
- <td>{{ order }}</td>
- <td>{{ order.created }}</td>
- <td>{% render_status order.status order.get_status_display %}</td>
- <td class="right-align">{% gross order.get_total html=True %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% else %}
- <div class="card-content card-content--no-data">
- <p>{% trans "No orders found." context "Empty customer orders table message" %}</p>
- </div>
- {% endif %}
+ <div class="row">
+ <div class="col s12 l8">
+ <div class="card">
+ <div class="data-table-header{% if not customer_orders %} data-table-header--no-data{% endif %}">
+ <h5 class="data-table-title">
+ {% trans "Order history" context "Customer orders table title" %}
+ </h5>
</div>
+ {% if customer_orders %}
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Number" context "Customer orders table header" %}
+ </th>
+ <th>
+ {% trans "Placed on" context "Customer orders table header" %}
+ </th>
+ <th>
+ {% trans "Order status" context "Customer orders table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Total" context "Customer orders table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in customer_orders %}
+ <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
+ <td>
+ {{ order }}
+ </td>
+ <td>
+ {{ order.created }}
+ </td>
+ <td>
+ {% render_status order.status order.get_status_display %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% else %}
+ <div class="card-content card-content--no-data">
+ <p>
+ {% trans "No orders found." context "Empty customer orders table message" %}
+ </p>
+ </div>
+ {% endif %}
+ </div>
</div>
<div class="col s12 l4">
- <div class="row">
- <div class="col s12 m6 l12">
- <div class="card equal-height-on-med">
- <div class="card-content">
- <span class="card-title black-text">
- {% trans "Default shipping address" context "Customer default shipping address card title" %}
- </span>
-
- {% if customer.default_shipping_address %}
- {% with customer.default_shipping_address as address %}
- {% include 'dashboard/includes/_address.html' with address=address only %}
- {% endwith %}
- {% else %}
- <span>{% trans "No default shipping address." context "Customer without default shipping address message" %}</span>
- {% endif %}
- <i class="material-icons">email</i> <a href="mailto:{{ customer.email }}">{{ customer.email }}</a>
- </div>
- </div>
+ <div class="row">
+ <div class="col s12 m6 l12">
+ <div class="card equal-height-on-med">
+ <div class="card-content">
+ <span class="card-title black-text">
+ {% trans "Default shipping address" context "Customer default shipping address card title" %}
+ </span>
+ {% if customer.default_shipping_address %}
+ {% with customer.default_shipping_address as address %}
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ {% endwith %}
+ {% else %}
+ <span>{% trans "No default shipping address." context "Customer without default shipping address message" %}</span>
+ {% endif %}
+ <i class="material-icons">email</i>
+ <a href="mailto:{{ customer.email }}">
+ {{ customer.email }}
+ </a>
</div>
-
- <div class="col s12 m6 l12">
- <div class="card equal-height-on-med">
- <div class="card-content">
- <span class="card-title black-text">
- {% trans "Default billing address" context "Customer default billing address card title" %}
- </span>
-
- {% if customer.default_billing_address %}
- {% with customer.default_billing_address as address %}
- {% include 'dashboard/includes/_address.html' with address=address only %}
- {% endwith %}
- {% else %}
- <span>
- {% trans "No default billing address." context "Customer without default billing address message" %}
- </span>
- {% endif %}
- </div>
- </div>
+ </div>
+ </div>
+ <div class="col s12 m6 l12">
+ <div class="card equal-height-on-med">
+ <div class="card-content">
+ <span class="card-title black-text">
+ {% trans "Default billing address" context "Customer default billing address card title" %}
+ </span>
+ {% if customer.default_billing_address %}
+ {% with customer.default_billing_address as address %}
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ {% endwith %}
+ {% else %}
+ <span>
+ {% trans "No default billing address." context "Customer without default billing address message" %}
+ </span>
+ {% endif %}
</div>
+ </div>
</div>
+ </div>
</div>
-</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/customer/list.html b/templates/dashboard/customer/list.html
index e6c2bae324..41514b9d78 100644
--- a/templates/dashboard/customer/list.html
+++ b/templates/dashboard/customer/list.html
@@ -3,72 +3,88 @@
{% load prices_i18n %}
{% load materializecss %}
-{% block title %}{% trans "Customers" context "Customer list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Customers" context "Customer list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-customers{% endblock %}
{% block menu_customers_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Customers" context "Customer list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Customers" context "Customer list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- {% if customers %}
- <div class="card">
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Email" context "Customers table header" %}</th>
- <th class="wide">{% trans "Name" context "Customers table header" %}</th>
- <th>{% trans "Location" context "Customers table header" %}</th>
- <th class="right-align">{% trans "Number of orders" context "Customers table header" %}</th>
- <th>{% trans "Last order" context "Customers table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for customer in customers %}
- <tr data-action-go="{% url "dashboard:customer-details" pk=customer.pk %}">
- {% with customer.default_billing_address as default_address %}
- <td>
- {{ customer.email }}
- </td>
- {% if default_address %}
- <td>
- {{ default_address.first_name }} {{ default_address.last_name }}
- </td>
- <td>
- {{ default_address.city }}, {{ default_address.get_country_display }}
- </td>
- {% else %}
- <td colspan="2"></td>
- {% endif %}
- {% endwith %}
- <td class="right-align">
- {{ customer.num_orders }}
- </td>
- <td class="ignore-link">
- {% if customer.last_order %}
- <a href="{% url 'dashboard:order-details' order_pk=customer.last_order %}">
- {% blocktrans with last_order=customer.last_order trimmed context "Customers table last order data" %}
- #{{ last_order }}
- {% endblocktrans %}
- </a>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- {% else %}
- <div class="card-content card-content--no-data not-found">
- <p class="grey-text">{% trans "No customers found." context "Empty customers table message" %}</p>
- </div>
- {% endif %}
- {% include "dashboard/includes/_pagination.html" with page_obj=customers %}
+ {% if customers %}
+ <div class="card">
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Email" context "Customers table header" %}
+ </th>
+ <th class="wide">
+ {% trans "Name" context "Customers table header" %}
+ </th>
+ <th>
+ {% trans "Location" context "Customers table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Number of orders" context "Customers table header" %}
+ </th>
+ <th>
+ {% trans "Last order" context "Customers table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for customer in customers %}
+ <tr data-action-go="{% url "dashboard:customer-details" pk=customer.pk %}">
+ {% with customer.default_billing_address as default_address %}
+ <td>
+ {{ customer.email }}
+ </td>
+ {% if default_address %}
+ <td>
+ {{ default_address.first_name }} {{ default_address.last_name }}
+ </td>
+ <td>
+ {{ default_address.city }}, {{ default_address.get_country_display }}
+ </td>
+ {% else %}
+ <td colspan="2"></td>
+ {% endif %}
+ {% endwith %}
+ <td class="right-align">
+ {{ customer.num_orders }}
+ </td>
+ <td class="ignore-link">
+ {% if customer.last_order %}
+ <a href="{% url 'dashboard:order-details' order_pk=customer.last_order %}">
+ {% blocktrans with last_order=customer.last_order trimmed context "Customers table last order data" %}
+ #{{ last_order }}
+ {% endblocktrans %}
+ </a>
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% else %}
+ <div class="card-content card-content--no-data not-found">
+ <p class="grey-text">
+ {% trans "No customers found." context "Empty customers table message" %}
+ </p>
+ </div>
+ {% endif %}
+ {% include "dashboard/includes/_pagination.html" with page_obj=customers %}
{% endblock %}
diff --git a/templates/dashboard/discount/sale_confirm_delete.html b/templates/dashboard/discount/sale_confirm_delete.html
index a431e49bd0..171edee2dd 100644
--- a/templates/dashboard/discount/sale_confirm_delete.html
+++ b/templates/dashboard/discount/sale_confirm_delete.html
@@ -1,39 +1,49 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
-{% block title %}{% trans "Delete sale" context "Delete sale (discount) page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete sale" context "Delete sale (discount) page title" %} - {{ block.super }}
+{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
- {% trans "Discounts" context "Delete sale (discount) breadcrumbs" %}
- </a></li>
- <li><span class="breadcrumbs--ellipsed-item">
- {% trans "Delete sale" context "Delete sale (discount) breadcrumbs" %}
- </span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Discounts" context "Delete sale (discount) breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Delete sale" context "Delete sale (discount) breadcrumbs" %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <p>{% trans "Are you sure you want to delete the following sale?" context "Delete sale (discount) message" %}</p>
- <form method="post" novalidate>
- {% csrf_token %}
- <div class="row">
- <ul class="collection">
- <li class="collection-item">
- {{ sale }}
- </li>
- </ul>
- </div>
-
- <div class="row">
- <div class="col m6 l4 offset-m3 offset-l4 right-align">
- <a href="{% url 'dashboard:sale-list' %}" class="btn-flat"><i class="material-icons">clear</i>
- {% trans "Cancel" context "Delete sale (discount) secondary action" %}</a>
- <button type="submit" class="btn materialize-red"><i class="material-icons">delete_forever</i>
- {% trans "Delete" context "Delete sale (discount) primary action" %}
- </button>
- </div>
- </div>
- </form>
+ <p>
+ {% trans "Are you sure you want to delete the following sale?" context "Delete sale (discount) message" %}
+ </p>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ <ul class="collection">
+ <li class="collection-item">
+ {{ sale }}
+ </li>
+ </ul>
+ </div>
+ <div class="row">
+ <div class="col m6 l4 offset-m3 offset-l4 right-align">
+ <a href="{% url 'dashboard:sale-list' %}" class="btn-flat">
+ <i class="material-icons">clear</i>
+ {% trans "Cancel" context "Delete sale (discount) secondary action" %}
+ </a>
+ <button type="submit" class="btn materialize-red">
+ <i class="material-icons">delete_forever</i>
+ {% trans "Delete" context "Delete sale (discount) primary action" %}
+ </button>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/discount/sale_form.html b/templates/dashboard/discount/sale_form.html
index 23bfef26e9..e953b62815 100644
--- a/templates/dashboard/discount/sale_form.html
+++ b/templates/dashboard/discount/sale_form.html
@@ -3,94 +3,115 @@
{% load materializecss %}
{% load static %}
-{% block title %}{% if sale.pk %}{{ sale }}{% else %}{% trans "Add new sale" context "Sale (discount) page title" %}
-{% endif %} - {% trans "Sales" context "Sale (discount) page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if sale.pk %}
+ {{ sale }}
+ {% else %}
+ {% trans "Add new sale" context "Sale (discount) page title" %}
+ {% endif %}
+ - {% trans "Sales" context "Sale (discount) page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-sales{% endblock %}
{% block menu_sales_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:sale-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:sale-list" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block header_extra %}
- {% if sale.pk %}
- <a class="dropdown-button right" href="#" data-activates="sale-delete"
- data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ {% if sale.pk %}
+ <a class="dropdown-button right" href="#" data-activates="sale-delete"
+ data-constrainwidth="false">
+ <i class="material-icons">more_vert</i>
+ </a>
+ <ul id="sale-delete" class="dropdown-content">
+ <li>
+ <a class="modal-trigger-custom" href="#base-modal"
+ data-href="{% url 'dashboard:sale-delete' pk=sale.pk %}">
+ {% trans "Remove sale" context "Sale (discount) action" %}
</a>
- <ul id="sale-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" href="#base-modal"
- data-href="{% url 'dashboard:sale-delete' pk=sale.pk %}">
- {% trans "Remove sale" context "Sale (discount) action" %}
- </a>
- </li>
- </ul>
- {% endif %}
+ </li>
+ </ul>
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:sale-list' %}">
- {% trans "Sales" context "Sale (discount) breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:sale-list' %}"><i class="material-icons">arrow_back</i></a></li>
- <li><span class="breadcrumbs--ellipsed-item">{% if sale.pk %}{{ sale }}{% else %}
- {% trans "Add new sale" context "Sale (discount) breadcrumbs" %}{% endif %}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:sale-list' %}">
+ {% trans "Sales" context "Sale (discount) breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:sale-list' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if sale.pk %}
+ {{ sale }}
+ {% else %}
+ {% trans "Add new sale" context "Sale (discount) breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_discounts_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" enctype="multipart/form-data" id="form-sales" novalidate>
- <div class="card-content card-content-form">
- {% csrf_token %}
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.value|materializecss }}
- </div>
- </div>
- <div class="col s12 m4">
- {{ form.type|materializecss:"input-field s12" }}
- </div>
- </div>
- <div class="row">
- {{ form.products|materializecss }}
- </div>
- <div class="row">
- {{ form.categories|materializecss }}
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if sale.pk %}
- <a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Sale (discount) secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Sale (discount) primary action" %}
- </button>
- {% else %}
- <a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Sake (discount) secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Sale (discount) primary action" %}
- </button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" enctype="multipart/form-data" id="form-sales" novalidate>
+ <div class="card-content card-content-form">
+ {% csrf_token %}
+ <div class="row">
+ {{ form.name|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.value|materializecss }}
+ </div>
+ </div>
+ <div class="col s12 m4">
+ {{ form.type|materializecss:"input-field s12" }}
+ </div>
+ </div>
+ <div class="row">
+ {{ form.products|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.categories|materializecss }}
+ </div>
+ </div>
+
+ <div class="card-action right-align">
+ {% if sale.pk %}
+ <a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Sale (discount) secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Sale (discount) primary action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:sale-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Sake (discount) secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Sale (discount) primary action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/discount/sale_list.html b/templates/dashboard/discount/sale_list.html
index 2eba0247d0..0cf1b7493e 100644
--- a/templates/dashboard/discount/sale_list.html
+++ b/templates/dashboard/discount/sale_list.html
@@ -3,55 +3,65 @@
{% load prices_i18n %}
{% load materializecss %}
-{% block title %}{% trans "Sales" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Sales" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-sales{% endblock %}
{% block menu_sales_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Sales" context "Sale (discount) list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">{% trans "Sales" context "Sale (discount) list breadcrumbs" %}</li>
+ </ul>
{% endblock %}
{% block menu_discounts_class %} active{% endblock %}
{% block content %}
- <div class="card">
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:sale-add' %}" class="btn-data-table btn-flat" title="{% trans "Add sale" context "Sale (discount) list add button text" %}">
- {% trans "Add" context "Product form variants tab table action" %}
- </a>
- </div>
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Name" context "Sale (discount) table header" %}</th>
- <th>{% trans "Discount" context "Sale (discount) table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% if sales %}
- {% for sale in sales %}
- <tr data-action-go="{% url 'dashboard:sale-update' pk=sale.pk %}">
- <td>{{ sale }}</td>
- <td>{{ sale.value }}{{ sale.get_type_display }}</td>
- </tr>
- {% endfor %}
- {% else %}
- <tr>
- <td>
- <span>
- {% trans "No sales found" context "Empty sales table message" %}
- </span>
- </td>
- </tr>
- {% endif %}
- </tbody>
- </table>
- </div>
- </div>
- {% include "dashboard/includes/_pagination.html" %}
+ <div class="card">
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:sale-add' %}" class="btn-data-table btn-flat" title="{% trans "Add sale" context "Sale (discount) list add button text" %}">
+ {% trans "Add" context "Product form variants tab table action" %}
+ </a>
+ </div>
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Name" context "Sale (discount) table header" %}
+ </th>
+ <th>
+ {% trans "Discount" context "Sale (discount) table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% if sales %}
+ {% for sale in sales %}
+ <tr data-action-go="{% url 'dashboard:sale-update' pk=sale.pk %}">
+ <td>
+ {{ sale }}
+ </td>
+ <td>
+ {{ sale.value }}{{ sale.get_type_display }}
+ </td>
+ </tr>
+ {% endfor %}
+ {% else %}
+ <tr>
+ <td>
+ <span>
+ {% trans "No sales found" context "Empty sales table message" %}
+ </span>
+ </td>
+ </tr>
+ {% endif %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% include "dashboard/includes/_pagination.html" %}
{% endblock %}
diff --git a/templates/dashboard/discount/sale_modal_confirm_delete.html b/templates/dashboard/discount/sale_modal_confirm_delete.html
index 1b7c067a3c..2eab79b11d 100644
--- a/templates/dashboard/discount/sale_modal_confirm_delete.html
+++ b/templates/dashboard/discount/sale_modal_confirm_delete.html
@@ -1,21 +1,23 @@
{% load i18n %}
<form action="{% url "dashboard:sale-delete" pk=sale.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Delete sale (discount) title" %}</h5>
-
- <p>
- {% blocktrans trimmed context "Delete sale (discount) text" %}
- You are about to delete <strong>{{ sale }}</strong>.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Delete sale (discount) form primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Delete sale (discount) form secondary action" %}</a>
- </div>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Delete sale (discount) title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Delete sale (discount) text" %}
+ You are about to delete <strong>{{ sale }}</strong>.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Delete sale (discount) form primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Delete sale (discount) form secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/discount/voucher_form.html b/templates/dashboard/discount/voucher_form.html
index acfff01cb3..d8e973d7c3 100644
--- a/templates/dashboard/discount/voucher_form.html
+++ b/templates/dashboard/discount/voucher_form.html
@@ -3,121 +3,144 @@
{% load materializecss %}
{% load static %}
-{% block title %}{% if voucher.pk %}{{ voucher }}{% else %}{% trans "Add new voucher" context "Voucher page title" %}
-{% endif %} - {% trans "Vouchers" context "Voucher page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if voucher.pk %}
+ {{ voucher }}
+ {% else %}
+ {% trans "Add new voucher" context "Voucher page title" %}
+ {% endif %}
+ - {% trans "Vouchers" context "Voucher page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-vouchers{% endblock %}
{% block menu_vouchers_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:voucher-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:voucher-list" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block header_extra %}
- {% if voucher.pk %}
- <a class="dropdown-button right" href="#" data-activates="voucher-delete"
- data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ {% if voucher.pk %}
+ <a class="dropdown-button right" href="#" data-activates="voucher-delete"
+ data-constrainwidth="false">
+ <i class="material-icons">more_vert</i>
+ </a>
+ <ul id="voucher-delete" class="dropdown-content">
+ <li>
+ <a class="modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:voucher-delete' pk=voucher.pk %}">
+ {% trans "Remove voucher" context "Voucher action" %}
</a>
- <ul id="voucher-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" href="#base-modal" data-href="{% url 'dashboard:voucher-delete' pk=voucher.pk %}">
- {% trans "Remove voucher" context "Voucher action" %}
- </a>
- </li>
- </ul>
- {% endif %}
+ </li>
+ </ul>
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:voucher-list' %}">
- {% trans "Vouchers" context "Voucher breadcrumbs" %}</a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:voucher-list' %}">
- <i class="material-icons">arrow_back</i></a></li>
- <li><span class="breadcrumbs--ellipsed-item">{% if voucher.pk %}
- {{ voucher }}{% else %}{% trans "Add new voucher" context "Voucher breadcrumbs" %}{% endif %}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:voucher-list' %}">
+ {% trans "Vouchers" context "Voucher breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:voucher-list' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if voucher.pk %}
+ {{ voucher }}
+ {% else %}
+ {% trans "Add new voucher" context "Voucher breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_discounts_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" enctype="multipart/form-data" id="form-vouchers" novalidate>
- <div class="card-content card-content-form">
- {% csrf_token %}
- {% if form.non_field_errors %}
- <blockquote>
- {% for non_field_error in form.non_field_errors %}
- {{ non_field_error }}
- {% endfor %}
- </blockquote>
- {% endif %}
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.code|materializecss }}
- </div>
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.discount_value|materializecss }}
- </div>
- </div>
- <div class="col s12 m4">
- <div class="row">
- {{ form.discount_value_type|materializecss:"input-field s12" }}
- </div>
- </div>
- </div>
- <div class="row">
- {{ form.type|materializecss:"input-field s12" }}
- </div>
- {% for form_type, form in type_base_forms.items %}
- <div class="row voucher-form" data-type="{{ form_type }}">
- {% for field in form %}
- {{ field|materializecss:"input-field s12" }}
- {% endfor %}
- </div>
- {% endfor %}
- </div>
-
- <div class="col s12 m4">
- <div class="row">
- {{ form.start_date|materializecss:"input-field s12" }}
- </div>
- <div class="row">
- {{ form.end_date|materializecss:"input-field s12" }}
- </div>
- <div class="row">
- {{ form.usage_limit|materializecss }}
- </div>
- </div>
- </div>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" enctype="multipart/form-data" id="form-vouchers" novalidate>
+ <div class="card-content card-content-form">
+ {% csrf_token %}
+ {% if form.non_field_errors %}
+ <blockquote>
+ {% for non_field_error in form.non_field_errors %}
+ {{ non_field_error }}
+ {% endfor %}
+ </blockquote>
+ {% endif %}
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.code|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.name|materializecss }}
+ </div>
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.discount_value|materializecss }}
</div>
-
- <div class="card-action right-align">
- {% if voucher.pk %}
- <a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Voucher form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Voucher form primary action" %}</button>
- {% else %}
- <a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Voucher form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Voucher form primary action" %}</button>
- {% endif %}
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.discount_value_type|materializecss:"input-field s12" }}
</div>
- </form>
+ </div>
+ </div>
+ <div class="row">
+ {{ form.type|materializecss:"input-field s12" }}
+ </div>
+ {% for form_type, form in type_base_forms.items %}
+ <div class="row voucher-form" data-type="{{ form_type }}">
+ {% for field in form %}
+ {{ field|materializecss:"input-field s12" }}
+ {% endfor %}
+ </div>
+ {% endfor %}
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.start_date|materializecss:"input-field s12" }}
+ </div>
+ <div class="row">
+ {{ form.end_date|materializecss:"input-field s12" }}
+ </div>
+ <div class="row">
+ {{ form.usage_limit|materializecss }}
+ </div>
+ </div>
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ </div>
+ <div class="card-action right-align">
+ {% if voucher.pk %}
+ <a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Voucher form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Voucher form primary action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:voucher-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Voucher form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Voucher form primary action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/discount/voucher_list.html b/templates/dashboard/discount/voucher_list.html
index 96fdd66279..b1e9a8a175 100644
--- a/templates/dashboard/discount/voucher_list.html
+++ b/templates/dashboard/discount/voucher_list.html
@@ -3,81 +3,107 @@
{% load prices_i18n %}
{% load materializecss %}
-{% block title %}{% trans "Vouchers" context "Voucher list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Vouchers" context "Voucher list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-vouchers{% endblock %}
{% block menu_vouchers_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Vouchers" context "Voucher list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Vouchers" context "Voucher list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_discounts_class %} active{% endblock %}
{% block content %}
- <div class="card">
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:voucher-add' %}" class="btn-data-table btn-flat" title="{% trans "Add voucher" context "Voucher list add button text" %}">
- {% trans "Add" context "Product form variants tab table action" %}
- </a>
- </div>
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- {% if vouchers %}
- <thead>
- <tr>
- <th class="wide">{% trans "Name" context "Voucher table header" %}</th>
- <th class="right-align">{% trans "Discount" context "Voucher table header" %}</th>
- <th>{% trans "Apply to" context "Voucher table header" %}</th>
- <th>{% trans "Start date" context "Voucher table header" %}</th>
- <th>{% trans "End date" context "Voucher table header" %}</th>
- <th class="right-align">{% trans "Used" context "Voucher table header" %}</th>
- <th class="right-align">{% trans "Limit" context "Voucher table header" %}</th>
- </tr>
- </thead>
- {% for voucher in vouchers %}
- <tbody>
- <tr data-action-go="{% url 'dashboard:voucher-update' pk=voucher.pk %}">
- <td>{{ voucher }}</td>
- <td class="right-align">
- {{ voucher.discount_value }}&nbsp;<span class="currency">{{ voucher.get_discount_value_type_display }}</span>
- </td>
- <td>{{ voucher.get_apply_to_display|default_if_none:"-" }}</td>
- <td>{{ voucher.start_date }}</td>
- <td>{{ voucher.end_date|default_if_none:"-" }}</td>
- <td class="right-align">
- {% if voucher.usage_limit or voucher.usage_limit == 0 %}
- {{ voucher.used }}/{{ voucher.usage_limit }}
- {% else %}
- {{ voucher.used }}
- {% endif %}
- </td>
- <td class="right-align">
- {% if voucher.limit %}
- {% gross voucher.limit html=True %}
- {% else %}
- -
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- {% else %}
- <tbody>
- <tr>
- <td>
- <span>
- {% trans "No vouchers found" context "Empty vouchers table message" %}
- </span>
- </td>
- </tr>
- </tbody>
- {% endif %}
- </table>
- </div>
- </div>
- {% include "dashboard/includes/_pagination.html" %}
+ <div class="card">
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:voucher-add' %}" class="btn-data-table btn-flat" title="{% trans "Add voucher" context "Voucher list add button text" %}">
+ {% trans "Add" context "Product form variants tab table action" %}
+ </a>
+ </div>
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ {% if vouchers %}
+ <thead>
+ <tr>
+ <th class="wide">
+ {% trans "Name" context "Voucher table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Discount" context "Voucher table header" %}
+ </th>
+ <th>
+ {% trans "Apply to" context "Voucher table header" %}
+ </th>
+ <th>
+ {% trans "Start date" context "Voucher table header" %}
+ </th>
+ <th>
+ {% trans "End date" context "Voucher table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Used" context "Voucher table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Limit" context "Voucher table header" %}
+ </th>
+ </tr>
+ </thead>
+ {% for voucher in vouchers %}
+ <tbody>
+ <tr data-action-go="{% url 'dashboard:voucher-update' pk=voucher.pk %}">
+ <td>
+ {{ voucher }}
+ </td>
+ <td class="right-align">
+ {{ voucher.discount_value }}&nbsp;<span class="currency">{{ voucher.get_discount_value_type_display }}</span>
+ </td>
+ <td>
+ {{ voucher.get_apply_to_display|default_if_none:"-" }}
+ </td>
+ <td>
+ {{ voucher.start_date }}
+ </td>
+ <td>
+ {{ voucher.end_date|default_if_none:"-" }}
+ </td>
+ <td class="right-align">
+ {% if voucher.usage_limit or voucher.usage_limit == 0 %}
+ {{ voucher.used }}/{{ voucher.usage_limit }}
+ {% else %}
+ {{ voucher.used }}
+ {% endif %}
+ </td>
+ <td class="right-align">
+ {% if voucher.limit %}
+ {% gross voucher.limit html=True %}
+ {% else %}
+ -
+ {% endif %}
+ </td>
+ </tr>
+ </tbody>
+ {% endfor %}
+ {% else %}
+ <tbody>
+ <tr>
+ <td>
+ <span>
+ {% trans "No vouchers found" context "Empty vouchers table message" %}
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ {% endif %}
+ </table>
+ </div>
+ </div>
+ {% include "dashboard/includes/_pagination.html" %}
{% endblock %}
diff --git a/templates/dashboard/discount/voucher_modal_confirm_delete.html b/templates/dashboard/discount/voucher_modal_confirm_delete.html
index 548e05c52a..abc150c3bb 100644
--- a/templates/dashboard/discount/voucher_modal_confirm_delete.html
+++ b/templates/dashboard/discount/voucher_modal_confirm_delete.html
@@ -1,21 +1,23 @@
{% load i18n %}
<form action="{% url "dashboard:voucher-delete" pk=voucher.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Delete voucher title" %}</h5>
-
- <p>
- {% blocktrans trimmed context "Delete voucher text" %}
- You are about to delete <strong>{{ voucher }}</strong>.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Delete voucher primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Delete voucher secondary action" %}</a>
- </div>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Delete voucher title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Delete voucher text" %}
+ You are about to delete <strong>{{ voucher }}</strong>.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Delete voucher primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Delete voucher secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/includes/_address.html b/templates/dashboard/includes/_address.html
index 7808689498..db7dc7e449 100644
--- a/templates/dashboard/includes/_address.html
+++ b/templates/dashboard/includes/_address.html
@@ -1,7 +1,12 @@
{% load format_address from i18n_address_tags %}
<div class="address">
- <div class="formatted-address">{% format_address address latin=True %}</div>
- {% if address.phone %}
- <div><i class="material-icons">contact_phone</i> <a href="tel:{{ address.phone }}">{{ address.phone }}</a></div>
- {% endif %}
+ <div class="formatted-address">{% format_address address latin=True %}</div>
+ {% if address.phone %}
+ <div>
+ <i class="material-icons">contact_phone</i>
+ <a href="tel:{{ address.phone }}">
+ {{ address.phone }}
+ </a>
+ </div>
+ {% endif %}
</div>
diff --git a/templates/dashboard/includes/_back-link.html b/templates/dashboard/includes/_back-link.html
index 65f8d02f6c..19343615dc 100644
--- a/templates/dashboard/includes/_back-link.html
+++ b/templates/dashboard/includes/_back-link.html
@@ -1 +1,3 @@
-<a href="{{ url }}{% if hash %}{{ hash }}{% endif %}" class="header-button"><i class="material-icons">arrow_back</i></a>
+<a href="{{ url }}{% if hash %}{{ hash }}{% endif %}" class="header-button">
+ <i class="material-icons">arrow_back</i>
+</a>
diff --git a/templates/dashboard/includes/_messages.html b/templates/dashboard/includes/_messages.html
index 8343bf8ee1..a2f3dfbc8f 100644
--- a/templates/dashboard/includes/_messages.html
+++ b/templates/dashboard/includes/_messages.html
@@ -1,23 +1,22 @@
{% if messages %}
-<script>
+ <script>
{% for message in messages %}
- {% if 'safe' in message.tags %}
- Materialize.toast('{{ message|safe|escapejs }}', 5000);
- {% else %}
- Materialize.toast('{{ message|escapejs }}', 5000);
- {% endif %}
+ {% if 'safe' in message.tags %}
+ Materialize.toast('{{ message|safe|escapejs }}', 5000);
+ {% else %}
+ Materialize.toast('{{ message|escapejs }}', 5000);
+ {% endif %}
{% endfor %}
-</script>
+ </script>
{% endif %}
-
{% if form.non_field_errors %}
-<script>
+ <script>
{% for message in form.non_field_errors %}
- {% if 'safe' in message.tags %}
- Materialize.toast('{{ message|safe|escapejs }}', 5000);
- {% else %}
- Materialize.toast('{{ message|escapejs }}', 5000);
- {% endif %}
+ {% if 'safe' in message.tags %}
+ Materialize.toast('{{ message|safe|escapejs }}', 5000);
+ {% else %}
+ Materialize.toast('{{ message|escapejs }}', 5000);
+ {% endif %}
{% endfor %}
-</script>
+ </script>
{% endif %}
diff --git a/templates/dashboard/includes/_orders_table.html b/templates/dashboard/includes/_orders_table.html
index 153cf34291..eae811f4e0 100644
--- a/templates/dashboard/includes/_orders_table.html
+++ b/templates/dashboard/includes/_orders_table.html
@@ -3,29 +3,53 @@
{% load status %}
<div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>#</th>
- <th>{% trans "Order status" context "Orders table header" %}</th>
- <th>{% trans "Payment status" context "Orders table header" %}</th>
- <th>{% trans "Customer" context "Orders table header" %}</th>
- <th>{% trans "Placed on" context "Orders table header" %}</th>
- <th class="right-align">{% trans "Total" context "Orders table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for order in orders %}
- <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
- <td>#{{ order.id }}</td>
- <td>{% render_status order.status order.get_status_display %}</td>
- <td>{% render_status order.get_last_payment_status order.get_last_payment_status_display %}</td>
- {% trans "Guest" context "Customer column anonymous user text" as guest %}
- <td>{{ order.user|default:guest }}</td>
- <td>{{ order.created }}</td>
- <td class="right-align">{% gross order.get_total html=True %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ #
+ </th>
+ <th>
+ {% trans "Order status" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Payment status" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Customer" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Placed on" context "Orders table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Total" context "Orders table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in orders %}
+ <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
+ <td>
+ #{{ order.id }}
+ </td>
+ <td>
+ {% render_status order.status order.get_status_display %}
+ </td>
+ <td>
+ {% render_status order.get_last_payment_status order.get_last_payment_status_display %}
+ </td>
+ {% trans "Guest" context "Customer column anonymous user text" as guest %}
+ <td>
+ {{ order.user|default:guest }}
+ </td>
+ <td>
+ {{ order.created }}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
</div>
diff --git a/templates/dashboard/includes/_pagination.html b/templates/dashboard/includes/_pagination.html
index ef8a1628dd..973ea4ec66 100644
--- a/templates/dashboard/includes/_pagination.html
+++ b/templates/dashboard/includes/_pagination.html
@@ -1,31 +1,34 @@
{% load i18n %}
{% load utils %}
{% if page_obj.paginator.num_pages > 1 %}
- <ul class="pagination">
- <li{% if not page_obj.has_previous %} class="disabled"{% endif %}>
- {% if page_obj.has_previous %}
- <a href="{% construct_get_query page=page_obj.previous_page_number %}">
- <i class="material-icons">chevron_left</i>
- </a>
- {% else %}
- <a href="#!"><i class="material-icons">chevron_left</i></a>
- {% endif %}
- </li>
- {% for page in page_obj.paginator.page_range %}
- <li class="{% if page == page_obj.number %}active{% else %}waves-effect{% endif %}">
- <a href="{% construct_get_query page=page %}">
- {{ page }}
- </a>
- </li>
- {% endfor %}
- <li{% if not page_obj.has_next %} class="disabled"{% endif %}>
- {% if page_obj.has_next %}
- <a href="{% construct_get_query page=page_obj.next_page_number %}">
- <i class="material-icons">chevron_right</i>
- </a>
- {% else %}
- <a href="#!"><i class="material-icons">chevron_right</i></a>
- {% endif %}
- </li>
- </ul>
+ <ul class="pagination">
+ <li
+ {% if not page_obj.has_previous %} class="disabled"{% endif %}>
+ {% if page_obj.has_previous %}
+ <a href="{% construct_get_query page=page_obj.previous_page_number %}">
+ <i class="material-icons">chevron_left</i>
+ </a>
+ {% else %}
+ <a href="#!">
+ <i class="material-icons">chevron_left</i>
+ </a>
+ {% endif %}
+ </li>
+ {% for page in page_obj.paginator.page_range %}
+ <li class="{% if page == page_obj.number %}active{% else %}waves-effect{% endif %}">
+ <a href="{% construct_get_query page=page %}">
+ {{ page }}
+ </a>
+ </li>
+ {% endfor %}
+ <li{% if not page_obj.has_next %} class="disabled"{% endif %}>
+ {% if page_obj.has_next %}
+ <a href="{% construct_get_query page=page_obj.next_page_number %}">
+ <i class="material-icons">chevron_right</i>
+ </a>
+ {% else %}
+ <a href="#!"><i class="material-icons">chevron_right</i></a>
+ {% endif %}
+ </li>
+ </ul>
{% endif %}
diff --git a/templates/dashboard/includes/_status_filters.html b/templates/dashboard/includes/_status_filters.html
index af84cd89ac..eb5cdd25fb 100644
--- a/templates/dashboard/includes/_status_filters.html
+++ b/templates/dashboard/includes/_status_filters.html
@@ -2,18 +2,20 @@
{% load materializecss %}
<div class="card">
- <form method="get" novalidate>
- <div class="card-content">
- <div class="row">
- <div class="col s12 m10">
- <div class="row">
- {{ form|materializecss:"s12" }}
- </div>
- </div>
- <div class="col s12 m2">
- <button type="submit" class="btn btn-flat btn--inline">{% trans "Filter" context "Status filter action" %}</button>
- </div>
- </div>
+ <form method="get" novalidate>
+ <div class="card-content">
+ <div class="row">
+ <div class="col s12 m10">
+ <div class="row">
+ {{ form|materializecss:"s12" }}
+ </div>
</div>
- </form>
+ <div class="col s12 m2">
+ <button type="submit" class="btn btn-flat btn--inline">
+ {% trans "Filter" context "Status filter action" %}
+ </button>
+ </div>
+ </div>
+ </div>
+ </form>
</div>
diff --git a/templates/dashboard/includes/address_short.html b/templates/dashboard/includes/address_short.html
index 2bdaccd393..1c815c8c5b 100644
--- a/templates/dashboard/includes/address_short.html
+++ b/templates/dashboard/includes/address_short.html
@@ -1,11 +1,5 @@
{% load i18n %}
-<span class="address-details"
- data-content="{% if address.company_name %}{{ address.company_name }}<br>{% endif %}
- {{ address.street_address_1 }}<br>
- {% if address.street_address_2 %}
- {{ address.street_address_2 }}<br>
- {% endif %}
- {{ address.postal_code }} {{ address.city }}<br>
- {% if address.country_area %}{{ address.country_area }}, {% endif %}{{ address.get_country_display }}<br>
- {{ address.phone }}"
- data-html="true" title="{{ address.first_name }} {{ address.last_name }}<span class='pull-right'><a href='{% url "dashboard:address-shipping-edit" order_pk=order.pk group_pk=group.pk %}'><i class='glyphicon glyphicon-pencil'></i> {% trans "Edit" context "Address detail action" %}</a></span>">{{ address }}</span>
+ <span class="address-details" data-content="{% if address.company_name %}{{ address.company_name }}<br>{% endif %}
+ {{ address.street_address_1 }}<br>{% if address.street_address_2 %}{{ address.street_address_2 }}<br>{% endif %}{{ address.postal_code }} {{ address.city }}<br>{% if address.country_area %}{{ address.country_area }}, {% endif %}{{ address.get_country_display }}<br>{{ address.phone }}" data-html="true" title="{{ address.first_name }} {{ address.last_name }}<span class='pull-right'><a href='{% url "dashboard:address-shipping-edit" order_pk=order.pk group_pk=group.pk %}'><i class='glyphicon glyphicon-pencil'></i> {% trans "Edit" context "Address detail action" %}</a></span>">
+ {{ address }}
+</span>
diff --git a/templates/dashboard/index.html b/templates/dashboard/index.html
index e01d49f893..bf7963254d 100644
--- a/templates/dashboard/index.html
+++ b/templates/dashboard/index.html
@@ -2,91 +2,124 @@
{% load i18n %}
{% load prices_i18n %}
-{% block title %}{{ block.super }}{% endblock %}
+{% block title %}
+ {{ block.super }}
+{% endblock %}
{% block content %}
-<div class="row">
+ <div class="row">
<div class="col s12">
- <div class="card">
- <div class="data-table-header{% if not preauthorized_payments %} data-table-header--no-data{% endif %}">
- <span class="data-table-title">{% trans "Preauthorized payments" context "Dashboard homepage table title" %}</span>
- </div>
-
- {% if preauthorized_payments %}
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Order" context "Preauthorized payments table header" %}</th>
- <th>{% trans "Date" context "Preauthorized payments table header" %}</th>
- <th>{% trans "Customer" context "Preauthorized payments table header" %}</th>
- <th class="right-align">{% trans "Amount" context "Preauthorized payments table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for payment in preauthorized_payments %}
- <tr data-action-go="{% url "dashboard:order-details" order_pk=payment.order.pk %}">
- <td>{{ payment.order }}</td>
- <td>{{ payment.created }}</td>
- <td>{{ payment.order.user|default:_("Guest") }}</td>
- <td class="right-align">{% gross payment.get_total_price html=True %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% else %}
- <div class="card-content card-content--no-data not-found">
- <p class="grey-text">{% trans "No preauthorized payments." context "Empty Preauthorized payments table message" %}</p>
- </div>
- {% endif %}
+ <div class="card">
+ <div class="data-table-header{% if not preauthorized_payments %} data-table-header--no-data{% endif %}">
+ <span class="data-table-title">
+ {% trans "Preauthorized payments" context "Dashboard homepage table title" %}
+ </span>
</div>
+ {% if preauthorized_payments %}
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Order" context "Preauthorized payments table header" %}
+ </th>
+ <th>
+ {% trans "Date" context "Preauthorized payments table header" %}
+ </th>
+ <th>
+ {% trans "Customer" context "Preauthorized payments table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Amount" context "Preauthorized payments table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for payment in preauthorized_payments %}
+ <tr data-action-go="{% url "dashboard:order-details" order_pk=payment.order.pk %}">
+ <td>
+ {{ payment.order }}
+ </td>
+ <td>
+ {{ payment.created }}
+ </td>
+ <td>
+ {{ payment.order.user|default:_("Guest") }}
+ </td>
+ <td class="right-align">
+ {% gross payment.get_total_price html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% else %}
+ <div class="card-content card-content--no-data not-found">
+ <p class="grey-text">
+ {% trans "No preauthorized payments." context "Empty Preauthorized payments table message" %}
+ </p>
+ </div>
+ {% endif %}
+ </div>
- <div class="card">
- <div class="data-table-header{% if not orders_to_ship %} data-table-header--no-data{% endif %}">
- <span class="data-table-title">
- {% trans "Orders ready for shipment" context "Dashboard homepage table title" %}
- </span>
- </div>
- {% if orders_to_ship %}
- {% include "dashboard/includes/_orders_table.html" with orders=orders_to_ship %}
- {% else %}
- <div class="card-content card-content--no-data not-found ">
- <p class="grey-text">{% trans "No orders are ready for shipment." context "Empty order table message" %}</p>
- </div>
- {% endif %}
+ <div class="card">
+ <div class="data-table-header{% if not orders_to_ship %} data-table-header--no-data{% endif %}">
+ <span class="data-table-title">
+ {% trans "Orders ready for shipment" context "Dashboard homepage table title" %}
+ </span>
</div>
- <div class="card">
- <div class="data-table-header{% if not preauthorized_payments %} data-table-header--no-data{% endif %}">
- <span class="data-table-title">{% trans "Products with low stock" context "Dashboard homepage table title" %}</span>
- </div>
- {% if low_stock %}
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Product name" context "Low stock product list" %}</th>
- <th class="right-align">{% trans "Stock left" context "Low stock product list" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for product in low_stock %}
- <tr data-action-go="{% url "dashboard:product-update" pk=product.pk %}#stock">
- <td>{{ product }}</td>
- <td class="right-align">
- {{ product.total_stock }}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% else %}
- <div class="card-content card-content--no-data not-found">
- <p class="grey-text">{% trans "No products are low in stock." context "Empty low stock table message" %}</p>
- </div>
- {% endif %}
+ {% if orders_to_ship %}
+ {% include "dashboard/includes/_orders_table.html" with orders=orders_to_ship %}
+ {% else %}
+ <div class="card-content card-content--no-data not-found ">
+ <p class="grey-text">
+ {% trans "No orders are ready for shipment." context "Empty order table message" %}
+ </p>
+ </div>
+ {% endif %}
+ </div>
+ <div class="card">
+ <div class="data-table-header{% if not preauthorized_payments %} data-table-header--no-data{% endif %}">
+ <span class="data-table-title">
+ {% trans "Products with low stock" context "Dashboard homepage table title" %}
+ </span>
</div>
+ {% if low_stock %}
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Product name" context "Low stock product list" %}
+ </th>
+ <th class="right-align">
+ {% trans "Stock left" context "Low stock product list" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for product in low_stock %}
+ <tr data-action-go="{% url "dashboard:product-update" pk=product.pk %}#stock">
+ <td>
+ {{ product }}
+ </td>
+ <td class="right-align">
+ {{ product.total_stock }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% else %}
+ <div class="card-content card-content--no-data not-found">
+ <p class="grey-text">
+ {% trans "No products are low in stock." context "Empty low stock table message" %}
+ </p>
+ </div>
+ {% endif %}
+ </div>
</div>
-</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/order/address_form.html b/templates/dashboard/order/address_form.html
index 607e3650f5..0d0549395c 100644
--- a/templates/dashboard/order/address_form.html
+++ b/templates/dashboard/order/address_form.html
@@ -3,55 +3,70 @@
{% load materializecss %}
{% load static %}
-{% block title %}{% trans "Edit address" context "" %} - {% trans "Orders" context "" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Edit address" context "" %} - {% trans "Orders" context "" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-orders{% endblock %}
{% block menu_orders_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:orders" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:orders" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:orders" %}">{% trans "Orders" context "Breadcrumbs" %}</a></li>
- <li class="hide-on-med-and-down"><a href="{% url "dashboard:order-details" order_pk=order.pk %}">#{{ order.pk }}</a></li>
- <li class="back-mobile"><a href="{% url "dashboard:order-details" order_pk=order.pk %}"><i class="material-icons">arrow_back</i></a></li>
- <li>
- <span class="breadcrumbs--ellipsed-item">
- {% if address_type == "shipping" %}
- {% trans "Shipping address" context "" %}
- {% else %}
- {% trans "Billing address" context "" %}
- {% endif %}
- </span>
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:orders" %}">
+ {% trans "Orders" context "Breadcrumbs" %}
+ </a>
+ </li>
+ <li class="hide-on-med-and-down">
+ <a href="{% url "dashboard:order-details" order_pk=order.pk %}">
+ #{{ order.pk }}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:order-details" order_pk=order.pk %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if address_type == "shipping" %}
+ {% trans "Shipping address" context "" %}
+ {% else %}
+ {% trans "Billing address" context "" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 m9">
- <div class="card">
- <form method="post" novalidate>
- <div class="card-content">
- {% csrf_token %}
- <div class="row">
- {{ form|materializecss }}
- </div>
- </div>
- <div class="card-action right-align">
- <a href="{% url "dashboard:order-details" order_pk=order.pk %}" class="btn btn-flat">
- {% trans "Cancel" context "Address form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Address primary action" %}
- </button>
- </div>
- </form>
+ <div class="row">
+ <div class="col s12 m9">
+ <div class="card">
+ <form method="post" novalidate>
+ <div class="card-content">
+ {% csrf_token %}
+ <div class="row">
+ {{ form|materializecss }}
</div>
- </div>
- <div class="col s12 m3"></div>
+ </div>
+ <div class="card-action right-align">
+ <a href="{% url "dashboard:order-details" order_pk=order.pk %}" class="btn btn-flat">
+ {% trans "Cancel" context "Address form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Address primary action" %}
+ </button>
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col s12 m3"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index 24ffbc60eb..7c6f8640c1 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -6,453 +6,534 @@
{% load status %}
{% load discount_amount_for from prices %}
-{% block title %}{{ order }} - {% trans "Orders" context "Order detail page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {{ order }} - {% trans "Orders" context "Order detail page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-orders{% endblock %}
{% block menu_orders_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:orders" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:orders" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block header_extra %}
- {% if order.can_cancel %}
- <a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ {% if order.can_cancel %}
+ <a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
+ <i class="material-icons">more_vert</i>
+ </a>
+ <ul id="context-menu" class="dropdown-content">
+ <li>
+ <a href="#base-modal" data-href="{% url "dashboard:order-cancel" order_pk=order.pk %}"
+ class="modal-trigger-custom">
+ {% trans "Cancel Order" context "Order detail action" %}
</a>
- <ul id="context-menu" class="dropdown-content">
- <li>
- <a href="#base-modal" data-href="{% url "dashboard:order-cancel" order_pk=order.pk %}"
- class="modal-trigger-custom">
- {% trans "Cancel Order" context "Order detail action" %}
- </a>
- </li>
- </ul>
- {% endif %}
+ </li>
+ </ul>
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:orders" %}">{% trans "Orders" context "Order detail breadcrumbs" %}</a></li>
- <li class="back-mobile"><a href="{% url "dashboard:orders" %}"><i class="material-icons">arrow_back</i></a></li>
- <li><span>{{ order }}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:orders" %}">
+ {% trans "Orders" context "Order detail breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:orders" %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span>
+ {{ order }}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- <ul class="tabs" role="tablist">
- <li role="presentation" class="tab col s4">
- <a href="#order-details" role="tab" class="active">
- <span>{% trans "Details" context "Order detail tab" %}</span>
- <i class="material-icons">description</i>
- </a>
- </li>
- <li role="presentation" class="tab col s4">
- <a href="#payment-history" role="tab">
- <span>{% trans "Payments" context "Order detail tab" %}</span>
- <i class="material-icons">payment</i>
- </a>
- </li>
- <li role="presentation" class="tab col s4">
- <a href="#order-history" role="tab">
- <span>{% trans "History" context "Order detail tab" %}</span>
- <i class="material-icons">history</i>
- </a>
- </li>
- </ul>
- </div>
+ <div class="row">
+ <div class="col s12">
+ <ul class="tabs" role="tablist">
+ <li role="presentation" class="tab col s4">
+ <a href="#order-details" role="tab" class="active">
+ <span>
+ {% trans "Details" context "Order detail tab" %}
+ </span>
+ <i class="material-icons">description</i>
+ </a>
+ </li>
+ <li role="presentation" class="tab col s4">
+ <a href="#payment-history" role="tab">
+ <span>
+ {% trans "Payments" context "Order detail tab" %}
+ </span>
+ <i class="material-icons">payment</i>
+ </a>
+ </li>
+ <li role="presentation" class="tab col s4">
+ <a href="#order-history" role="tab">
+ <span>
+ {% trans "History" context "Order detail tab" %}
+ </span>
+ <i class="material-icons">history</i>
+ </a>
+ </li>
+ </ul>
</div>
-
- <div class="row tab-content" id="order-details">
- <div class="col s12 l4 switch-two-columns">
- <div class="card">
- <div class="card-content">
- <span class="card-title">{% trans "Order summary" context "Order summary title" %}</span>
-
- <div class="row">
- <div class="col s12 m4 l12">
- <h6>
- {% trans "Customer" context "Order summary card header" %}
- </h6>
- <p>
- {% if order.user %}
- <a href="{% url "dashboard:customer-details" pk=order.user.pk %}">{{ order.user }}</a>
- {% else %}
- {% trans "Guest" context "Anonymous user account value" %}
- {% endif %}
- </p>
- </div>
- <div class="col s12 m4 l12">
- <h6>
- {% trans "Order status" context "Order summary card header" %}
- </h6>
- <p>
- {% render_status order.status order.get_status_display %}
- </p>
- </div>
- <div class="col s12 m4 l12">
- <h6>
- {% trans "Payment status" context "Order summary card header" %}
- </h6>
- <p>
- {% if payment %}
- {% render_status payment.status payment.get_status_display %}
- {% else %}
- {% trans "N/A" context "Payment status not available" %}
- {% endif %}
- </p>
- </div>
- </div>
- </div>
-
- <div class="data-table-container">
- <table class="data-table bordered highlight">
- <tfoot>
- <tr>
- <td><strong>{% trans "Outstanding balance" context "Order summary card header" %}</strong></td>
- <td class="right-align"><strong>{% gross balance html=True %}</strong></td>
- </tr>
- </tfoot>
- <tbody>
- <tr>
- <td>{% trans "Order total" context "Order summary card header" %}</td>
- <td class="right-align">{% gross order.get_total html=True %}</td>
- </tr>
- <tr>
- <td>{% trans "Preauthorized amount" context "Order summary card header" %}</td>
- <td class="right-align">
- {% if preauthorized %}{% gross preauthorized html=True %}
- {% else %}{% trans "N/A" context "Preauthorized amount not available" %}{% endif %}</td>
- </tr>
- <tr>
- <td>{% trans "Captured amount" context "Order summary card header" %}</td>
- <td class="right-align">{% gross captured html=True %}</td>
- </tr>
- </tbody>
- </table>
- </div>
-
- {% if can_capture or can_refund or can_release %}
- <div class="data-table-action">
- {% if can_capture %}
- <a href="#base-modal" data-href="{% url 'dashboard:capture-payment' order_pk=order.pk payment_pk=payment.pk %}"
- class="btn btn-flat modal-trigger-custom">{% trans "Capture" context "Order summary card action" %}</a>
- {% elif can_refund %}
- <a href="#base-modal" data-href="{% url 'dashboard:refund-payment' order_pk=order.pk payment_pk=payment.pk %}"
- class="btn btn-flat modal-trigger-custom">{% trans "Refund" context "Order summary card action" %}</a>
- {% endif %}
- {% if can_release %}
- <a href="#base-modal" data-href="{% url 'dashboard:release-payment' order_pk=order.pk payment_pk=payment.pk %}"
- class="btn btn-flat modal-trigger-custom">{% trans "Release" context "Order summary card action" %}</a>
- {% endif %}
- </div>
+ </div>
+ <div class="row tab-content" id="order-details">
+ <div class="col s12 l4 switch-two-columns">
+ <div class="card">
+ <div class="card-content">
+ <span class="card-title">
+ {% trans "Order summary" context "Order summary title" %}
+ </span>
+ <div class="row">
+ <div class="col s12 m4 l12">
+ <h6>
+ {% trans "Customer" context "Order summary card header" %}
+ </h6>
+ <p>
+ {% if order.user %}
+ <a href="{% url "dashboard:customer-details" pk=order.user.pk %}">{{ order.user }}</a>
+ {% else %}
+ {% trans "Guest" context "Anonymous user account value" %}
{% endif %}
+ </p>
</div>
-
- {% with order.shipping_address as address %}
- <div class="row">
- {% if address %}
- <div class="col s12 m6 l12">
- <div class="card">
- <div class="card-content">
- <span class="card-title black-text">{% trans "Shipping address" context "Shipping address card title" %}</span>
- {% include 'dashboard/includes/_address.html' with address=address only %}
- </div>
-
- <div class="card-action">
- <a class="btn-flat" href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}">
- {% trans "Edit" context "Shipping address card action" %}
- </a>
- </div>
- </div>
- </div>
- {% endif %}
-
- <div class="col s12 {% if address %}m6{% else %}m12{% endif %} l12">
- <div class="card">
- <div class="card-content">
- {% with order.billing_address as address %}
- <span class="card-title black-text">
- {% trans "Billing address" context "Billing address card title" %}
- </span>
- {% include 'dashboard/includes/_address.html' with address=address only %}
- {% endwith %}
- </div>
- <div class="card-action">
- <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}" class=" btn-flat">
- {% trans "Edit" context "Billing address card action" %}</a>
- </div>
- </div>
- </div>
- </div>
- {% endwith %}
- </div>
-
- <div class="col s12 l8 switch-two-columns">
- {% for group in groups %}
- <div class="card">
- <div class="data-table-header">
- <h5 class="data-table-title">
- {% blocktrans trimmed with shipment=group.id context "Shipment group table title" %}
- Shipment #{{ shipment }}
- {% endblocktrans %}
- </h5>
- {% render_status group.status group.get_status_display %}
- </div>
-
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th class="wide">{% trans "Item" context "Shipment group table header" %}</th>
- <th>{% trans "SKU" context "Shipment group table header" %}</th>
- <th class="right-align">{% trans "Price" context "Shipment group table header" %}</th>
- <th class="right-align">{% trans "Quantity" context "Shipment group table header" %}</th>
- <th class="right-align">{% trans "Total" context "Shipment group table header" %}</th>
- </tr>
- </thead>
-
- <tfoot>
- {% if group.shipping_price.gross or group.is_shipping_required %}
- <tr>
- <td colspan="4">
- {% blocktrans trimmed with group_shipping_method_name=group.shipping_method_name context "Shipment group table item column data" %}
- Shipping ({{ group_shipping_method_name }})
- {% endblocktrans %}
- </td>
- <td class="right-align">
- {% gross group.shipping_price html=True %}
- </td>
- </tr>
- {% endif %}
- </tfoot>
-
- <tbody>
- {% for item in group.items.all %}
- <tr>
- <td>
- {{ item.product_name }}<br>
- </td>
- <td>{{ item.product_sku }}</td>
- <td class="right-align">{% gross item.get_price_per_item html=True %}</td>
- <td class="right-align">
- {% if group.status != 'cancelled' %}
- <a class="dropdown-button" href="#" data-activates="line-actions-{{ item.pk }}" data-constrainwidth="false">
- {{ item.quantity }}
- <i class="material-icons">arrow_drop_down</i>
- </a>
- <ul id="line-actions-{{ item.pk }}" class="dropdown-content">
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:orderline-change-quantity' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom"
- {% if group.status != 'new' %} disabled{% endif %} title="{% trans "Change quantity" context "Shipment group table row action" %}">
- {% trans "Change quantity" context "Shipment group table row action" %}
- </a>
- </li>
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:orderline-split' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom"
- {% if group.status != 'new' %} disabled{% endif %} title="{% trans "Split line" context "Shipment group table row action" %}">
- {% trans "Split order line" context "Shipment group table row action" %}
- </a>
- </li>
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:orderline-cancel' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom"
- title="{% trans "Remove line" context "Shipment group table row action" %}">
- {% trans "Remove line" context "Shipment group table row action" %}
- </a>
- </li>
- </ul>
- {% else %}
- {{ item.quantity }}
- {% endif %}
- </td>
- <td class="right-align">{% gross item.get_total html=True %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
-
- {% if group.can_ship or group.can_cancel %}
- <div class="data-table-action">
- {% if group.can_ship %}
- <a href="#base-modal" data-href="{% url 'dashboard:ship-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="btn btn-flat modal-trigger-custom">
- {% trans "Dispatch" context "Shipment group table action" %}
- </a>
- {% endif %}
-
- {% if group.can_cancel %}
- <a href="#base-modal" data-href="{% url 'dashboard:cancel-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="btn btn-flat modal-trigger-custom"
- title="{% trans "Cancel group" context "Shipment group table action" %}">
- {% trans "Cancel this shipment" context "Shipment group table action" %}
- </a>
- {% endif %}
- </div>
- {% else %}
- {% if group.tracking_number %}
- <div class="card-action">
- {% blocktrans trimmed with tracking=group.tracking_number context "Shipment group table text" %}
- Tracking number: {{ tracking }}
- {% endblocktrans %}
- </div>
- {% endif %}
- {% endif %}
- </div>
- {% endfor %}
-
- <div class="card" id="order-totals">
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <tfoot>
- <tr>
- <td>
- {% trans "Grand total" context "Order totals header" %}
- </td>
- <td>
- {% gross order.get_total html=True %}
- </td>
- </tr>
- </tfoot>
-
- <tbody>
- <tr>
- <td class="wide">
- {% trans "Subtotal" context "Order totals header" %}
- </td>
- <td class="right-align">
- {% gross order.get_subtotal_without_voucher html=True %}
- </td>
- </tr>
- <tr>
- <td>{% trans "Shipping" context "Order totals header" %}</td>
- <td class="right-align">
- {% gross order.get_total_shipping html=True %}
- </td>
- </tr>
- {% if order.discount_amount.gross %}
- <tr>
- <td>
- <a class="dropdown-button" href="#" data-activates="voucher-actions" data-constrainwidth="false">
- {% blocktrans trimmed with voucher=order.discount_name context "Order totals header" %}
- Voucher {{ voucher }}
- {% endblocktrans %}
- <i class="material-icons">arrow_drop_down</i>
- </a>
-
- <ul id="voucher-actions" class="dropdown-content">
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:order-remove-voucher' order_pk=order.pk %}"
- class="modal-trigger-custom"
- title="{% trans "Remove voucher" context "Order totals action" %}">
- {% trans "Remove voucher" context "Order totals action" %}
- </a>
- </li>
- </ul>
- </td>
- <td class="right-align">
- {% gross order.discount|discount_amount_for:order.total html=True %}
- </td>
- </tr>
- {% endif %}
- </tbody>
- </table>
- </div>
+ <div class="col s12 m4 l12">
+ <h6>
+ {% trans "Order status" context "Order summary card header" %}
+ </h6>
+ <p>
+ {% render_status order.status order.get_status_display %}
+ </p>
</div>
-
- <div class="card" id="order-notes">
+ <div class="col s12 m4 l12">
+ <h6>
+ {% trans "Payment status" context "Order summary card header" %}
+ </h6>
+ <p>
+ {% if payment %}
+ {% render_status payment.status payment.get_status_display %}
+ {% else %}
+ {% trans "N/A" context "Payment status not available" %}
+ {% endif %}
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="data-table-container">
+ <table class="data-table bordered highlight">
+ <tfoot>
+ <tr>
+ <td>
+ <strong>
+ {% trans "Outstanding balance" context "Order summary card header" %}
+ </strong>
+ </td>
+ <td class="right-align">
+ <strong>
+ {% gross balance html=True %}
+ </strong>
+ </td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <tr>
+ <td>
+ {% trans "Order total" context "Order summary card header" %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {% trans "Preauthorized amount" context "Order summary card header" %}
+ </td>
+ <td class="right-align">
+ {% if preauthorized %}
+ {% gross preauthorized html=True %}
+ {% else %}
+ {% trans "N/A" context "Preauthorized amount not available" %}
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {% trans "Captured amount" context "Order summary card header" %}
+ </td>
+ <td class="right-align">
+ {% gross captured html=True %}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ {% if can_capture or can_refund or can_release %}
+ <div class="data-table-action">
+ {% if can_capture %}
+ <a href="#base-modal" data-href="{% url 'dashboard:capture-payment' order_pk=order.pk payment_pk=payment.pk %}"
+ class="btn btn-flat modal-trigger-custom">
+ {% trans "Capture" context "Order summary card action" %}
+ </a>
+ {% elif can_refund %}
+ <a href="#base-modal" data-href="{% url 'dashboard:refund-payment' order_pk=order.pk payment_pk=payment.pk %}"
+ class="btn btn-flat modal-trigger-custom">
+ {% trans "Refund" context "Order summary card action" %}
+ </a>
+ {% endif %}
+ {% if can_release %}
+ <a href="#base-modal" data-href="{% url 'dashboard:release-payment' order_pk=order.pk payment_pk=payment.pk %}"
+ class="btn btn-flat modal-trigger-custom">
+ {% trans "Release" context "Order summary card action" %}
+ </a>
+ {% endif %}
+ </div>
+ {% endif %}
+ </div>
+ {% with order.shipping_address as address %}
+ <div class="row">
+ {% if address %}
+ <div class="col s12 m6 l12">
+ <div class="card">
<div class="card-content">
- <span class="card-title black-text">{% trans "Order notes" context "Order notes card title" %}</span>
-
- {% if notes %}
- <ul class="list">
- {% for note in notes %}
- <li class="list-item list-item--spaced">
- <small class="list-item-author">{{ note.user }} - {{ note.date }}</small>
- <p>{{ note.content }}</p>
- </li>
- {% endfor %}
- </ul>
- {% else %}
- <p>{% trans "There are no notes associated with this order." context "Empty order notes card message" %}</p>
- {% endif %}
+ <span class="card-title black-text">
+ {% trans "Shipping address" context "Shipping address card title" %}
+ </span>
+ {% include 'dashboard/includes/_address.html' with address=address only %}
</div>
-
<div class="card-action">
- <a data-href="{% url "dashboard:order-add-note" order_pk=order.pk %}"
- class="modal-trigger-custom btn-flat" href="#base-modal">{% trans "Add note" context "Order notes card action" %}</a>
+ <a class="btn-flat" href="{% url "dashboard:address-edit" order_pk=order.pk address_type="shipping" %}">
+ {% trans "Edit" context "Shipping address card action" %}
+ </a>
</div>
+ </div>
</div>
- </div>
- </div>
-
- <div class="tab-content" id="payment-history">
- {% if all_payments %}
+ {% endif %}
+ <div class="col s12 {% if address %}m6{% else %}m12{% endif %} l12">
<div class="card">
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Transaction ID" context "Payment history table header" %}</th>
- <th>{% trans "Date" context "Payment history table header" %}</th>
- <th>{% trans "Payment status" context "Payment history table header" %}</th>
- <th>{% trans "Fraud status" context "Payment history table header" %}</th>
- <th>{% trans "Amount" context "Payment history table header" %}</th>
- </tr>
- </thead>
-
- <tbody>
- {% for payment in all_payments %}
- <tr>
- <td>
- {% blocktrans trimmed with payment_id=payment.id context "Payment item column data" %}
- #{{ payment_id }}
- {% endblocktrans %}
- </td>
- <td>{{ payment.created }}</td>
- <td>{% render_status payment.status payment.get_status_display %}</td>
- <td>{% render_status payment.fraud_status payment.get_fraud_status_display %}</td>
- <td>{{ payment.total|currencyfmt:payment.currency }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
+ <div class="card-content">
+ {% with order.billing_address as address %}
+ <span class="card-title black-text">
+ {% trans "Billing address" context "Billing address card title" %}
+ </span>
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ {% endwith %}
+ </div>
+ <div class="card-action">
+ <a href="{% url "dashboard:address-edit" order_pk=order.pk address_type="billing" %}" class=" btn-flat">
+ {% trans "Edit" context "Billing address card action" %}</a>
+ </div>
</div>
- {% else %}
- <p>{% trans "No payments made for this order." context "Empty payment history table message" %}</p>
- {% endif %}
+ </div>
+ </div>
+ {% endwith %}
</div>
-
- <div class="card tab-content" id="order-history">
- <div class="data-table-container">
+ <div class="col s12 l8 switch-two-columns">
+ {% for group in groups %}
+ <div class="card">
+ <div class="data-table-header">
+ <h5 class="data-table-title">
+ {% blocktrans trimmed with shipment=group.id context "Shipment group table title" %}
+ Shipment #{{ shipment }}
+ {% endblocktrans %}
+ </h5>
+ {% render_status group.status group.get_status_display %}
+ </div>
+ <div class="data-table-container">
<table class="bordered highlight responsive data-table">
- <thead>
- <tr>
- <th>{% trans "Date" context "Order history table header" %}</th>
- <th>{% trans "Order status" context "Order history table header" %}</th>
- <th>{% trans "User" context "Order history table header" %}</th>
- <th class="wide">{% trans "Comment" context "Order history table header" %}</th>
- </tr>
- </thead>
-
+ <thead>
+ <tr>
+ <th class="wide">
+ {% trans "Item" context "Shipment group table header" %}
+ </th>
+ <th>
+ {% trans "SKU" context "Shipment group table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Price" context "Shipment group table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Quantity" context "Shipment group table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Total" context "Shipment group table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tfoot>
+ {% if group.shipping_price.gross or group.is_shipping_required %}
+ <tr>
+ <td colspan="4">
+ {% blocktrans trimmed with group_shipping_method_name=group.shipping_method_name context "Shipment group table item column data" %}
+ Shipping ({{ group_shipping_method_name }})
+ {% endblocktrans %}
+ </td>
+ <td class="right-align">
+ {% gross group.shipping_price html=True %}
+ </td>
+ </tr>
+ {% endif %}
+ </tfoot>
<tbody>
- {% for event in order.history.all %}
+ {% for item in group.items.all %}
<tr>
- <td>{{ event.date }}</td>
- <td>{% render_status event.status event.get_status_display %}</td>
- <td>
- {% if event.user %}
- {{ event.user }}
- {% endif %}
- </td>
- <td>{{ event.comment|default:"" }}</td>
- </tr>
- {% endfor %}
- </tbody>
+ <td>
+ {{ item.product_name }}<br>
+ </td>
+ <td>
+ {{ item.product_sku }}
+ </td>
+ <td class="right-align">
+ {% gross item.get_price_per_item html=True %}
+ </td>
+ <td class="right-align">
+ {% if group.status != 'cancelled' %}
+ <a class="dropdown-button" href="#" data-activates="line-actions-{{ item.pk }}" data-constrainwidth="false">
+ {{ item.quantity }}
+ <i class="material-icons">arrow_drop_down</i>
+ </a>
+ <ul id="line-actions-{{ item.pk }}" class="dropdown-content">
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:orderline-change-quantity' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom" {% if group.status != 'new' %} disabled{% endif %} title="{% trans "Change quantity" context "Shipment group table row action" %}">
+ {% trans "Change quantity" context "Shipment group table row action" %}
+ </a>
+ </li>
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:orderline-split' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom" {% if group.status != 'new' %} disabled{% endif %} title="{% trans "Split line" context "Shipment group table row action" %}">
+ {% trans "Split order line" context "Shipment group table row action" %}
+ </a>
+ </li>
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:orderline-cancel' order_pk=order.pk line_pk=item.pk %}" class="modal-trigger-custom" title="{% trans "Remove line" context "Shipment group table row action" %}">
+ {% trans "Remove line" context "Shipment group table row action" %}
+ </a>
+ </li>
+ </ul>
+ {% else %}
+ {{ item.quantity }}
+ {% endif %}
+ </td>
+ <td class="right-align">
+ {% gross item.get_total html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
</table>
+ </div>
+ {% if group.can_ship or group.can_cancel %}
+ <div class="data-table-action">
+ {% if group.can_ship %}
+ <a href="#base-modal" data-href="{% url 'dashboard:ship-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="btn btn-flat modal-trigger-custom">
+ {% trans "Dispatch" context "Shipment group table action" %}
+ </a>
+ {% endif %}
+ {% if group.can_cancel %}
+ <a href="#base-modal" data-href="{% url 'dashboard:cancel-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="btn btn-flat modal-trigger-custom" title="{% trans "Cancel group" context "Shipment group table action" %}">
+ {% trans "Cancel this shipment" context "Shipment group table action" %}
+ </a>
+ {% endif %}
+ </div>
+ {% else %}
+ {% if group.tracking_number %}
+ <div class="card-action">
+ {% blocktrans trimmed with tracking=group.tracking_number context "Shipment group table text" %}
+ Tracking number: {{ tracking }}
+ {% endblocktrans %}
+ </div>
+ {% endif %}
+ {% endif %}
</div>
+ {% endfor %}
+ <div class="card" id="order-totals">
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <tfoot>
+ <tr>
+ <td>
+ {% trans "Grand total" context "Order totals header" %}
+ </td>
+ <td>
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <tr>
+ <td class="wide">
+ {% trans "Subtotal" context "Order totals header" %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_subtotal_without_voucher html=True %}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {% trans "Shipping" context "Order totals header" %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total_shipping html=True %}
+ </td>
+ </tr>
+ {% if order.discount_amount.gross %}
+ <tr>
+ <td>
+ <a class="dropdown-button" href="#" data-activates="voucher-actions" data-constrainwidth="false">
+ {% blocktrans trimmed with voucher=order.discount_name context "Order totals header" %}
+ Voucher {{ voucher }}
+ {% endblocktrans %}
+ <i class="material-icons">arrow_drop_down</i>
+ </a>
+ <ul id="voucher-actions" class="dropdown-content">
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:order-remove-voucher' order_pk=order.pk %}"
+ class="modal-trigger-custom" title="{% trans "Remove voucher" context "Order totals action" %}">
+ {% trans "Remove voucher" context "Order totals action" %}
+ </a>
+ </li>
+ </ul>
+ </td>
+ <td class="right-align">
+ {% gross order.discount|discount_amount_for:order.total html=True %}
+ </td>
+ </tr>
+ {% endif %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="card" id="order-notes">
+ <div class="card-content">
+ <span class="card-title black-text">
+ {% trans "Order notes" context "Order notes card title" %}
+ </span>
+ {% if notes %}
+ <ul class="list">
+ {% for note in notes %}
+ <li class="list-item list-item--spaced">
+ <small class="list-item-author">{{ note.user }} - {{ note.date }}</small>
+ <p>{{ note.content }}</p>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p>
+ {% trans "There are no notes associated with this order." context "Empty order notes card message" %}
+ </p>
+ {% endif %}
+ </div>
+ <div class="card-action">
+ <a data-href="{% url "dashboard:order-add-note" order_pk=order.pk %}" class="modal-trigger-custom btn-flat" href="#base-modal">
+ {% trans "Add note" context "Order notes card action" %}
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="tab-content" id="payment-history">
+ {% if all_payments %}
+ <div class="card">
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Transaction ID" context "Payment history table header" %}
+ </th>
+ <th>
+ {% trans "Date" context "Payment history table header" %}
+ </th>
+ <th>
+ {% trans "Payment status" context "Payment history table header" %}
+ </th>
+ <th>
+ {% trans "Fraud status" context "Payment history table header" %}
+ </th>
+ <th>
+ {% trans "Amount" context "Payment history table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for payment in all_payments %}
+ <tr>
+ <td>
+ {% blocktrans trimmed with payment_id=payment.id context "Payment item column data" %}
+ #{{ payment_id }}
+ {% endblocktrans %}
+ </td>
+ <td>
+ {{ payment.created }}
+ </td>
+ <td>
+ {% render_status payment.status payment.get_status_display %}
+ </td>
+ <td>
+ {% render_status payment.fraud_status payment.get_fraud_status_display %}
+ </td>
+ <td>
+ {{ payment.total|currencyfmt:payment.currency }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ {% else %}
+ <p>
+ {% trans "No payments made for this order." context "Empty payment history table message" %}
+ </p>
+ {% endif %}
+ </div>
+ <div class="card tab-content" id="order-history">
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Date" context "Order history table header" %}
+ </th>
+ <th>
+ {% trans "Order status" context "Order history table header" %}
+ </th>
+ <th>
+ {% trans "User" context "Order history table header" %}
+ </th>
+ <th class="wide">
+ {% trans "Comment" context "Order history table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for event in order.history.all %}
+ <tr>
+ <td>
+ {{ event.date }}
+ </td>
+ <td>
+ {% render_status event.status event.get_status_display %}
+ </td>
+ <td>
+ {% if event.user %}
+ {{ event.user }}
+ {% endif %}
+ </td>
+ <td>
+ {{ event.comment|default:"" }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/order/list.html b/templates/dashboard/order/list.html
index 758dcc93ee..7b590aa598 100644
--- a/templates/dashboard/order/list.html
+++ b/templates/dashboard/order/list.html
@@ -10,29 +10,33 @@
{% block menu_orders_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Orders" context "Order list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">{% trans "Orders" context "Order list breadcrumbs" %}</li>
+ </ul>
{% endblock %}
{% block content %}
- {% if orders_all %}
- {% include "dashboard/includes/_status_filters.html" %}
- {% if object_list %}
- <div class="card">
- {% include "dashboard/includes/_orders_table.html" with orders=object_list %}
- </div>
- <div class="row">
- {% include "dashboard/includes/_pagination.html" %}
- </div>
- {% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No orders found." context "Empty order list message" %}</p>
- </div>
- {% endif %}
+ {% if orders_all %}
+ {% include "dashboard/includes/_status_filters.html" %}
+ {% if object_list %}
+ <div class="card">
+ {% include "dashboard/includes/_orders_table.html" with orders=object_list %}
+ </div>
+ <div class="row">
+ {% include "dashboard/includes/_pagination.html" %}
+ </div>
{% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No orders." context "Empty order list message" %}</p>
- </div>
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No orders found." context "Empty order list message" %}
+ </p>
+ </div>
{% endif %}
+ {% else %}
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No orders." context "Empty order list message" %}
+ </p>
+ </div>
+ {% endif %}
{% endblock %}
diff --git a/templates/dashboard/order/modal_add_note.html b/templates/dashboard/order/modal_add_note.html
index eb94f971a9..9e190bdda6 100644
--- a/templates/dashboard/order/modal_add_note.html
+++ b/templates/dashboard/order/modal_add_note.html
@@ -2,20 +2,21 @@
{% load materializecss %}
<form role="form" method="post" action="{% url 'dashboard:order-add-note' order_pk=order.pk %}" class="form-async" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Add note" context "Modal add note title" %}</h5>
-
- <div class="row">
- {{ form|materializecss }}
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Save note" context "Modal add note primary action" %}
- </button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal add note secondary action" %}</a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Add note" context "Modal add note title" %}
+ </h5>
+ <div class="row">
+ {{ form|materializecss }}
</div>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Save note" context "Modal add note primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal add note secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_cancel_delivery_group.html b/templates/dashboard/order/modal_cancel_delivery_group.html
index d8049d0e57..1988d26b2f 100644
--- a/templates/dashboard/order/modal_cancel_delivery_group.html
+++ b/templates/dashboard/order/modal_cancel_delivery_group.html
@@ -2,21 +2,23 @@
{% load materializecss %}
<form id="ship-delivery-group-form" method="post" role="form" action="{% url 'dashboard:cancel-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="form-async" novalidate>
- {% csrf_token %}
-
- <div class="modal-content">
- <h5>{% trans "Cancel delivery group?" context "Modal cancel delivery group title" %}</h5>
- <p>
- {% blocktrans trimmed context "Modal cancel delivery group text" %}
- After this action {{ group }} will be cancelled. Ordered items will be returned to stock.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Cancel this shipment" context "Modal cancel delivery group primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Abort" context "Modal cancel delivery group secondary action" %}</a>
- </div>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Cancel delivery group?" context "Modal cancel delivery group title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Modal cancel delivery group text" %}
+ After this action {{ group }} will be cancelled. Ordered items will be returned to stock.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Cancel this shipment" context "Modal cancel delivery group primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Abort" context "Modal cancel delivery group secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_cancel_line.html b/templates/dashboard/order/modal_cancel_line.html
index ecadab10a3..299c3e0f80 100644
--- a/templates/dashboard/order/modal_cancel_line.html
+++ b/templates/dashboard/order/modal_cancel_line.html
@@ -3,43 +3,64 @@
{% load prices_i18n %}
<form class="form-async" role="form" method="post" action="{% url 'dashboard:orderline-cancel' order_pk=order.pk line_pk=item.pk %}" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Remove order line?" context "Modal remove order line title" %}</h5>
- <p>
- {% blocktrans trimmed with order=order context "Modal remove order line text" %}
- Are you sure you want remove this order line?
- {% endblocktrans %}
- </p>
- {{ form|materializecss }}
- <table>
- <thead>
- <tr>
- <th class="wide">{% trans "Item" context "Modal remove order line table header" %}</th>
- <th>{% trans "SKU" context "Modal remove order line table header" %}</th>
- <th class="right-align">{% trans "Price" context "Modal remove order line table header" %}</th>
- <th class="right-align">{% trans "Quantity" context "Modal remove order line table header" %}</th>
- <th class="right-align">{% trans "Total" context "Modal remove order line table header" %}</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- {{ item.product_name }}<br>
- </td>
- <td>{{ item.product_sku }}</td>
- <td class="right-align">{% gross item.get_price_per_item html=True %}</td>
- <td class="right-align">{{ item.quantity }}</td>
- <td class="right-align">{% gross item.get_total html=True %}</td>
- </tr>
- </tbody>
- </table>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Remove" context "Modal remove order line primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal remove order line secondary action" %}</a>
- </div>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Remove order line?" context "Modal remove order line title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed with order=order context "Modal remove order line text" %}
+ Are you sure you want remove this order line?
+ {% endblocktrans %}
+ </p>
+ {{ form|materializecss }}
+ <table>
+ <thead>
+ <tr>
+ <th class="wide">
+ {% trans "Item" context "Modal remove order line table header" %}
+ </th>
+ <th>
+ {% trans "SKU" context "Modal remove order line table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Price" context "Modal remove order line table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Quantity" context "Modal remove order line table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Total" context "Modal remove order line table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ {{ item.product_name }}<br>
+ </td>
+ <td>
+ {{ item.product_sku }}
+ </td>
+ <td class="right-align">
+ {% gross item.get_price_per_item html=True %}
+ </td>
+ <td class="right-align">
+ {{ item.quantity }}
+ </td>
+ <td class="right-align">
+ {% gross item.get_total html=True %}
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Remove" context "Modal remove order line primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal remove order line secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_cancel_order.html b/templates/dashboard/order/modal_cancel_order.html
index e4c78b63f6..434aced634 100644
--- a/templates/dashboard/order/modal_cancel_order.html
+++ b/templates/dashboard/order/modal_cancel_order.html
@@ -2,20 +2,25 @@
{% load materializecss %}
<div class="modal-content">
- <h5>{% trans "Cancel order?" context "Modal cancel order title" %}</h5>
- <p>
- {% blocktrans trimmed with order=order context "Modal cancel order text" %}
- Are you sure, you want cancel order {{ order }}?
- {% endblocktrans %}</p>
+ <h5>
+ {% trans "Cancel order?" context "Modal cancel order title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed with order=order context "Modal cancel order text" %}
+ Are you sure, you want cancel order {{ order }}?
+ {% endblocktrans %}
+ </p>
</div>
<div class="modal-footer">
- <form id="release-form" method="post" role="form" class="form-async"
- action="{% url 'dashboard:order-cancel' order_pk=order.pk %}" novalidate>
- {% csrf_token %}
- <button type="submit" class="modal-action btn-flat">
- {% trans "Cancel Order" context "Modal cancel order primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Abort" context "Modal cancel order secondary action" %}</a>
- </form>
+ <form id="release-form" method="post" role="form" class="form-async"
+ action="{% url 'dashboard:order-cancel' order_pk=order.pk %}" novalidate>
+ {% csrf_token %}
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Cancel Order" context "Modal cancel order primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Abort" context "Modal cancel order secondary action" %}
+ </a>
+ </form>
</div>
diff --git a/templates/dashboard/order/modal_capture.html b/templates/dashboard/order/modal_capture.html
index 59b84a3cc8..8c6ff85938 100644
--- a/templates/dashboard/order/modal_capture.html
+++ b/templates/dashboard/order/modal_capture.html
@@ -4,31 +4,32 @@
{% load prices_i18n %}
<form role="form" method="post" action="{% url 'dashboard:capture-payment' order_pk=order.pk payment_pk=payment.pk %}" class="form-async" novalidate>
- {% csrf_token %}
-
- <div class="modal-content">
- <h5>{% trans "Capture payment" context "Modal capture payment title" %}</h5>
-
- <div class="row">
- {{ form|materializecss }}
- </div>
-
- <h5>{% trans "Before this action" context "Modal capture payment title" %}</h5>
-
- <ul class="list">
- <li class="list-item">{% trans "Order total:" context "Modal capture payment list title" %}
- {% gross payment.order.get_total html=True %}</li>
- <li class="list-item">{% trans "Captured amount:" context "Modal capture payment list title" %}
- {{ captured|currencyfmt:currency }} </li>
- </ul>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Capture" context "Modal capture payment primary action" %}
- </button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal capture payment secondary action" %}
- </a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Capture payment" context "Modal capture payment title" %}
+ </h5>
+ <div class="row">
+ {{ form|materializecss }}
</div>
+ <h5>
+ {% trans "Before this action" context "Modal capture payment title" %}
+ </h5>
+ <ul class="list">
+ <li class="list-item">{% trans "Order total:" context "Modal capture payment list title" %}
+ {% gross payment.order.get_total html=True %}
+ </li>
+ <li class="list-item">{% trans "Captured amount:" context "Modal capture payment list title" %}
+ {{ captured|currencyfmt:currency }}
+ </li>
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Capture" context "Modal capture payment primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal capture payment secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_change_quantity.html b/templates/dashboard/order/modal_change_quantity.html
index 3723a6e5b0..a938322902 100644
--- a/templates/dashboard/order/modal_change_quantity.html
+++ b/templates/dashboard/order/modal_change_quantity.html
@@ -2,20 +2,21 @@
{% load materializecss %}
<form method="post" role="form" action="{% url 'dashboard:orderline-change-quantity' order_pk=order.pk line_pk=object.pk %}" class="form-async" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Change quantity" context "Modal change quantity title" %}</h5>
-
- <div class="row">
- {{ form|materializecss:"s12 m6" }}
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Update" context "Modal change quantity primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal change quantity secondary action" %}
- </a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Change quantity" context "Modal change quantity title" %}
+ </h5>
+ <div class="row">
+ {{ form|materializecss:"s12 m6" }}
</div>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Update" context "Modal change quantity primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal change quantity secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_order_remove_voucher.html b/templates/dashboard/order/modal_order_remove_voucher.html
index 76b38d25ba..74e850a9e9 100644
--- a/templates/dashboard/order/modal_order_remove_voucher.html
+++ b/templates/dashboard/order/modal_order_remove_voucher.html
@@ -2,22 +2,24 @@
{% load materializecss %}
<div class="modal-content">
- <h5>{% trans "Remove voucher?" context "Modal remove voucher from order title" %}</h5>
- <p>
- {% blocktrans trimmed with order=order context "Modal remove voucher from order text" %}
- Are you sure, you want remove voucher discount from {{ order }}?
- {% endblocktrans %}
- </p>
+ <h5>
+ {% trans "Remove voucher?" context "Modal remove voucher from order title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed with order=order context "Modal remove voucher from order text" %}
+ Are you sure, you want remove voucher discount from {{ order }}?
+ {% endblocktrans %}
+ </p>
</div>
-
<div class="modal-footer">
- <form id="release-form" method="post" role="form" class="form-async"
- action="{% url 'dashboard:order-remove-voucher' order_pk=order.pk %}" novalidate>
- {% csrf_token %}
- <button type="submit" class="modal-action btn-flat">
- {% trans "Remove voucher" context "Modal remove voucher from order primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Abort" context "Modal remove voucher from order secondary action" %}
- </a>
- </form>
+ <form id="release-form" method="post" role="form" class="form-async"
+ action="{% url 'dashboard:order-remove-voucher' order_pk=order.pk %}" novalidate>
+ {% csrf_token %}
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Remove voucher" context "Modal remove voucher from order primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Abort" context "Modal remove voucher from order secondary action" %}
+ </a>
+ </form>
</div>
diff --git a/templates/dashboard/order/modal_refund.html b/templates/dashboard/order/modal_refund.html
index a1f363f672..125b330ee2 100644
--- a/templates/dashboard/order/modal_refund.html
+++ b/templates/dashboard/order/modal_refund.html
@@ -4,33 +4,32 @@
{% load prices_i18n %}
<form role="form" method="post" action="{% url 'dashboard:refund-payment' order_pk=order.pk payment_pk=payment.pk %}" class="form-async" novalidate>
- {% csrf_token %}
-
- <div class="modal-content">
- <h5>{% trans "Refund payment" context "Modal refund payment title" %}</h5>
-
- <div class="row">
- {{ form|materializecss }}
- </div>
-
- <h5>{% trans "Before this action" context "Modal refund payment title" %}</h5>
-
- <ul class="list">
- <li class="list-item">{% trans "Order total:" context "Modal refund payment list title" %}
- {% gross payment.order.get_total html=True %}
- </li>
- <li class="list-item">{% trans "Captured amount:" context "Modal refund payment list title" %}
- {{ captured|currencyfmt:currency }}
- </li>
- </ul>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Refund" context "Modal refund payment primary action" %}
- </button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal refund payment secondary action" %}
- </a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Refund payment" context "Modal refund payment title" %}
+ </h5>
+ <div class="row">
+ {{ form|materializecss }}
</div>
+ <h5>
+ {% trans "Before this action" context "Modal refund payment title" %}
+ </h5>
+ <ul class="list">
+ <li class="list-item">{% trans "Order total:" context "Modal refund payment list title" %}
+ {% gross payment.order.get_total html=True %}
+ </li>
+ <li class="list-item">{% trans "Captured amount:" context "Modal refund payment list title" %}
+ {{ captured|currencyfmt:currency }}
+ </li>
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Refund" context "Modal refund payment primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal refund payment secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_release.html b/templates/dashboard/order/modal_release.html
index 7ebd593d74..429cea1cb5 100644
--- a/templates/dashboard/order/modal_release.html
+++ b/templates/dashboard/order/modal_release.html
@@ -2,21 +2,21 @@
{% load materializecss %}
<div class="modal-content">
- <h5>{% trans "Release payment" context "Modal release payment text" %}</h5>
-
- <p>{% trans "Do you want to release the payment?" context "Modal release payment text" %}</p>
+ <h5>
+ {% trans "Release payment" context "Modal release payment text" %}
+ </h5>
+ <p>
+ {% trans "Do you want to release the payment?" context "Modal release payment text" %}
+ </p>
</div>
-
<div class="modal-footer">
- <form id="release-form" method="post" role="form" class="form-async"
- action="{% url 'dashboard:release-payment' order_pk=order.pk payment_pk=payment.pk %}" novalidate>
- {% csrf_token %}
-
- <button type="submit" class="modal-action btn-flat">
- {% trans "Release" context "Modal release payment primary action" %}
- </button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal release payment secondary action" %}
- </a>
- </form>
+ <form id="release-form" method="post" role="form" class="form-async" action="{% url 'dashboard:release-payment' order_pk=order.pk payment_pk=payment.pk %}" novalidate>
+ {% csrf_token %}
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Release" context "Modal release payment primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal release payment secondary action" %}
+ </a>
+ </form>
</div>
diff --git a/templates/dashboard/order/modal_ship_delivery_group.html b/templates/dashboard/order/modal_ship_delivery_group.html
index 21c5caafe3..d7e10798d4 100644
--- a/templates/dashboard/order/modal_ship_delivery_group.html
+++ b/templates/dashboard/order/modal_ship_delivery_group.html
@@ -2,23 +2,25 @@
{% load materializecss %}
<form id="ship-delivery-group-form" method="post" role="form" action="{% url 'dashboard:ship-delivery-group' order_pk=order.pk group_pk=group.pk %}" class="form-async" novalidate>
- {% csrf_token %}
-
- <div class="modal-content">
- <h5>{% trans "Dispatch delivery group" context "Modal ship delivery group title" %}</h5>
- <p>{% trans "Dispatch this shipment to the following address:" context "Modal ship delivery group text" %}</p>
- {% include 'dashboard/includes/_address.html' with address=group.order.shipping_address only %}
- <div class="row">
- {{ form|materializecss }}
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Ship" context "Modal ship delivery group primary action" %}
- </button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal ship delivery group secondary action" %}
- </a>
+{% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Dispatch delivery group" context "Modal ship delivery group title" %}
+ </h5>
+ <p>
+ {% trans "Dispatch this shipment to the following address:" context "Modal ship delivery group text" %}
+ </p>
+ {% include 'dashboard/includes/_address.html' with address=group.order.shipping_address only %}
+ <div class="row">
+ {{ form|materializecss }}
</div>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Ship" context "Modal ship delivery group primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal ship delivery group secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/order/modal_split_order_line.html b/templates/dashboard/order/modal_split_order_line.html
index e539b9ee09..a71a3a80b8 100644
--- a/templates/dashboard/order/modal_split_order_line.html
+++ b/templates/dashboard/order/modal_split_order_line.html
@@ -1,22 +1,22 @@
{% load i18n %}
{% load materializecss %}
-<form method="post" role="form" class="form-async"
- action="{% url 'dashboard:orderline-split' order_pk=order.pk line_pk=line_pk %}" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Split order line" context "Modal split order line title" %}</h5>
-
- <div class="row">
- {{ form|materializecss:"s12 m6" }}
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Split" context "Modal split order line primary action" %}</button>
- <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal split order line primary action" %}
- </a>
+<form method="post" role="form" class="form-async" action="{% url 'dashboard:orderline-split' order_pk=order.pk line_pk=line_pk %}" novalidate>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Split order line" context "Modal split order line title" %}
+ </h5>
+ <div class="row">
+ {{ form|materializecss:"s12 m6" }}
</div>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Split" context "Modal split order line primary action" %}
+ </button>
+ <a href="#!" aria-hidden="true" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal split order line primary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/product/attributes/confirm_delete.html b/templates/dashboard/product/attributes/confirm_delete.html
index 6a7e33eda3..4755a3b0d8 100644
--- a/templates/dashboard/product/attributes/confirm_delete.html
+++ b/templates/dashboard/product/attributes/confirm_delete.html
@@ -1,36 +1,50 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
-{% block title %}{% trans "Delete attribute" context "Delete attribute page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete attribute" context "Delete attribute page title" %} - {{ block.super }}
+{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
- {% trans "Attributes" context "Delete attribute breadcrumbs" %}
- </a></li>
- <li><span class="breadcrumbs--ellipsed-item">{% trans "Delete attribute" context "Delete attribute breadcrumbs" %}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Attributes" context "Delete attribute breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Delete attribute" context "Delete attribute breadcrumbs" %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <p>{% trans "Are you sure you want to delete the following attribute?" context "Delete attribute text" %}</p>
- <form method="post" novalidate>
- {% csrf_token %}
- <div class="row">
- <ul class="collection">
- <li class="collection-item">
- {{ attribute }}
- </li>
- </ul>
- </div>
+ <p>
+ {% trans "Are you sure you want to delete the following attribute?" context "Delete attribute text" %}
+ </p>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ <ul class="collection">
+ <li class="collection-item">
+ {{ attribute }}
+ </li>
+ </ul>
+ </div>
- <div class="row">
- <div class="col m6 l4 offset-m3 offset-l4 right-align">
- <a href="{% url 'dashboard:product-attributes' %}" class="btn-flat"><i class="material-icons">clear</i>
- {% trans "Cancel" context "Delete attribute secondary action" %}</a>
- <button type="submit" class="btn materialize-red"><i class="material-icons">delete_forever</i>
- {% trans "Delete" context "Delete attribute primary action" %}</button>
- </div>
- </div>
- </form>
+ <div class="row">
+ <div class="col m6 l4 offset-m3 offset-l4 right-align">
+ <a href="{% url 'dashboard:product-attributes' %}" class="btn-flat">
+ <i class="material-icons">clear</i>
+ {% trans "Cancel" context "Delete attribute secondary action" %}
+ </a>
+ <button type="submit" class="btn materialize-red">
+ <i class="material-icons">delete_forever</i>
+ {% trans "Delete" context "Delete attribute primary action" %}
+ </button>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/product/attributes/form.html b/templates/dashboard/product/attributes/form.html
index 9939827fc6..92df1cbf12 100644
--- a/templates/dashboard/product/attributes/form.html
+++ b/templates/dashboard/product/attributes/form.html
@@ -3,108 +3,132 @@
{% load materializecss %}
{% load static %}
-{% block title %}{% if attribute.pk %}{{ attribute }}{% else %}{% trans "Add new attribute" context "Attribute detail page title" %}{% endif %} -
- {% trans "Attributes" context "Attribute detail page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if attribute.pk %}
+ {{ attribute }}
+ {% else %}
+ {% trans "Add new attribute" context "Attribute detail page title" %}
+ {% endif %}
+ - {% trans "Attributes" context "Attribute detail page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-attributes{% endblock %}
{% block menu_attributes_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-attributes" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:product-attributes" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block header_extra %}
- {% if attribute.pk %}
+ {% if attribute.pk %}
<a class="dropdown-button right" href="#" data-activates="attribute-delete" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ <i class="material-icons">more_vert</i>
</a>
<ul id="attribute-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" href="#base-modal"
- data-href="{% url 'dashboard:product-attribute-delete' pk=attribute.pk %}">
- {% trans "Remove attribute" context "Attribute detail action" %}
- </a>
- </li>
+ <li>
+ <a class="modal-trigger-custom" href="#base-modal"
+ data-href="{% url 'dashboard:product-attribute-delete' pk=attribute.pk %}">
+ {% trans "Remove attribute" context "Attribute detail action" %}
+ </a>
+ </li>
</ul>
- {% endif %}
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
- {% trans "Attributes" context "Attribute detail breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:product-attributes' %}"><i class="material-icons">arrow_back</i></a></li>
- <li><span class="breadcrumbs--ellipsed-item">
- {% if attribute.pk %}{{ attribute }}{% else %}{% trans "Add new attribute" context "Attribute detail breadcrumbs" %}{% endif %}
- </span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:product-attributes' %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Attributes" context "Attribute detail breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:product-attributes' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if attribute.pk %}
+ {{ attribute }}
+ {% else %}
+ {% trans "Add new attribute" context "Attribute detail breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" enctype="multipart/form-data" id="form-attributes" novalidate>
- <div class="card-content card-content-form">
- {% csrf_token %}
- <div class="row">
- {{ form.display|materializecss }}
- </div>
- <div class="row">
- {{ form.name|materializecss }}
- </div>
-
- <h5 class="card-title">{% trans "Attribute values" context "Attribute values formset title" %}</h5>
- {{ formset.management_form }}
- {{ formset.non_form_errors.as_ul }}
- </div>
- <div class="formset-table-container">
- <table id="formset" class="formset-table">
- {% for form in formset.forms %}
- {% if forloop.first %}
- <thead>
- <tr>
- {% for field in form.visible_fields %}
- <th>{{ field.label|capfirst }}</th>
- {% endfor %}
- </tr>
- </thead>
- {% endif %}
- <tr>
- {% for field in form.visible_fields %}
- <td{% if forloop.last %} class="center-align"{% endif %}>
- {% if forloop.first %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- {% endif %}
- {{ field|materializecss }}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </table>
- </div>
-
- <div class="card-action right-align">
- {% if attribute.pk %}
- <a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
- {% trans "Cancel" context "Attribute secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Attribute values formset action" %}</button>
- {% else %}
- <a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
- {% trans "Cancel" context "Attribute secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Attribute values formset action" %}</button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" enctype="multipart/form-data" id="form-attributes" novalidate>
+ <div class="card-content card-content-form">
+ {% csrf_token %}
+ <div class="row">
+ {{ form.display|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.name|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ <h5 class="card-title">
+ {% trans "Attribute values" context "Attribute values formset title" %}
+ </h5>
+ {{ formset.management_form }}
+ {{ formset.non_form_errors.as_ul }}
+ </div>
+ <div class="formset-table-container">
+ <table id="formset" class="formset-table">
+ {% for form in formset.forms %}
+ {% if forloop.first %}
+ <thead>
+ <tr>
+ {% for field in form.visible_fields %}
+ <th>{{ field.label|capfirst }}</th>
+ {% endfor %}
+ </tr>
+ </thead>
+ {% endif %}
+ <tr>
+ {% for field in form.visible_fields %}
+ <td{% if forloop.last %} class="center-align"{% endif %}>
+ {% if forloop.first %}
+ {% for hidden in form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+ {% endif %}
+ {{ field|materializecss }}
+ </td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="card-action right-align">
+ {% if attribute.pk %}
+ <a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Attribute secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Attribute values formset action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:product-attributes' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Attribute secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Attribute values formset action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/attributes/list.html b/templates/dashboard/product/attributes/list.html
index 25a7384579..123821253a 100644
--- a/templates/dashboard/product/attributes/list.html
+++ b/templates/dashboard/product/attributes/list.html
@@ -2,47 +2,54 @@
{% load i18n %}
{% load materializecss %}
-{% block title %}{% trans "Attributes" context "Attribute list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Attributes" context "Attribute list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-attributes{% endblock %}
{% block menu_attributes_class %}active{% endblock %}
{% block header_extra %}
- <div class="fixed-action-btn">
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal"
- href="{% url 'dashboard:product-attribute-add' %}" title="{% trans "Add attribute" context "Attribute list add button text" %}">
- <i class="material-icons">add</i>
- </a>
- </div>
+ <div class="fixed-action-btn">
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal" href="{% url 'dashboard:product-attribute-add' %}" title="{% trans "Add attribute" context "Attribute list add button text" %}">
+ <i class="material-icons">add</i>
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Attributes" context "Attribute list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Attributes" context "Attribute list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- {% if attributes %}
- <ul class="collection list">
- {% for pk, display, values in attributes %}
- <li class="collection-item list-item">
- <a class="list-item-name" href="{% url 'dashboard:product-attribute-update' pk=pk %}">{{ display }}</a>
-
- <p class="list-item-desc">
- {% for value in values %}
- {{ value }}{% if not forloop.last %}, {% endif %}
- {% endfor %}
- </p>
- </li>
+ {% if attributes %}
+ <ul class="collection list">
+ {% for pk, display, values in attributes %}
+ <li class="collection-item list-item">
+ <a class="list-item-name" href="{% url 'dashboard:product-attribute-update' pk=pk %}">
+ {{ display }}
+ </a>
+ <p class="list-item-desc">
+ {% for value in values %}
+ {{ value }}
+ {% if not forloop.last %}, {% endif %}
{% endfor %}
- </ul>
- {% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No attributes found." context "Empty attribute list message" %}</p>
- </div>
- {% endif %}
+ </p>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No attributes found." context "Empty attribute list message" %}
+ </p>
+ </div>
+ {% endif %}
{% endblock %}
diff --git a/templates/dashboard/product/attributes/modal_confirm_delete.html b/templates/dashboard/product/attributes/modal_confirm_delete.html
index a1fd4115bd..9a9bf05e0b 100644
--- a/templates/dashboard/product/attributes/modal_confirm_delete.html
+++ b/templates/dashboard/product/attributes/modal_confirm_delete.html
@@ -1,21 +1,23 @@
{% load i18n %}
<form action="{% url "dashboard:product-attribute-delete" pk=attribute.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Modal delete attribute title" %}</h5>
-
- <p>
- {% blocktrans trimmed context "Modal delete attribute text" %}
- You are about to delete an attribute <strong>{{ attribute }}</strong>.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete attribute primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete attribute secondary action" %}</a>
- </div>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete attribute title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Modal delete attribute text" %}
+ You are about to delete an attribute <strong>{{ attribute }}</strong>.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete attribute primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete attribute secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/product/class_list.html b/templates/dashboard/product/class_list.html
index d4f027d467..e1e41f5360 100644
--- a/templates/dashboard/product/class_list.html
+++ b/templates/dashboard/product/class_list.html
@@ -4,74 +4,87 @@
{% load materializecss %}
{% load staticfiles %}
-{% block title %}{% trans "Product types" context "Product type list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Product types" context "Product type list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-products{% endblock %}
{% block menu_product_classes_class %}active{% endblock %}
-
{% block header_extra %}
- <div class="fixed-action-btn">
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal"
- title="{% trans "Add product type" context "Product type list add button text" %}"
- href="{% url 'dashboard:product-class-add' %}">
- <i class="material-icons">add</i>
- </a>
- </div>
+ <div class="fixed-action-btn">
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal" title="{% trans "Add product type" context "Product type list add button text" %}" href="{% url 'dashboard:product-class-add' %}">
+ <i class="material-icons">add</i>
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Product types" context "Product type list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Product types" context "Product type list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- {% if product_classes %}
- <ul class="collection list">
- {% for pk, name, has_variants, product_attributes, variant_attributes in product_classes %}
- <li class="collection-item list-item">
- <a class="title" href="{% url 'dashboard:product-class-update' pk=pk %}">
- <span class="list-item-name">{{ name }}</span>
- </a>
- <p class="list-item-desc">
- {% trans "Variants" context "Product type item list text" %}: {% if has_variants %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}
- {% if variant_attributes %} &middot; {% trans "Variant attributes" context "Product type item list text" %}: {{ variant_attributes|join:", " }}{% endif %}
- {% if product_attributes %} &middot; {% trans "Product attributes" context "Product type item list text" %}: {{ product_attributes|join:", " }}{% endif %}
- </p>
- </li>
- {% endfor %}
- </ul>
- {% include "dashboard/includes/_pagination.html" with page_obj=product_classes %}
- {% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No product types found." context "Empty product type list message" %}</p>
- </div>
- {% endif %}
+ <div class="row">
+ <div class="col s12">
+ {% if product_classes %}
+ <ul class="collection list">
+ {% for pk, name, has_variants, product_attributes, variant_attributes in product_classes %}
+ <li class="collection-item list-item">
+ <a class="title" href="{% url 'dashboard:product-class-update' pk=pk %}">
+ <span class="list-item-name">
+ {{ name }}
+ </span>
+ </a>
+ <p class="list-item-desc">
+ {% trans "Variants" context "Product type item list text" %}:
+ {% if has_variants %}
+ {% trans "Yes" %}
+ {% else %}
+ {% trans "No" %}
+ {% endif %}
+ {% if variant_attributes %}
+ &middot; {% trans "Variant attributes" context "Product type item list text" %}: {{ variant_attributes|join:", " }}
+ {% endif %}
+ {% if product_attributes %}
+ &middot; {% trans "Product attributes" context "Product type item list text" %}: {{ product_attributes|join:", " }}
+ {% endif %}
+ </p>
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "dashboard/includes/_pagination.html" with page_obj=product_classes %}
+ {% else %}
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No product types found." context "Empty product type list message" %}
+ </p>
</div>
+ {% endif %}
</div>
- <Div></Div>
- <div id="modal-product-class" class="modal">
- <div class="modal-content">
- <form method="post" novalidate>
- {% csrf_token %}
- <div class="row">
- {{ form|materializecss }}
- </div>
-
- <div class="row">
- <div class="col s12">
- <button class="btn" type="submit">
- <i class="material-icons left">create</i> {% trans "Create new" context "Modal add product type action" %}
- </button>
- </div>
- </div>
- </form>
+ </div>
+ <div id="modal-product-class" class="modal">
+ <div class="modal-content">
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ {{ form|materializecss }}
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <button class="btn" type="submit">
+ <i class="material-icons left">create</i>
+ {% trans "Create new" context "Modal add product type action" %}
+ </button>
+ </div>
</div>
+ </form>
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/list.html b/templates/dashboard/product/list.html
index 7fa99c348b..009cc66c41 100644
--- a/templates/dashboard/product/list.html
+++ b/templates/dashboard/product/list.html
@@ -4,79 +4,88 @@
{% load materializecss %}
{% load staticfiles %}
-{% block title %}{% trans "Products" context "Product list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Products" context "Product list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-products{% endblock %}
{% block menu_products_class %}active{% endblock %}
{% block header_extra %}
- <div class="fixed-action-btn">
- {% if product_classes %}
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal modal-trigger"
- href="#modal-product-class"
- title="{% trans "Add product" context "Product list add button text" %}">
- <i class="material-icons">add</i>
- </a>
- {% endif %}
- </div>
+ <div class="fixed-action-btn">
+ {% if product_classes %}
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal modal-trigger" href="#modal-product-class" title="{% trans "Add product" context "Product list add button text" %}">
+ <i class="material-icons">add</i>
+ </a>
+ {% endif %}
+ </div>
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Products" context "Product list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Products" context "Product list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- {% if products %}
- <ul class="collection list">
- {% for product in products %}
- <li class="collection-item avatar list-item">
- {% if product.images.exists %}
- <img src="{{ product.images.first.image.crop.100x100 }}" alt="" class="circle teal">
- {% else %}
- <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
- {% endif %}
- <a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">
- <span class="list-item-name">{{ product.name }}</span>
- </a>
- <p class="list-item-price">{% gross product.price html=True %}</p>
- </li>
- {% endfor %}
- </ul>
- {% include "dashboard/includes/_pagination.html" with page_obj=products %}
- {% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No products found." context "Empty product list message" %}</p>
- {% if not product_classes %}
- <p class="grey-text">{% trans "Create product type first." context "Empty product list without product types message" %}</p>
- {% endif %}
- </div>
- {% endif %}
+ <div class="row">
+ <div class="col s12">
+ {% if products %}
+ <ul class="collection list">
+ {% for product in products %}
+ <li class="collection-item avatar list-item">
+ {% if product.images.exists %}
+ <img src="{{ product.images.first.image.crop.100x100 }}" alt="" class="circle teal">
+ {% else %}
+ <img src="{% static 'images/product-image-placeholder-small.png' %}" alt="" class="circle teal">
+ {% endif %}
+ <a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">
+ <span class="list-item-name">
+ {{ product.name }}
+ </span>
+ </a>
+ <p class="list-item-price">
+ {% gross product.price html=True %}
+ </p>
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "dashboard/includes/_pagination.html" with page_obj=products %}
+ {% else %}
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No products found." context "Empty product list message" %}
+ </p>
+ {% if not product_classes %}
+ <p class="grey-text">
+ {% trans "Create product type first." context "Empty product list without product types message" %}
+ </p>
+ {% endif %}
</div>
+ {% endif %}
</div>
- <div id="modal-product-class" class="modal">
- <div class="modal-content">
- <form method="post" novalidate>
- {% csrf_token %}
- <div class="row">
- {{ form|materializecss }}
- </div>
-
- <div class="row">
- <div class="col s12">
- <button class="btn" type="submit">
- <i class="material-icons left">create</i>
- {% trans "Create new" context "Product list choose product type for new product action" %}
- </button>
- </div>
- </div>
- </form>
+ </div>
+ <div id="modal-product-class" class="modal">
+ <div class="modal-content">
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ {{ form|materializecss }}
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <button class="btn" type="submit">
+ <i class="material-icons left">create</i>
+ {% trans "Create new" context "Product list choose product type for new product action" %}
+ </button>
+ </div>
</div>
+ </form>
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/modal_product_class_confirm_delete.html b/templates/dashboard/product/modal_product_class_confirm_delete.html
index c342c61385..7407215cdb 100644
--- a/templates/dashboard/product/modal_product_class_confirm_delete.html
+++ b/templates/dashboard/product/modal_product_class_confirm_delete.html
@@ -2,54 +2,54 @@
{% load prices_i18n %}
{% load staticfiles %}
-
{% if has_products %}
+ <div class="modal-content">
+ <div class="row">
+ <div class="col s12">
+ <h5>
+ {% trans "Error" context "Modal delete product class with products title" %}
+ </h5>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s12 center-align">
+ <p>
+ {% blocktrans trimmed context "Modal delete product class with products text" %}
+ This type is base for created products. Cannot remove it.
+ {% endblocktrans %}
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete product class with products secondary action" %}
+ </a>
+ </div>
+{% else %}
+ <form action="{% url "dashboard:product-class-delete" pk=product_class.pk %}" method="post" novalidate>
+ {% csrf_token %}
<div class="modal-content">
- <div class="row">
- <div class="col s12">
- <h5>{% trans "Error" context "Modal delete product class with products title" %}</h5>
- </div>
- </div>
-
- <div class="row">
- <div class="col s12 center-align">
- <p>
- {% blocktrans trimmed context "Modal delete product class with products text" %}
- This type is base for created products. Cannot remove it.
- {% endblocktrans %}
- </p>
- </div>
+ <div class="row">
+ <div class="col s12">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete product class title" %}
+ </h5>
</div>
+ </div>
+ <p>
+ {% blocktrans trimmed context "Modal delete product class text" %}
+ If you remove <strong>{{ product_class }}</strong> you will lose all data related to this product type.
+ {% endblocktrans %}
+ </p>
</div>
-
<div class="modal-footer">
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete product class with products secondary action" %}
- </a>
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete product class primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete product class secondary action" %}
+ </a>
</div>
-{% else %}
- <form action="{% url "dashboard:product-class-delete" pk=product_class.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <div class="row">
- <div class="col s12">
- <h5>{% trans "Are you sure?" context "Modal delete product class title" %}</h5>
- </div>
- </div>
- <p>
- {% blocktrans trimmed context "Modal delete product class text" %}
- If you remove <strong>{{ product_class }}</strong> you will lose all data related to this product type.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete product class primary action" %}
- </button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete product class secondary action" %}
- </a>
- </div>
- </form>
+ </form>
{% endif %}
diff --git a/templates/dashboard/product/modal_product_confirm_delete.html b/templates/dashboard/product/modal_product_confirm_delete.html
index bdd3a2ca1a..3f75541416 100644
--- a/templates/dashboard/product/modal_product_confirm_delete.html
+++ b/templates/dashboard/product/modal_product_confirm_delete.html
@@ -3,37 +3,36 @@
{% load staticfiles %}
<form action="{% url "dashboard:product-delete" pk=product.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <div class="row">
- <div class="col s12">
- <h5>{% trans "Are you sure?" context "Modal delete product title" %}</h5>
- </div>
- </div>
-
- <div class="row">
- <div class="col s12 center-align">
- {% if product.images.exists %}
- <img src="{{ product.images.first.image.crop.400x400 }}" alt="" class="responsive-img">
- {% else %}
- <img src="{% static 'images/product-image-placeholder.png' %}" alt="" class="responsive-img">
- {% endif %}
- </div>
- </div>
-
- <p>
- {% blocktrans trimmed context "Modal delete product text" %}
- If you remove <strong>{{ product }}</strong> you will lose all data related to this product.
- {% endblocktrans %}
- </p>
+ {% csrf_token %}
+ <div class="modal-content">
+ <div class="row">
+ <div class="col s12">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete product title" %}
+ </h5>
+ </div>
</div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete product primary action" %}
- </button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete product secondary action" %}
- </a>
+ <div class="row">
+ <div class="col s12 center-align">
+ {% if product.images.exists %}
+ <img src="{{ product.images.first.image.crop.400x400 }}" alt="" class="responsive-img">
+ {% else %}
+ <img src="{% static 'images/product-image-placeholder.png' %}" alt="" class="responsive-img">
+ {% endif %}
+ </div>
</div>
+ <p>
+ {% blocktrans trimmed context "Modal delete product text" %}
+ If you remove <strong>{{ product }}</strong> you will lose all data related to this product.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete product primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete product secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/product/modal_product_image_confirm_delete.html b/templates/dashboard/product/modal_product_image_confirm_delete.html
index 956c6045b9..b4a5e831fc 100644
--- a/templates/dashboard/product/modal_product_image_confirm_delete.html
+++ b/templates/dashboard/product/modal_product_image_confirm_delete.html
@@ -1,31 +1,31 @@
{% load i18n %}
<form action="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=product_image.pk %}" method="post" novalidate>
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
-
- <div class="modal-content">
- <div class="row">
- <div class="col s12">
- <h5>{% trans "Are you sure?" context "Modal delete image title" %}</h5>
- </div>
- </div>
-
- <div class="center-align">
- <img class="responsive-img" src="{{ product_image.image.crop.400x400 }}" alt="">
- </div>
-
- <p>
- {% blocktrans trimmed context "Modal delete image text" %}
- You are about to delete this image.
- {% endblocktrans %}
- </p>
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
+ <div class="modal-content">
+ <div class="row">
+ <div class="col s12">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete image title" %}
+ </h5>
+ </div>
</div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete image primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete image secondary action" %}</a>
+ <div class="center-align">
+ <img class="responsive-img" src="{{ product_image.image.crop.400x400 }}" alt="">
</div>
+ <p>
+ {% blocktrans trimmed context "Modal delete image text" %}
+ You are about to delete this image.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete image primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete image secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/product/product_class_form.html b/templates/dashboard/product/product_class_form.html
index 600b280c1f..a794c46bd8 100644
--- a/templates/dashboard/product/product_class_form.html
+++ b/templates/dashboard/product/product_class_form.html
@@ -5,103 +5,121 @@
{% load static %}
{% load attributes %}
-{% block title %}{% if product_class.pk %}{{ product_class }}{% else %}
- {% trans "Add new product type" context "Product class page title" %}{% endif %} - {% trans "Products" context "Product class page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if product_class.pk %}
+ {{ product_class }}
+ {% else %}
+ {% trans "Add new product type" context "Product class page title" %}
+ {% endif %}
+ - {% trans "Products" context "Product class page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-products{% endblock %}
{% block menu_product_classes_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-class-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:product-class-list" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:product-class-list" %}" class="breadcrumb">
- {% trans "Product types" context "Product class breadcrumbs" %}</a></li>
- <li class="back-mobile">
- <a href="{% url "dashboard:product-class-list" %}"><i class="material-icons">arrow_back</i></a></li>
- <li><span class="breadcrumbs--ellipsed-item">
- {% if product_class.pk %}{{ product_class }}{% else %}
- {% trans 'Add new product type' context "Product class breadcrumbs" %}{% endif %}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:product-class-list" %}" class="breadcrumb">
+ {% trans "Product types" context "Product class breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:product-class-list" %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if product_class.pk %}
+ {{ product_class }}
+ {% else %}
+ {% trans 'Add new product type' context "Product class breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
-
{% block header_extra %}
- {% if product_class.pk %}
+ {% if product_class.pk %}
<a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ <i class="material-icons">more_vert</i>
</a>
<ul id="context-menu" class="dropdown-content">
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:product-class-delete' pk=product_class.pk %}"
- class="modal-trigger-custom">
- {% trans "Remove product type" context "Product class action" %}
- </a>
- </li>
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:product-class-delete' pk=product_class.pk %}"
+ class="modal-trigger-custom">
+ {% trans "Remove product type" context "Product class action" %}
+ </a>
+ </li>
</ul>
- {% endif %}
+ {% endif %}
{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" id="form-product" enctype="multipart/form-data" novalidate>
- <div class="card-content card-content-form">
- {% csrf_token %}
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.product_attributes|materializecss:"input-field s12" }}
- </div>
- <div class="row">
- {{ form.variant_attributes|materializecss:"input-field s12" }}
- </div>
- </div>
- <div class="col s12 m4">
- <div class="row">
- {{ form.is_shipping_required|materializecss }}
- </div>
- <div class="row">
- {{ form.has_variants|materializecss }}
- </div>
- </div>
- </div>
- </div>
- <div class="card-action right-align">
- {% if product_class.pk %}
- <a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product class secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Product class primary action" %}
- </button>
- {% else %}
- <a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product class secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Product class primary action" %}
- </button>
- {% endif %}
-
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" id="form-product" enctype="multipart/form-data" novalidate>
+ <div class="card-content card-content-form">
+ {% csrf_token %}
+ <div class="row">
+ {{ form.name|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box">
- <p class="grey-text">
- <i class="material-icons">help</i>
- {% blocktrans trimmed context "Product class help text" %}
- Product Type is a template used for creating new products.
- It also controls which attributes can be used during product creation process.
- {% endblocktrans %}
- </p>
- </div>
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.product_attributes|materializecss:"input-field s12" }}
+ </div>
+ <div class="row">
+ {{ form.variant_attributes|materializecss:"input-field s12" }}
+ </div>
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.is_shipping_required|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.has_variants|materializecss }}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="card-action right-align">
+ {% if product_class.pk %}
+ <a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product class secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Product class primary action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:product-class-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product class secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Product class primary action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
+ </div>
+ <div class="col m12 l3 help-box">
+ <p class="grey-text">
+ <i class="material-icons">help</i>
+ {% blocktrans trimmed context "Product class help text" %}
+ Product Type is a template used for creating new products.
+ It also controls which attributes can be used during product creation process.
+ {% endblocktrans %}
+ </p>
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/product_confirm_delete.html b/templates/dashboard/product/product_confirm_delete.html
index 4115081286..76b47f95be 100644
--- a/templates/dashboard/product/product_confirm_delete.html
+++ b/templates/dashboard/product/product_confirm_delete.html
@@ -3,55 +3,64 @@
{% load prices_i18n %}
{% load staticfiles %}
-{% block title %}{% trans "Delete" context "Product delete page title" %} {{ product }} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete" context "Product delete page title" %} {{ product }} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
- {% trans "Products" context "Product delete breadcrumbs" %}
- </a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- <li>
- <span class="hide-on-med-and-down">
- {% trans "Delete product" context "Product delete breadcrumbs" %}
- </span>
- <span class="hide-on-large-only">
- {% blocktrans trimmed context "Product delete breadcrumbs" %}
- Delete {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Products" context "Product delete breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ <li>
+ <span class="hide-on-med-and-down">
+ {% trans "Delete product" context "Product delete breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only">
+ {% blocktrans trimmed context "Product delete breadcrumbs" %}
+ Delete {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <form method="post" novalidate>
- {% csrf_token %}
- <div class="row">
- <div class="col m6 l4">
- <div class="card">
- <div class="card-content">
- {% if object.images.exists %}
- <img src="{{ product.images.first.image.crop.400x400 }}" alt="" class="responsive-img">
- {% else %}
- <img src="{% static 'images/product-image-placeholder.png' %}" alt="" class="responsive-img">
- {% endif %}
- </div>
-
- <div class="card-action">
- <button type="submit" class="card-link">{% trans "Delete" context "Product delete primary action" %}</button>
- </div>
- </div>
- </div>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <div class="row">
+ <div class="col m6 l4">
+ <div class="card">
+ <div class="card-content">
+ {% if object.images.exists %}
+ <img src="{{ product.images.first.image.crop.400x400 }}" alt="" class="responsive-img">
+ {% else %}
+ <img src="{% static 'images/product-image-placeholder.png' %}" alt="" class="responsive-img">
+ {% endif %}
+ </div>
+ <div class="card-action">
+ <button type="submit" class="card-link">
+ {% trans "Delete" context "Product delete primary action" %}
+ </button>
+ </div>
</div>
- </form>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/product/product_form.html b/templates/dashboard/product/product_form.html
index 495b010000..34a5b146c7 100644
--- a/templates/dashboard/product/product_form.html
+++ b/templates/dashboard/product/product_form.html
@@ -5,427 +5,466 @@
{% load static %}
{% load attributes %}
-{% block title %}{% if product.pk %}{{ product }}{% else %}
- {% trans "Add new product" context "Product form page title" %}{% endif %} -
- {% trans "Products" context "Product form page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if product.pk %}
+ {{ product }}
+ {% else %}
+ {% trans "Add new product" context "Product form page title" %}
+ {% endif %}
+ - {% trans "Products" context "Product form page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-products{% endblock %}
{% block menu_products_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-list" as url %}
- {% include "dashboard/includes/_back-link.html" with url=url %}
+ {% url "dashboard:product-list" as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumb">
- {% trans "Products" context "Product form breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url "dashboard:product-list" %}">
- <i class="material-icons">arrow_back</i>
- </a></li>
- <li><span class="breadcrumbs--ellipsed-item">
- {% if product.pk %}{{ product }}{% else %}{% trans "Add new product" context "Product form breadcrumbs" %}{% endif %}
- </span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumb">
+ {% trans "Products" context "Product form breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:product-list" %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if product.pk %}
+ {{ product }}
+ {% else %}
+ {% trans "Add new product" context "Product form breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block header_extra %}
- {% if product.pk %}
+ {% if product.pk %}
<a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ <i class="material-icons">more_vert</i>
</a>
<ul id="context-menu" class="dropdown-content">
- <li>
- <a href="{{ product.get_absolute_url }}" target="_blank">
- {% trans "View on site" context "Product form action" %}
- </a>
- </li>
- <li>
- <a href="#base-modal" data-href="{% url 'dashboard:product-delete' pk=product.pk %}"
- class="modal-trigger-custom">
- {% trans "Remove product" context "Product form action" %}
- </a>
- </li>
+ <li>
+ <a href="{{ product.get_absolute_url }}" target="_blank">
+ {% trans "View on site" context "Product form action" %}
+ </a>
+ </li>
+ <li>
+ <a href="#base-modal" data-href="{% url 'dashboard:product-delete' pk=product.pk %}"
+ class="modal-trigger-custom">
+ {% trans "Remove product" context "Product form action" %}
+ </a>
+ </li>
</ul>
- {% endif %}
+ {% endif %}
{% endblock %}
-
-
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- {% if product.pk %}
- <div class="row">
- <div class="col s12">
- <ul class="tabs">
- <li class="tab col s3" role="presentation">
- <a href="#details" class="active" role="tab">
- <span>{% trans "Details" context "Product form tab" %}</span>
- <i class="material-icons">edit</i>
- </a>
- </li>
- {% if product.product_class.has_variants %}
- <li class="tab col s3" role="presentation">
- <a href="#variants" role="tab">
- <span>{% trans "Variants" context "Product form tab" %}</span>
- <i class="material-icons">style</i>
- </a>
- </li>
- {% endif %}
- <li class="tab col s3" role="presentation">
- <a href="#stock" role="tab">
- <span>{% trans "Stock" context "Product form tab" %}</span>
- <i class="material-icons">store</i>
- </a>
- </li>
-
- <li class="tab col s3" role="presentation">
- <a href="#images" role="tab">
- <span>{% trans "Images" context "Product form tab" %}</span>
- <i class="material-icons">collections</i>
- </a>
- </li>
- </ul>
+ {% if product.pk %}
+ <div class="row">
+ <div class="col s12">
+ <ul class="tabs">
+ <li class="tab col s3" role="presentation">
+ <a href="#details" class="active" role="tab">
+ <span>
+ {% trans "Details" context "Product form tab" %}
+ </span>
+ <i class="material-icons">edit</i>
+ </a>
+ </li>
+ {% if product.product_class.has_variants %}
+ <li class="tab col s3" role="presentation">
+ <a href="#variants" role="tab">
+ <span>
+ {% trans "Variants" context "Product form tab" %}
+ </span>
+ <i class="material-icons">style</i>
+ </a>
+ </li>
+ {% endif %}
+ <li class="tab col s3" role="presentation">
+ <a href="#stock" role="tab">
+ <span>
+ {% trans "Stock" context "Product form tab" %}
+ </span>
+ <i class="material-icons">store</i>
+ </a>
+ </li>
+ <li class="tab col s3" role="presentation">
+ <a href="#images" role="tab">
+ <span>
+ {% trans "Images" context "Product form tab" %}
+ </span>
+ <i class="material-icons">collections</i>
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+ <div class="tab-content" id="details">
+ <div class="row">
+ <div class="col m12 l9">
+ <form method="post" class="card" id="form-product" enctype="multipart/form-data" novalidate>
+ {% csrf_token %}
+ <div class="card-content">
+ <span class="card-title">
+ {{ product.product_class }}
+ </span>
+ <div class="row">
+ <div class="col s12 l8" >
+ <div class="row">
+ {{ product_form.name|materializecss }}
+ </div>
+ {% for attribute_field in product_form.iter_attribute_fields %}
+ <div class="row">
+ {{ attribute_field|materializecss:"input-field s12" }}
+ </div>
+ {% endfor %}
+ <div class="row">
+ {{ product_form.description|materializecss }}
+ </div>
+ </div>
+ <div class="col s12 l4">
+ <div class="row">
+ {{ product_form.price|materializecss }}
+ </div>
+ {% if not product.product_class.has_variants %}
+ <div class="row">
+ {{ variant_form.sku|materializecss }}
+ </div>
+ {% endif %}
+ <div class="row">
+ {{ product_form.categories|materializecss }}
+ </div>
+ <div class="row">
+ {{ product_form.available_on|materializecss }}
+ </div>
+ <div class="row">
+ {{ product_form.is_featured|materializecss }}
+ </div>
+ </div>
</div>
- </div>
- {% endif %}
+ </div>
+ <div class="card-action right-align">
+ {% if product.pk %}
+ <a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Product form details tab action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Product form details tab action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
+ </div>
+
+ {% if product.pk %}
+ {% if product.product_class.has_variants %}
+ <div id="variants" class="card tab-content">
+ <form method="post" action="{% url 'dashboard:variant-bulk-delete' product_pk=product.pk %}" novalidate>
+ {% csrf_token %}
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:variant-add' product_pk=product.pk %}" class="btn-data-table btn-show-when-unchecked btn-flat">
+ {% trans "Add" context "Product form variants tab table action" %}
+ </a>
+ <a href="#modal-product-variant-delete" class="modal-trigger btn-data-table btn-show-when-checked btn-flat" style="display:none" hidden>
+ {% trans "Delete" context "Product form variants tab table action" %}
+ </a>
- <div class="tab-content" id="details">
- <div class="row">
- <div class="col m12 l9">
- <form method="post" class="card" id="form-product" enctype="multipart/form-data" novalidate>
- {% csrf_token %}
- <div class="card-content">
- <span class="card-title">
- {{ product.product_class }}
+ <div class="modal" id="modal-product-variant-delete">
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete variant from product title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Modal delete variant from product text" %}
+ You are about to delete variants of this product.
+ {% endblocktrans %}
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete variant from product primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete variant from product secondary action" %}
+ </a>
+ </div>
+ </div>
+ </div>
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ {% if variants %}
+ <thead>
+ <tr>
+ <th class="bulk-checkbox">
+ <input type="checkbox" id="select-all-variants" class="filled-in select-all switch-actions">
+ <label for="select-all-variants"></label>
+ </th>
+ <th>
+ {% trans "SKU" context "Product variant table header" %}
+ </th>
+ {% for attribute in attributes %}
+ <th>
+ {{ attribute.display|capfirst }}
+ </th>
+ {% endfor %}
+ <th class="wide">
+ {% trans "Variant name" context "Product variant table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Price" context "Product variant table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for variant in variants %}
+ <tr data-action-go="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}" title="{% trans "Edit variant" context "Product variant table link title" %}">
+ <td class="bulk-checkbox ignore-link">
+ <input id="id_variants_{{ variant.id }}" name="items" type="checkbox" value="{{ variant.id }}" class="filled-in switch-actions">
+ <label for="id_variants_{{ variant.id }}"></label>
+ </td>
+ <td>
+ {{ variant.sku }}
+ </td>
+ {% for attr_display in variant|attributes_values_with_empty:attributes %}
+ <td>
+ {{ attr_display }}
+ </td>
+ {% endfor %}
+ <td>
+ {{ variant.name }}
+ </td>
+ <td class="right-align">
+ {% gross variant.get_price_per_item html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ {% else %}
+ <tbody>
+ <tr>
+ <td>
+ <span>
+ {% trans "There are no variants for this product" context "Empty product variant table message" %}
</span>
- <div class="row">
- <div class="col s12 l8" >
- <div class="row">
- {{ product_form.name|materializecss }}
- </div>
- {% for attribute_field in product_form.iter_attribute_fields %}
- <div class="row">
- {{ attribute_field|materializecss:"input-field s12" }}
- </div>
- {% endfor %}
- <div class="row">
- {{ product_form.description|materializecss }}
- </div>
- </div>
-
- <div class="col s12 l4">
- <div class="row">
- {{ product_form.price|materializecss }}
- </div>
- {% if not product.product_class.has_variants %}
- <div class="row">
- {{ variant_form.sku|materializecss }}
- </div>
- {% endif %}
- <div class="row">
- {{ product_form.categories|materializecss }}
- </div>
- <div class="row">
- {{ product_form.available_on|materializecss }}
- </div>
- <div class="row">
- {{ product_form.is_featured|materializecss }}
- </div>
- </div>
- </div>
- </div>
- <div class="card-action right-align">
- {% if product.pk %}
- <a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Product form details tab action" %}
- </button>
- {% else %}
- <a href="{% url 'dashboard:product-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Product form details tab action" %}
- </button>
- {% endif %}
- </div>
- </form>
+ </td>
+ </tr>
+ </tbody>
+ {% endif %}
+ </table>
+ </div>
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
+ </form>
+ </div>
+ {% endif %}
+ <div id="stock" class="card tab-content">
+ <form method="post" action="{% url 'dashboard:stock-bulk-delete' product_pk=product.pk %}" novalidate>
+ {% csrf_token %}
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:product-stock-add' product_pk=product.pk %}" class="btn-data-table btn-show-when-unchecked btn-flat">
+ {% trans "Add" context "Product form stock tab table action" %}
+ </a>
+ <a href="#modal-product-stock-delete" class="modal-trigger btn-data-table btn-show-when-checked btn-flat" style="display:none" hidden>
+ {% trans "Delete" context "Product form stock tab table action" %}
+ </a>
+ <div class="modal" id="modal-product-stock-delete">
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete stock from variant title" %}
+ </h5>
+ <p>
+ {% blocktrans trimmed context "Modal delete stock from variant text" %}
+ You are about to delete stock for this product variant.
+ {% endblocktrans %}
+ </p>
</div>
- <div class="col m12 l3 help-box"></div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete stock from variant primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete stock from variant secondary action" %}
+ </a>
+ </div>
+ </div>
+ </div>
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ {% if stock_items %}
+ <thead>
+ <tr>
+ <th class="bulk-checkbox">
+ <input type="checkbox" id="select-all-stock" class="filled-in select-all switch-actions">
+ <label for="select-all-stock"></label>
+ </th>
+ <th>
+ {% trans "SKU" context "Stock table header" %}
+ </th>
+ <th class="wide">
+ {% trans "Location" context "Stock table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Quantity" context "Stock table header" %}
+ </th>
+ <th class="right-align">
+ {% trans "Allocated" context "Stock table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in stock_items %}
+ <tr data-action-go="{% url 'dashboard:product-stock-update' product_pk=product.pk stock_pk=item.pk %}" title="{% trans "Edit variant" context "Stock table action" %}">
+ <td class="bulk-checkbox ignore-link">
+ <input name="items" type="checkbox" id="{{ item.id }}" class="filled-in switch-actions" value="{{ item.id }}">
+ <label for="{{ item.id }}"></label>
+ </td>
+ <td>
+ {{ item.variant.sku }}
+ </td>
+ <td>
+ {{ item.location }}
+ </td>
+ <td class="right-align">
+ {{ item.quantity }}
+ </td>
+ <td class="right-align">
+ {{ item.quantity_allocated }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ {% else %}
+ <tbody>
+ <tr>
+ <td>
+ <span>
+ {% trans "There is no stock for this product." context "Empty stock table message" %}
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ {% endif %}
+ </table>
</div>
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
+ </form>
</div>
-
- {% if product.pk %}
- {% if product.product_class.has_variants %}
- <div id="variants" class="card tab-content">
- <form method="post" action="{% url 'dashboard:variant-bulk-delete' product_pk=product.pk %}" novalidate>
- {% csrf_token %}
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:variant-add' product_pk=product.pk %}" class="btn-data-table btn-show-when-unchecked btn-flat">
- {% trans "Add" context "Product form variants tab table action" %}
+ <div id="images" class="tab-content">
+ <form action="{% url 'dashboard:product-images-upload' product_pk=product.pk %}" class="dropzone" id="product-image-form" novalidate>
+ <div class="dz-message"></div>
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
+ <div class="row">
+ {% if images %}
+ <ul class="product-gallery" id="product-gallery" data-post-url="{% url 'dashboard:product-images-reorder' product_pk=product.pk %}">
+ {% for image in images %}
+ <li class="col s6 m3 product-gallery-item" data-id="{{ image.pk }}">
+ <div class="row">
+ <div class="card">
+ <div class="card-image product-gallery-item-image">
+ <img class="responsive-img" src="{{ image.image.crop.400x400 }}" alt="">
+ </div>
+ <div class="card-content">
+ <span class="product-gallery-item-title card-title black-text" title="{{ image.alt }}">
+ {% if image.alt %}
+ {{ image.alt }}
+ {% else %}
+ <span class="grey-text">
+ {% trans "No description" context "Image card text" %}
+ </span>
+ {% endif %}
+ </span>
+ </div>
+ <div class="sortable__drag-area"></div>
+ <div class="card-action">
+ <a href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=image.pk %}">
+ {% trans "Edit" context "Image card action" %}
</a>
-
- <a href="#modal-product-variant-delete" class="modal-trigger btn-data-table btn-show-when-checked btn-flat" style="display:none" hidden>
- {% trans "Delete" context "Product form variants tab table action" %}
+ <a href="#base-modal" class="modal-trigger-custom"
+ data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=image.pk %}">
+ {% trans "Delete" context "Image card action" %}
</a>
-
- <div class="modal" id="modal-product-variant-delete">
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Modal delete variant from product title" %}</h5>
- <p>{% blocktrans trimmed context "Modal delete variant from product text" %}
- You are about to delete variants of this product.
- {% endblocktrans %}</p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete variant from product primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete variant from product secondary action" %}</a>
- </div>
- </div>
- </div>
-
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- {% if variants %}
- <thead>
- <tr>
- <th class="bulk-checkbox">
- <input type="checkbox" id="select-all-variants" class="filled-in select-all switch-actions">
- <label for="select-all-variants"></label>
- </th>
- <th>{% trans "SKU" context "Product variant table header" %}</th>
- {% for attribute in attributes %}
- <th>{{ attribute.display|capfirst }}</th>
- {% endfor %}
- <th class="wide">{% trans "Variant name" context "Product variant table header" %}</th>
- <th class="right-align">{% trans "Price" context "Product variant table header" %}</th>
- </tr>
- </thead>
-
- <tbody>
- {% for variant in variants %}
- <tr data-action-go="{% url 'dashboard:variant-update' product_pk=product.pk variant_pk=variant.pk %}" title="{% trans "Edit variant" context "Product variant table link title" %}">
- <td class="bulk-checkbox ignore-link">
- <input id="id_variants_{{ variant.id }}" name="items" type="checkbox" value="{{ variant.id }}" class="filled-in switch-actions">
- <label for="id_variants_{{ variant.id }}"></label>
- </td>
- <td>
- {{ variant.sku }}
- </td>
- {% for attr_display in variant|attributes_values_with_empty:attributes %}
- <td>
- {{ attr_display }}
- </td>
- {% endfor %}
- <td>{{ variant.name }}</td>
- <td class="right-align">{% gross variant.get_price_per_item html=True %}</td>
- </tr>
- {% endfor %}
- </tbody>
- {% else %}
- <tbody>
- <tr>
- <td>
- <span>
- {% trans "There are no variants for this product" context "Empty product variant table message" %}
- </span>
- </td>
- </tr>
- </tbody>
- {% endif %}
- </table>
- </div>
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
- </form>
- </div>
- {% endif %}
-
- <div id="stock" class="card tab-content">
- <form method="post" action="{% url 'dashboard:stock-bulk-delete' product_pk=product.pk %}" novalidate>
- {% csrf_token %}
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:product-stock-add' product_pk=product.pk %}" class="btn-data-table btn-show-when-unchecked btn-flat">
- {% trans "Add" context "Product form stock tab table action" %}
- </a>
-
- <a href="#modal-product-stock-delete" class="modal-trigger btn-data-table btn-show-when-checked btn-flat" style="display:none" hidden>
- {% trans "Delete" context "Product form stock tab table action" %}
- </a>
-
- <div class="modal" id="modal-product-stock-delete">
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Modal delete stock from variant title" %}</h5>
-
- <p>
- {% blocktrans trimmed context "Modal delete stock from variant text" %}
- You are about to delete stock for this product variant.
- {% endblocktrans %}
- </p>
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete stock from variant primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete stock from variant secondary action" %}</a>
- </div>
- </div>
- </div>
-
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- {% if stock_items %}
- <thead>
- <tr>
- <th class="bulk-checkbox">
- <input type="checkbox" id="select-all-stock" class="filled-in select-all switch-actions">
- <label for="select-all-stock"></label>
- </th>
- <th>{% trans "SKU" context "Stock table header" %}</th>
- <th class="wide">{% trans "Location" context "Stock table header" %}</th>
- <th class="right-align">{% trans "Quantity" context "Stock table header" %}</th>
- <th class="right-align">{% trans "Allocated" context "Stock table header" %}</th>
- </tr>
- </thead>
-
- <tbody>
- {% for item in stock_items %}
- <tr data-action-go="{% url 'dashboard:product-stock-update' product_pk=product.pk stock_pk=item.pk %}" title="{% trans "Edit variant" context "Stock table action" %}">
- <td class="bulk-checkbox ignore-link">
- <input name="items" type="checkbox" id="{{ item.id }}" class="filled-in switch-actions" value="{{ item.id }}">
- <label for="{{ item.id }}"></label>
- </td>
- <td>{{ item.variant.sku }}</td>
- <td>{{ item.location }}</td>
- <td class="right-align">{{ item.quantity }}</td>
- <td class="right-align">{{ item.quantity_allocated }}</td>
- </tr>
- {% endfor %}
- </tbody>
- {% else %}
- <tbody>
- <tr>
- <td>
- <span>{% trans "There is no stock for this product." context "Empty stock table message" %}</span>
- </td>
- </tr>
- </tbody>
- {% endif %}
- </table>
- </div>
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
- </form>
- </div>
-
- <div id="images" class="tab-content">
- <form action="{% url 'dashboard:product-images-upload' product_pk=product.pk %}" class="dropzone" id="product-image-form" novalidate>
- <div class="dz-message"></div>
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
- <div class="row">
- {% if images %}
- <ul class="product-gallery" id="product-gallery" data-post-url="{% url 'dashboard:product-images-reorder' product_pk=product.pk %}">
- {% for image in images %}
- <li class="col s6 m3 product-gallery-item" data-id="{{ image.pk }}">
- <div class="row">
- <div class="card">
- <div class="card-image product-gallery-item-image">
- <img class="responsive-img" src="{{ image.image.crop.400x400 }}" alt="">
- </div>
-
- <div class="card-content">
- <span class="product-gallery-item-title card-title black-text" title="{{ image.alt }}">
- {% if image.alt %}
- {{ image.alt }}
- {% else %}
- <span class="grey-text">{% trans "No description" context "Image card text" %}</span>
- {% endif %}
- </span>
- </div>
-
- <div class="sortable__drag-area"></div>
-
- <div class="card-action">
- <a href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=image.pk %}">
- {% trans "Edit" context "Image card action" %}
- </a>
-
- <a href="#base-modal" class="modal-trigger-custom"
- data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=image.pk %}">
- {% trans "Delete" context "Image card action" %}
- </a>
- </div>
- </div>
- </div>
- </li>
- {% endfor %}
- </ul>
- {% else %}
- <p class="no-images">{% trans "This product has no images yet." context "Empty image gallery message" %}</p>
- {% endif %}
-
- <div class="col s6 m3 product-gallery-item dropzone-message">
- <div class="row">
- <span class="product-gallery-item-title product-gallery-item-title--noclip card-title black-text">
- <span class="grey-text hide-on-med-and-down">
- {% trans "Drop images here to upload" context "Image gallery upload box text" %}
- </span>
- </span>
- </div>
- </div>
- </div>
- </form>
-
- <script type="application/template" id="template">
- <li class="col s6 m3 product-gallery-item dz-preview dz-file-preview" data-id="{{ image.pk }}">
- <div class="row">
- <div class="card">
- <div class="card-image product-gallery-item-image">
- <img data-dz-thumbnail />
- </div>
-
- <div class="dz-progress">
- <span class="dz-upload" data-dz-uploadprogress></span>
- </div>
-
- <div class="card-content">
- <span class="product-gallery-item-title card-title black-text">
- <span class="grey-text">{% trans "No description" context "Empty image gallery message" %}</span>
- </span>
- </div>
-
- <div class="sortable__drag-area"></div>
-
- <div class="card-action">
- <a class="card-action-edit" href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=0 %}">
- {% trans "Edit" context "Image card action" %}
- </a>
-
- <a href="#base-modal" class="card-action-delete modal-trigger-custom"
- data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=0 %}">
- {% trans "Delete" context "Image card action" %}
- </a>
- </div>
- </div>
+ </div>
</div>
+ </div>
</li>
- </script>
- </div>
-
- <div class="fixed-action-btn">
- <a class="btn-fab btn-fab-hidden btn-floating btn-large waves-effect waves-light teal" id="images-btn"
- href="{% url 'dashboard:product-image-add' product_pk=product.pk %}"
- title="{% trans "Add image" context "Add image button text" %}">
- <i class="material-icons">add</i>
- </a>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p class="no-images">
+ {% trans "This product has no images yet." context "Empty image gallery message" %}
+ </p>
+ {% endif %}
+ <div class="col s6 m3 product-gallery-item dropzone-message">
+ <div class="row">
+ <span class="product-gallery-item-title product-gallery-item-title--noclip card-title black-text">
+ <span class="grey-text hide-on-med-and-down">
+ {% trans "Drop images here to upload" context "Image gallery upload box text" %}
+ </span>
+ </span>
+ </div>
</div>
- {% endif %}
-
+ </div>
+ </form>
+ <script type="application/template" id="template">
+ <li class="col s6 m3 product-gallery-item dz-preview dz-file-preview" data-id="{{ image.pk }}">
+ <div class="row">
+ <div class="card">
+ <div class="card-image product-gallery-item-image">
+ <img data-dz-thumbnail />
+ </div>
+ <div class="dz-progress">
+ <span class="dz-upload" data-dz-uploadprogress></span>
+ </div>
+ <div class="card-content">
+ <span class="product-gallery-item-title card-title black-text">
+ <span class="grey-text">
+ {% trans "No description" context "Empty image gallery message" %}
+ </span>
+ </span>
+ </div>
+ <div class="sortable__drag-area"></div>
+ <div class="card-action">
+ <a class="card-action-edit" href="{% url 'dashboard:product-image-update' product_pk=product.pk img_pk=0 %}">
+ {% trans "Edit" context "Image card action" %}
+ </a>
+ <a href="#base-modal" class="card-action-delete modal-trigger-custom"
+ data-href="{% url 'dashboard:product-image-delete' product_pk=product.pk img_pk=0 %}">
+ {% trans "Delete" context "Image card action" %}
+ </a>
+ </div>
+ </div>
+ </div>
+ </li>
+ </script>
+ </div>
+ <div class="fixed-action-btn">
+ <a class="btn-fab btn-fab-hidden btn-floating btn-large waves-effect waves-light teal" id="images-btn" href="{% url 'dashboard:product-image-add' product_pk=product.pk %}" title="{% trans "Add image" context "Add image button text" %}">
+ <i class="material-icons">add</i>
+ </a>
+ </div>
+ {% endif %}
{% endblock %}
diff --git a/templates/dashboard/product/product_image_confirm_delete.html b/templates/dashboard/product/product_image_confirm_delete.html
index 7e91ef2872..0189af4177 100644
--- a/templates/dashboard/product/product_image_confirm_delete.html
+++ b/templates/dashboard/product/product_image_confirm_delete.html
@@ -1,48 +1,65 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
-{% block title %}{% trans "Delete image" context "Delete image page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete image" context "Delete image page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#images" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#images" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
- {% trans "Products" context "Delete image breadcrumbs" %}
- </a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- <li>{% trans "Delete image" context "Delete image breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Products" context "Delete image breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ <li>
+ {% trans "Delete image" context "Delete image breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <form method="post" novalidate>
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
- <div class="row">
- <p>{% trans "Are you sure you want to delete the following image?" context "Delete image text" %}</p>
- <div class="col m6 l4 offset-m3 offset-l4">
- <div class="card">
- <div class="card-content">
- <div class="card-title black-text">{{ product_image.alt }}</div>
- <img src="{{ product_image.image.crop.400x400}}" alt="{{ product_image.alt }}" class="responsive-img">
- </div>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col m6 l4 offset-m3 offset-l4 right-align">
- <a href="{% url 'dashboard:product-update' pk=product.pk %}#images" class="btn-flat"><i class="material-icons">clear</i>
- {% trans "Cancel" context "Delete image text primary action" %}</a>
- <button type="submit" class="btn materialize-red"><i class="material-icons">delete_forever</i>
- {% trans "Delete" context "Delete image secondary action" %}</button>
+ <form method="post" novalidate>
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
+ <div class="row">
+ <p>
+ {% trans "Are you sure you want to delete the following image?" context "Delete image text" %}
+ </p>
+ <div class="col m6 l4 offset-m3 offset-l4">
+ <div class="card">
+ <div class="card-content">
+ <div class="card-title black-text">
+ {{ product_image.alt }}
</div>
+ <img src="{{ product_image.image.crop.400x400}}" alt="{{ product_image.alt }}" class="responsive-img">
+ </div>
</div>
- </form>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col m6 l4 offset-m3 offset-l4 right-align">
+ <a href="{% url 'dashboard:product-update' pk=product.pk %}#images" class="btn-flat">
+ <i class="material-icons">clear</i>
+ {% trans "Cancel" context "Delete image text primary action" %}
+ </a>
+ <button type="submit" class="btn materialize-red">
+ <i class="material-icons">delete_forever</i>
+ {% trans "Delete" context "Delete image secondary action" %}
+ </button>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/product/product_image_form.html b/templates/dashboard/product/product_image_form.html
index d5ff40bb3c..77ea8a4931 100644
--- a/templates/dashboard/product/product_image_form.html
+++ b/templates/dashboard/product/product_image_form.html
@@ -4,11 +4,11 @@
{% load static %}
{% block title %}
- {% if product_image.pk %}
- {{ product_image.image.name }}
- {% else %}
- {% trans "Add image" %}
- {% endif %} - {{ block.super }}
+ {% if product_image.pk %}
+ {{ product_image.image.name }}
+ {% else %}
+ {% trans "Add image" %}
+ {% endif %} - {{ block.super }}
{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
@@ -16,78 +16,96 @@
{% block menu_products_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#images" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#images" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- <li class="back-mobile"><a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="breadcrumb"><i class="material-icons">arrow_back</i></a></li>
- {% if product_image.pk %}
- <li><span class="breadcrumbs--ellipsed-item">{{ product_image.alt|default:_("No description") }}</span></li>
- {% else %}
- <li>
- <span class="hide-on-med-and-down">
- {% trans "Add image" context "Image form breadcrumbs" %}</span>
- <span class="hide-on-large-only breadcrumbs--ellipsed-item">
- {% blocktrans trimmed context "Image form breadcrumbs" %}
- Add image for {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- {% endif %}
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="breadcrumb">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ {% if product_image.pk %}
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {{ product_image.alt|default:_("No description") }}
+ </span>
+ </li>
+ {% else %}
+ <li>
+ <span class="hide-on-med-and-down">
+ {% trans "Add image" context "Image form breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only breadcrumbs--ellipsed-item">
+ {% blocktrans trimmed context "Image form breadcrumbs" %}
+ Add image for {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ {% endif %}
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 m9">
- <div class="card">
- <form method="post" enctype="multipart/form-data">
- <div class="card-content">
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.image|materializecss }}
- </div>
- {% if product_image.pk %}
- <p class="no-margin">
- {% trans "Pick the most relevant part of the image using the red circle." context "Image form text" %}
- </p>
- {% endif %}
- </div>
- <div class="col s12 m4">
- {% if show_variants %}
- <div class="row">
- {{ form.variants|materializecss }}
- </div>
- {% endif %}
- </div>
- </div>
- <div class="row">
- {{ form.alt|materializecss }}
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if product_image.pk %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
- {% trans "Cancel" context "Image form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Image form primary action" %}</button>
- {% else %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
- {% trans "Cancel" context "Image form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Image form secondary action" %}</button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col s12 m9">
+ <div class="card">
+ <form method="post" enctype="multipart/form-data">
+ <div class="card-content">
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#images">
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.image|materializecss }}
+ </div>
+ {% if product_image.pk %}
+ <p class="no-margin">
+ {% trans "Pick the most relevant part of the image using the red circle." context "Image form text" %}
+ </p>
+ {% endif %}
+ </div>
+ <div class="col s12 m4">
+ {% if show_variants %}
+ <div class="row">
+ {{ form.variants|materializecss }}
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ <div class="row">
+ {{ form.alt|materializecss }}
</div>
- </div>
- <div class="col s12 m3 help-box"></div>
+ </div>
+ <div class="card-action right-align">
+ {% if product_image.pk %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
+ {% trans "Cancel" context "Image form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Image form primary action" %}
+ </button>
+ {% else %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#images" class="btn btn-flat">
+ {% trans "Cancel" context "Image form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Image form secondary action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col s12 m3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/product_variant_confirm_delete.html b/templates/dashboard/product/product_variant_confirm_delete.html
index c54323ce1b..ad68c99766 100644
--- a/templates/dashboard/product/product_variant_confirm_delete.html
+++ b/templates/dashboard/product/product_variant_confirm_delete.html
@@ -1,62 +1,74 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
-{% block title %}{% trans "Delete variant" context "Delete variant page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete variant" context "Delete variant page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#variants" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#variants" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
- {% trans "Products" context "Delete variant breadcrumbs" %}
- </a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="breadcrumbs--ellipsed-item">
- {{ product }}
- </a></li>
- <li>
- <span class="hide-on-med-and-down">
- {% trans "Delete variant" context "Delete variant breadcrumbs" %}</span>
- <span class="hide-on-large-only">
- {% blocktrans trimmed context "Delete variant breadcrumbs" %}
- Delete variant for {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Products" context "Delete variant breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ <li>
+ <span class="hide-on-med-and-down">
+ {% trans "Delete variant" context "Delete variant breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only">
+ {% blocktrans trimmed context "Delete variant breadcrumbs" %}
+ Delete variant for {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <form method="post">
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
- <div class="row">
- <div class="col m6 l4">
- <div class="card">
- <div class="card-content">
- {% if is_only_variant %}
- <p>{% blocktrans trimmed context "Delete variant text" %}
- This is the only variant.
- Deleting it will make the product unavailable for your customers.
- {% endblocktrans %}</p>
- {% endif %}
-
- <h5>{{ variant }}{% if variant.name %} {{ variant.name }}{% endif %} </h5>
- </div>
-
- <div class="card-action">
- <button type="submit" class="card-link btn btn-flat">
- {% trans "Delete" context "Delete variant action" %}
- </button>
- </div>
- </div>
- </div>
+ <form method="post">
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
+ <div class="row">
+ <div class="col m6 l4">
+ <div class="card">
+ <div class="card-content">
+ {% if is_only_variant %}
+ <p>
+ {% blocktrans trimmed context "Delete variant text" %}
+ This is the only variant.
+ Deleting it will make the product unavailable for your customers.
+ {% endblocktrans %}
+ </p>
+ {% endif %}
+ <h5>
+ {{ variant }}
+ {% if variant.name %}
+ {{ variant.name }}
+ {% endif %}
+ </h5>
+ </div>
+ <div class="card-action">
+ <button type="submit" class="card-link btn btn-flat">
+ {% trans "Delete" context "Delete variant action" %}
+ </button>
+ </div>
</div>
- </form>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/product/stock_confirm_delete.html b/templates/dashboard/product/stock_confirm_delete.html
index f937eabc99..5a46c9564a 100644
--- a/templates/dashboard/product/stock_confirm_delete.html
+++ b/templates/dashboard/product/stock_confirm_delete.html
@@ -1,55 +1,63 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
-{% block title %}{% trans "Delete stock" context "Delete stock page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Delete stock" context "Delete stock page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#stock" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#stock" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
- {% trans "Products" context "Delete stock breadcrumbs" %}
- </a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- <li>
- <span class="hide-on-med-and-down">
- {% trans "Delete stock" context "Delete stock breadcrumbs" %}</span>
- <span class="hide-on-large-only">
- {% blocktrans trimmed context "Delete stock breadcrumbs" %}
- Delete stock for {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Products" context "Delete stock breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ <li>
+ <span class="hide-on-med-and-down">
+ {% trans "Delete stock" context "Delete stock breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only">
+ {% blocktrans trimmed context "Delete stock breadcrumbs" %}
+ Delete stock for {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <form method="post">
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
- <div class="row">
- <div class="col m6 l4">
- <div class="card">
- <div class="card-content">
- <h5>
- {{ stock.variant.sku }} ({{ stock.variant.name }}) &ndash; {{ stock.location }}
- </h5>
- </div>
-
- <div class="card-action">
- <button type="submit" class="card-link btn btn-flat">
- {% trans "Delete" context "Delete stock action" %}
- </button>
- </div>
- </div>
- </div>
+ <form method="post">
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
+ <div class="row">
+ <div class="col m6 l4">
+ <div class="card">
+ <div class="card-content">
+ <h5>
+ {{ stock.variant.sku }} ({{ stock.variant.name }}) &ndash; {{ stock.location }}
+ </h5>
+ </div>
+ <div class="card-action">
+ <button type="submit" class="card-link btn btn-flat">
+ {% trans "Delete" context "Delete stock action" %}
+ </button>
+ </div>
</div>
- </form>
+ </div>
+ </div>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/product/stock_form.html b/templates/dashboard/product/stock_form.html
index 224d58134b..c1af97e614 100644
--- a/templates/dashboard/product/stock_form.html
+++ b/templates/dashboard/product/stock_form.html
@@ -4,13 +4,14 @@
{% load static %}
{% block title %}
- {% if stock.pk %}
- {% blocktrans trimmed with variant_name=stock.variant.name location=stock.location context "Stock form page title" %}
- Stock {{ variant_name }} - {{ location }}
- {% endblocktrans %}
- {% else %}
- {% trans "Add stock" context "Stock form page title" %}
- {% endif %} - {{ block.super }}
+ {% if stock.pk %}
+ {% blocktrans trimmed with variant_name=stock.variant.name location=stock.location context "Stock form page title" %}
+ Stock {{ variant_name }} - {{ location }}
+ {% endblocktrans %}
+ {% else %}
+ {% trans "Add stock" context "Stock form page title" %}
+ {% endif %}
+ - {{ block.super }}
{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
@@ -18,86 +19,99 @@
{% block menu_products_class %}active{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#stock" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#stock" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumb">
- {% trans "Products" context "Stock form breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url "dashboard:product-update" pk=product.pk %}#stock"><i class="material-icons">chevron_left</i></a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- {% if stock.pk %}
- <li><span class="breadcrumbs--ellipsed-item">
- {% blocktrans trimmed with variant=stock.variant context "Stock form breadcrumbs" %}
- Stock {{ variant }}
- {% endblocktrans %}
- </span></li>
- {% else %}
- <li>
- <span class="hide-on-med-and-down breadcrumbs--ellipsed-item">
- {% trans "Add stock" context "Stock form breadcrumbs" %}
- </span>
- <span class="hide-on-large-only breadcrumbs--ellipsed-item">
- {% blocktrans trimmed context "Stock form breadcrumbs" %}
- Add stock for {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- {% endif %}
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumb">
+ {% trans "Products" context "Stock form breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#stock">
+ <i class="material-icons">chevron_left</i>
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ {% if stock.pk %}
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% blocktrans trimmed with variant=stock.variant context "Stock form breadcrumbs" %}
+ Stock {{ variant }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ {% else %}
+ <li>
+ <span class="hide-on-med-and-down breadcrumbs--ellipsed-item">
+ {% trans "Add stock" context "Stock form breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only breadcrumbs--ellipsed-item">
+ {% blocktrans trimmed context "Stock form breadcrumbs" %}
+ Add stock for {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ {% endif %}
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 m9">
- <div class="card">
- <form method="post" id="form-stock" enctype="multipart/form-data">
- <div class="card-content">
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.variant|materializecss }}
- </div>
- <div class="row">
- {{ form.location|materializecss }}
- </div>
- </div>
- <div class="col s12 m4">
- <div class="row">
- {{ form.quantity|materializecss }}
- </div>
- <div class="row">
- {{ form.cost_price|materializecss }}
- </div>
- </div>
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if stock.pk %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
- {% trans "Cancel" context "Stock form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Stock form action" %}
- </button>
- {% else %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
- {% trans "Cancel" context "Stock form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Stock form action" %}
- </button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col s12 m9">
+ <div class="card">
+ <form method="post" id="form-stock" enctype="multipart/form-data">
+ <div class="card-content">
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#stock">
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.variant|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.location|materializecss }}
+ </div>
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.quantity|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.cost_price|materializecss }}
+ </div>
+ </div>
</div>
- </div>
- <div class="col s12 m3 help-box"></div>
+ </div>
+ <div class="card-action right-align">
+ {% if stock.pk %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
+ {% trans "Cancel" context "Stock form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Stock form action" %}
+ </button>
+ {% else %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#stock" class="btn btn-flat">
+ {% trans "Cancel" context "Stock form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Stock form action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col s12 m3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/stock_locations/form.html b/templates/dashboard/product/stock_locations/form.html
index cad79002cf..a6e522ab76 100644
--- a/templates/dashboard/product/stock_locations/form.html
+++ b/templates/dashboard/product/stock_locations/form.html
@@ -4,73 +4,90 @@
{% load materializecss %}
{% load static %}
-{% block title %}{% if location.pk %}{{ location }}{% else %}
- {% trans "Add new stock location" context "Stock location page title" %}{% endif %} -
- {% trans "Stock location" context "Stock location page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if location.pk %}
+ {{ location }}
+ {% else %}
+ {% trans "Add new stock location" context "Stock location page title" %}
+ {% endif %}
+ - {% trans "Stock location" context "Stock location page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-locations{% endblock %}
{% block header_extra %}
- {% if location.pk %}
+ {% if location.pk %}
<a class="dropdown-button right" href="#" data-activates="attribute-delete" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ <i class="material-icons">more_vert</i>
</a>
<ul id="attribute-delete" class="dropdown-content">
- <li>
- <a class="modal-trigger-custom" href="#base-modal"
- data-href="{% url 'dashboard:product-stock-location-delete' location.pk %}">
- {% trans "Remove location" context "Stock location detail action" %}
- </a>
- </li>
+ <li>
+ <a class="modal-trigger-custom" href="#base-modal"
+ data-href="{% url 'dashboard:product-stock-location-delete' location.pk %}">
+ {% trans "Remove location" context "Stock location detail action" %}
+ </a>
+ </li>
</ul>
- {% endif %}
+ {% endif %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:product-stock-location-list' %}" class="breadcrumbs--ellipsed-item">
- {% trans "Stock location" context "Stock location detail breadcrumbs" %}</a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:sale-list' %}"><i class="material-icons">arrow_back</i></a></li>
- <li><span class="breadcrumbs--ellipsed-item">
- {% if location.pk %}{{ location }}{% else %}
- {% trans "Add new stock location" context "Stock location detail breadcrumbs" %}{% endif %}</span></li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:product-stock-location-list' %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Stock location" context "Stock location detail breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:sale-list' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% if location.pk %}
+ {{ location }}
+ {% else %}
+ {% trans "Add new stock location" context "Stock location detail breadcrumbs" %}
+ {% endif %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_location_class %} active{% endblock %}
-
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" id="form-product" novalidate>
- <div class="card-content card-content-form">
- {% csrf_token %}
-
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if location.pk %}
- <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product stock location secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Stock location detail action" %}
- </button>
- {% else %}
- <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
- {% trans "Cancel" context "Product stock location secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Stock location detail action" %}
- </button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" id="form-product" novalidate>
+ <div class="card-content card-content-form">
+ {% csrf_token %}
+ <div class="row">
+ {{ form.name|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ </div>
+ <div class="card-action right-align">
+ {% if location.pk %}
+ <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product stock location secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Stock location detail action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:product-stock-location-list' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Product stock location secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Stock location detail action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/stock_locations/list.html b/templates/dashboard/product/stock_locations/list.html
index 568c056830..26bd166d40 100644
--- a/templates/dashboard/product/stock_locations/list.html
+++ b/templates/dashboard/product/stock_locations/list.html
@@ -3,49 +3,52 @@
{% load materializecss %}
{% load staticfiles %}
-{% block title %}{% trans "Stock locations" context "Stock location list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Stock locations" context "Stock location list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-locations{% endblock %}
{% block header_extra %}
- <div class="fixed-action-btn">
- <a class="btn-fab btn-floating btn-large waves-effect waves-light teal"
- href="{% url 'dashboard:product-stock-location-add' %}"
- title="{% trans "Add stock location" context "Stock location list add button text" %}">
- <i class="material-icons">add</i>
- </a>
- </div>
+ <div class="fixed-action-btn">
+ <a class="btn-fab btn-floating btn-large waves-effect waves-light teal" href="{% url 'dashboard:product-stock-location-add' %}" title="{% trans "Add stock location" context "Stock location list add button text" %}">
+ <i class="material-icons">add</i>
+ </a>
+ </div>
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Stock locations" context "Stock location list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Stock locations" context "Stock location list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block menu_location_class %} active{% endblock %}
-
{% block content %}
- <div class="row">
- <div class="col s12">
- {% if locations %}
- <ul class="collection list">
- {% for location in locations %}
- <li class="collection-item list-item">
- <p class="list-item-name--single">
- <a href="{% url 'dashboard:product-stock-location-edit' location.pk %}">
- {{ location }}
- </a>
- </p>
- </li>
- {% endfor %}
- </ul>
- {% else %}
- <div class="not-found">
- <p class="grey-text">{% trans "No locations found." context "Empty stock location list message" %}</p>
- </div>
- {% endif %}
+ <div class="row">
+ <div class="col s12">
+ {% if locations %}
+ <ul class="collection list">
+ {% for location in locations %}
+ <li class="collection-item list-item">
+ <p class="list-item-name--single">
+ <a href="{% url 'dashboard:product-stock-location-edit' location.pk %}">
+ {{ location }}
+ </a>
+ </p>
+ </li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <div class="not-found">
+ <p class="grey-text">
+ {% trans "No locations found." context "Empty stock location list message" %}
+ </p>
</div>
+ {% endif %}
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/product/stock_locations/modal_confirm_delete.html b/templates/dashboard/product/stock_locations/modal_confirm_delete.html
index e341e1697b..a455f44490 100644
--- a/templates/dashboard/product/stock_locations/modal_confirm_delete.html
+++ b/templates/dashboard/product/stock_locations/modal_confirm_delete.html
@@ -1,32 +1,32 @@
{% load i18n %}
<form action="{% url 'dashboard:product-stock-location-delete' location.pk %}" method="post" novalidate>
- {% csrf_token %}
- <div class="modal-content">
- <h5>{% trans "Are you sure?" context "Modal delete stock location text" %}</h5>
-
- <div class="row">
- <div class="col l12">
- {% blocktrans trimmed context "Modal delete stock location text" %}
- You are about to delete a stock location <strong>{{ location }}</strong>.
- {% endblocktrans %}
- </div>
- </div>
-
- {% if stock_count %}
- {% blocktrans trimmed count counter=stock_count context "Modal delete stock location text" %}
- There is one stock associated with this stock location that will be deleted.
- {% plural %}
- There are {{ counter }} stocks associated with this stock location that will be deleted.
- {% endblocktrans %}
- {% endif %}
- </div>
-
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Modal delete stock location primary action" %}</button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Modal delete stock location secondary action" %}
- </a>
+ {% csrf_token %}
+ <div class="modal-content">
+ <h5>
+ {% trans "Are you sure?" context "Modal delete stock location text" %}
+ </h5>
+ <div class="row">
+ <div class="col l12">
+ {% blocktrans trimmed context "Modal delete stock location text" %}
+ You are about to delete a stock location <strong>{{ location }}</strong>.
+ {% endblocktrans %}
+ </div>
</div>
+ {% if stock_count %}
+ {% blocktrans trimmed count counter=stock_count context "Modal delete stock location text" %}
+ There is one stock associated with this stock location that will be deleted.
+ {% plural %}
+ There are {{ counter }} stocks associated with this stock location that will be deleted.
+ {% endblocktrans %}
+ {% endif %}
+ </div>
+ <div class="modal-footer">
+ <button type="submit" class="modal-action btn-flat">
+ {% trans "Delete" context "Modal delete stock location primary action" %}
+ </button>
+ <a href="#!" class="modal-action modal-close btn-flat">
+ {% trans "Cancel" context "Modal delete stock location secondary action" %}
+ </a>
+ </div>
</form>
diff --git a/templates/dashboard/product/variant_form.html b/templates/dashboard/product/variant_form.html
index 353893afa7..2f17042bc9 100644
--- a/templates/dashboard/product/variant_form.html
+++ b/templates/dashboard/product/variant_form.html
@@ -4,100 +4,116 @@
{% load static %}
{% block title %}
- {% if variant.pk %}
- {{ variant.sku }}{% if variant.name %} ({{ variant.name }}){% endif %}
- {% else %}
- {% trans "Add variant" context "Variant form page title" %}
- {% endif %} - {{ block.super }}{% endblock %}
+ {% if variant.pk %}
+ {{ variant.sku }}{% if variant.name %} ({{ variant.name }}){% endif %}
+ {% else %}
+ {% trans "Add variant" context "Variant form page title" %}
+ {% endif %}
+ - {{ block.super }}
+{% endblock %}
{% block body_class %}body-store body-products{% endblock %}
{% block header_menu %}
- {% url "dashboard:product-update" pk=product.pk as url %}
- {% include "dashboard/includes/_back-link.html" with url=url hash="#variants" %}
+ {% url "dashboard:product-update" pk=product.pk as url %}
+ {% include "dashboard/includes/_back-link.html" with url=url hash="#variants" %}
{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url "dashboard:product-list" %}" class="breadcrumb">
- {% trans "Products" context "Variant form breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url "dashboard:product-update" pk=product.pk %}#variants"><i class="material-icons">chevron_left</i></a></li>
- <li><a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="breadcrumbs--ellipsed-item">{{ product }}</a></li>
- {% if variant.pk %}
- <li><span class="breadcrumbs--ellipsed-item">
- {{ variant }}
- </span></li>
- {% else %}
- <li>
- <span class="hide-on-med-and-down">
- {% trans "Add variant" context "Variant form breadcrumbs" %}
- </span>
- <span class="hide-on-large-only breadcrumbs--ellipsed-item">
- {% blocktrans trimmed context "Variant form breadcrumbs" %}
- Add variant for {{ product }}
- {% endblocktrans %}
- </span>
- </li>
- {% endif %}
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url "dashboard:product-list" %}" class="breadcrumb">
+ {% trans "Products" context "Variant form breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#variants">
+ <i class="material-icons">chevron_left</i>
+ </a>
+ </li>
+ <li>
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="breadcrumbs--ellipsed-item">
+ {{ product }}
+ </a>
+ </li>
+ {% if variant.pk %}
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {{ variant }}
+ </span>
+ </li>
+ {% else %}
+ <li>
+ <span class="hide-on-med-and-down">
+ {% trans "Add variant" context "Variant form breadcrumbs" %}
+ </span>
+ <span class="hide-on-large-only breadcrumbs--ellipsed-item">
+ {% blocktrans trimmed context "Variant form breadcrumbs" %}
+ Add variant for {{ product }}
+ {% endblocktrans %}
+ </span>
+ </li>
+ {% endif %}
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 m9">
- <div class="card">
- <form method="post" id="form-variant" enctype="multipart/form-data">
- <div class="card-content">
- {% csrf_token %}
- <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
- <div class="row">
- <div class="col s12 m8">
- <div class="row">
- {{ form.name|materializecss }}
- </div>
- {% if attribute_form.fields %}
- {% for attribute_field in attribute_form %}
- <div class="row">
- {{ attribute_field|materializecss }}
- </div>
- {% endfor %}
- {% else %}
- <p>{% trans "This product has no attributes." context "Variant form text" %}</p>
- {% endif %}
- </div>
-
- <div class="col s12 m4">
- <div class="row">
- {{ form.sku|materializecss }}
- </div>
- <div class="row">
- {{ form.price_override|materializecss }}
- </div>
- </div>
- </div>
- </div>
-
- <div class="card-action right-align">
- {% if variant.pk %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
- {% trans "Cancel" context "Variant form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Update" context "Variant form action" %}
- </button>
- {% else %}
- <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
- {% trans "Cancel" context "Variant form secondary action" %}</a>
- <button type="submit" class="btn btn-flat primary">
- {% trans "Create" context "Variant form action" %}
- </button>
- {% endif %}
+ <div class="row">
+ <div class="col s12 m9">
+ <div class="card">
+ <form method="post" id="form-variant" enctype="multipart/form-data">
+ <div class="card-content">
+ {% csrf_token %}
+ <input type="hidden" name="success_url" value="{% url 'dashboard:product-update' pk=product.pk %}#variants">
+ <div class="row">
+ <div class="col s12 m8">
+ <div class="row">
+ {{ form.name|materializecss }}
+ </div>
+ {% if attribute_form.fields %}
+ {% for attribute_field in attribute_form %}
+ <div class="row">
+ {{ attribute_field|materializecss }}
</div>
- </form>
+ {% endfor %}
+ {% else %}
+ <p>
+ {% trans "This product has no attributes." context "Variant form text" %}
+ </p>
+ {% endif %}
+ </div>
+ <div class="col s12 m4">
+ <div class="row">
+ {{ form.sku|materializecss }}
+ </div>
+ <div class="row">
+ {{ form.price_override|materializecss }}
+ </div>
+ </div>
</div>
- </div>
- <div class="col s12 m3 help-box"></div>
+ </div>
+ <div class="card-action right-align">
+ {% if variant.pk %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
+ {% trans "Cancel" context "Variant form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Variant form action" %}
+ </button>
+ {% else %}
+ <a href="{% url "dashboard:product-update" pk=product.pk %}#variants" class="btn btn-flat">
+ {% trans "Cancel" context "Variant form secondary action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Variant form action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col s12 m3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/search/results.html b/templates/dashboard/search/results.html
index e3d574d146..c8942ef557 100644
--- a/templates/dashboard/search/results.html
+++ b/templates/dashboard/search/results.html
@@ -5,115 +5,120 @@
{% load staticfiles %}
{% load product_first_image from product_images %}
-{% block title %}{% trans "Search results" context "Search page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Search results" context "Search page title" %} - {{ block.super }}
+{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Search" context "Search breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">{% trans "Search" context "Search breadcrumbs" %}</li>
+ </ul>
{% endblock %}
{% block menu_catalogue_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- <div class="card search-form">
- <form class="hide-on-med-and-up" method="get" action="{% url "dashboard:search" %}">
- <input id="icon_prefix" type="text" class="validate left"
- placeholder="{% trans "Search" context "Search form placeholder" %}"
- name="q" value="{% if query %}{{ query }}{% endif %}">
- <button class="btn-flat" type="submit">
- <i class="material-icons left right">search</i>
- </button>
- </form>
- <form class="hide-on-med-and-up row" method="get" action="{% url "dashboard:search" %}">
- <input type="hidden" class="validate" name="q" value="{% if query %}{{ query }}{% endif %}">
- </form>
- </div>
- {% if results %}
- <ul class="collection list">
- {% for result in results %}
- <li class="collection-item avatar list-item">
- {% if result.content_type == 'product_product' %}
- {% with product=result %}
- <img src="{% product_first_image product size="100x100" method="crop" %}"
- class="circle teal" alt="{{ product.name }}">
- <a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">
- <span class="list-item-name">{{ product.name }}</span>
- </a>
- <p class="list-item-price">
- <small>{% gross product.price html=True %}</small>
- </p>
- {% endwith %}
- {% elif result.content_type == 'order_order' %}
- <i class="small material-icons circle teal">payment</i>
- <a class="title" href="{% url 'dashboard:order-details' order_pk=result.pk %}">
- <span class="list-item-name">
- {% blocktrans trimmed with order_number=result.pk context "Search order result text" %}
- Order #{{ order_number }}
- {% endblocktrans %}
- </span>
- </a>
- <p class="list-item-price">
- <small>
- {% blocktrans trimmed context "Search order result text" with email=result.user_email %}
- Customer: {{ email }}
- {% endblocktrans %}
- </small>
- <small>
- {% blocktrans trimmed with placed=result.created context "Search order result text" %}
- Placed on: {{ placed }}
- {% endblocktrans %}
- </small>
-
- </p>
- {% elif result.content_type == 'userprofile_user' %}
- <i class="small material-icons circle teal">perm_identity</i>
- <a class="title" href="{% url 'dashboard:customer-details' pk=result.pk %}">
- <span class="list-item-name">
- {% blocktrans trimmed with full_name=result.get_full_name context "Search user result text" %}
- User {{ full_name }}
- {% endblocktrans %}
- </span>
- </a>
- <p class="list-item-price">
- <small>{% trans "Customer" context "Search user result text" %}</small>
- </p>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- {% include "dashboard/includes/_pagination.html" with page_obj=results %}
- {% elif query %}
- <ul class="collection list">
- <li class="collection-item list-item">
- <p class="list-item-name--single">
- {% blocktrans trimmed with full_name=result.get_full_name context "No Search result message" %}
- No results for query "{{ query }}".
- {% endblocktrans %}
- </p>
- </li>
- </ul>
- {% endif %}
- </div>
+ <div class="row">
+ <div class="col s12">
+ <div class="card search-form">
+ <form class="hide-on-med-and-up" method="get" action="{% url "dashboard:search" %}">
+ <input id="icon_prefix" type="text" class="validate left" placeholder="{% trans "Search" context "Search form placeholder" %}" name="q" value="{% if query %}{{ query }}{% endif %}">
+ <button class="btn-flat" type="submit">
+ <i class="material-icons left right">search</i>
+ </button>
+ </form>
+ <form class="hide-on-med-and-up row" method="get" action="{% url "dashboard:search" %}">
+ <input type="hidden" class="validate" name="q" value="{% if query %}{{ query }}{% endif %}">
+ </form>
+ </div>
+ {% if results %}
+ <ul class="collection list">
+ {% for result in results %}
+ <li class="collection-item avatar list-item">
+ {% if result.content_type == 'product_product' %}
+ {% with product=result %}
+ <img src="{% product_first_image product size="100x100" method="crop" %}"
+ class="circle teal" alt="{{ product.name }}">
+ <a class="title" href="{% url 'dashboard:product-update' pk=product.pk %}">
+ <span class="list-item-name">
+ {{ product.name }}
+ </span>
+ </a>
+ <p class="list-item-price">
+ <small>
+ {% gross product.price html=True %}
+ </small>
+ </p>
+ {% endwith %}
+ {% elif result.content_type == 'order_order' %}
+ <i class="small material-icons circle teal">payment</i>
+ <a class="title" href="{% url 'dashboard:order-details' order_pk=result.pk %}">
+ <span class="list-item-name">
+ {% blocktrans trimmed with order_number=result.pk context "Search order result text" %}
+ Order #{{ order_number }}
+ {% endblocktrans %}
+ </span>
+ </a>
+ <p class="list-item-price">
+ <small>
+ {% blocktrans trimmed context "Search order result text" with email=result.user_email %}
+ Customer: {{ email }}
+ {% endblocktrans %}
+ </small>
+ <small>
+ {% blocktrans trimmed with placed=result.created context "Search order result text" %}
+ Placed on: {{ placed }}
+ {% endblocktrans %}
+ </small>
+ </p>
+ {% elif result.content_type == 'userprofile_user' %}
+ <i class="small material-icons circle teal">perm_identity</i>
+ <a class="title" href="{% url 'dashboard:customer-details' pk=result.pk %}">
+ <span class="list-item-name">
+ {% blocktrans trimmed with full_name=result.get_full_name context "Search user result text" %}
+ User {{ full_name }}
+ {% endblocktrans %}
+ </span>
+ </a>
+ <p class="list-item-price">
+ <small>
+ {% trans "Customer" context "Search user result text" %}
+ </small>
+ </p>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "dashboard/includes/_pagination.html" with page_obj=results %}
+ {% elif query %}
+ <ul class="collection list">
+ <li class="collection-item list-item">
+ <p class="list-item-name--single">
+ {% blocktrans trimmed with full_name=result.get_full_name context "No Search result message" %}
+ No results for query "{{ query }}".
+ {% endblocktrans %}
+ </p>
+ </li>
+ </ul>
+ {% endif %}
</div>
- <div id="modal-product-class" class="modal">
- <div class="modal-content">
- <form method="post" action=".">
- {% csrf_token %}
- <div class="row">
- {{ form|materializecss }}
- </div>
-
- <div class="row">
- <div class="col s12">
- <button class="btn" type="submit">
- <i class="material-icons left">create</i> {% trans "Create new" %}
- </button>
- </div>
- </div>
- </form>
+ </div>
+ <div id="modal-product-class" class="modal">
+ <div class="modal-content">
+ <form method="post" action=".">
+ {% csrf_token %}
+ <div class="row">
+ {{ form|materializecss }}
+ </div>
+ <div class="row">
+ <div class="col s12">
+ <button class="btn" type="submit">
+ <i class="material-icons left">create</i>
+ {% trans "Create new" %}
+ </button>
+ </div>
</div>
+ </form>
</div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/shipping/method_delete.html b/templates/dashboard/shipping/method_delete.html
index cf8954a89d..e2ec62b70c 100644
--- a/templates/dashboard/shipping/method_delete.html
+++ b/templates/dashboard/shipping/method_delete.html
@@ -3,52 +3,57 @@
{% load i18n %}
{% block title %}
- {% blocktrans trimmed context "Delete shipping method page title" %}
- Delete {{ shipping_method }}
- {% endblocktrans %}
+ {% blocktrans trimmed context "Delete shipping method page title" %}
+ Delete {{ shipping_method }}
+ {% endblocktrans %}
{% endblock %}
{% block body_class %}body-shipping-methods{% endblock %}
{% block page_title %}
- {% blocktrans trimmed context "Delete shipping method page title" %}
- Delete {{ shipping_method }}
- {% endblocktrans %}
+ {% blocktrans trimmed context "Delete shipping method page title" %}
+ Delete {{ shipping_method }}
+ {% endblocktrans %}
{% endblock %}
{% block menu_delivery_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--with-menu">
- <li><a href="{% url 'dashboard:shipping-methods' %}"
- class="breadcrumbs--ellipsed-item">
- {% trans "Subscription methods" context "Delete shipping method breadcrumbs" %}
- </a></li>
- <li><a href="{% url 'dashboard:shipping-method-detail' pk=shipping_method.pk %}"
- class="breadcrumbs--ellipsed-item">{{ shipping_method }}</a>
- </li>
- <li>
- <span class="breadcrumbs--ellipsed-item">
- {% trans "Delete" context "Delete shipping method breadcrumbs" %}
- </span>
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li>
+ <a href="{% url 'dashboard:shipping-methods' %}" class="breadcrumbs--ellipsed-item">
+ {% trans "Subscription methods" context "Delete shipping method breadcrumbs" %}
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'dashboard:shipping-method-detail' pk=shipping_method.pk %}" class="breadcrumbs--ellipsed-item">
+ {{ shipping_method }}
+ </a>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Delete" context "Delete shipping method breadcrumbs" %}
+ </span>
+ </li>
+ </ul>
{% endblock %}
{% block menu_shipping_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12 m5">
- <div class="card-panel">
- {% blocktrans trimmed with shipping_method_name=shipping_method context "Delete shipping method text" %}
- Are you sure you want to delete the {{ shipping_method_name }} method?
- {% endblocktrans %}
- </div>
- </div>
+ <div class="row">
+ <div class="col s12 m5">
+ <div class="card-panel">
+ {% blocktrans trimmed with shipping_method_name=shipping_method context "Delete shipping method text" %}
+ Are you sure you want to delete the {{ shipping_method_name }} method?
+ {% endblocktrans %}
+ </div>
</div>
- <form method="post">
- {% csrf_token %}
- <button type="submit" class="btn red">{% trans "Delete" context "Delete shipping method action" %}</button>
- </form>
+ </div>
+ <form method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn red">
+ {% trans "Delete" context "Delete shipping method action" %}
+ </button>
+ </form>
{% endblock %}
diff --git a/templates/dashboard/shipping/method_form.html b/templates/dashboard/shipping/method_form.html
index 927d384e66..de62c490d9 100644
--- a/templates/dashboard/shipping/method_form.html
+++ b/templates/dashboard/shipping/method_form.html
@@ -3,118 +3,146 @@
{% load i18n %}
{% load mptt_tags %}
-
{% block title %}
- {% trans "Shipping methods" context "Shipping method form page title" %}
- {% if shipping_method.pk %}
- - {{ shipping_method }}
- {% else %}
- - {% trans "Add new method" context "Shipping method form page title" %}
- {% endif %}
- - {{ block.super }}
+ {% trans "Shipping methods" context "Shipping method form page title" %}
+ {% if shipping_method.pk %}
+ - {{ shipping_method }}
+ {% else %}
+ - {% trans "Add new method" context "Shipping method form page title" %}
+ {% endif %}
+ - {{ block.super }}
{% endblock %}
{% block body_class %}body-shipping-methods{% endblock %}
{% block menu_delivery_class %}active{% endblock %}
-{% block page_title %}{% if shipping_method.pk %}{{ shipping_method }}{% else %}
+{% block page_title %}
+ {% if shipping_method.pk %}
+ {{ shipping_method }}
+ {% else %}
{% trans "Add new method" context "Shipping method form page title" %}
-{% endif %}{% endblock %}
+ {% endif %}
+{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs breadcrumbs--history">
- <li><a href="{% url 'dashboard:shipping-methods' %}">
- {% trans "Shipping methods" context "Shipping method form breadcrumbs" %}
- </a></li>
- <li class="back-mobile"><a href="{% url 'dashboard:shipping-methods' %}"><i class="material-icons">arrow_back</i></a></li>
- <li>
- {% if shipping_method.pk %}
- <span class="breadcrumbs--ellipsed-item">{{ shipping_method }}</span>
- {% else %}
- <span class="breadcrumbs--ellipsed-item">
- {% trans "Add new method" context "Shipping method form breadcrumbs" %}
- </span>
- {% endif %}
- </li>
- </ul>
+ <ul class="breadcrumbs breadcrumbs--history">
+ <li>
+ <a href="{% url 'dashboard:shipping-methods' %}">
+ {% trans "Shipping methods" context "Shipping method form breadcrumbs" %}
+ </a>
+ </li>
+ <li class="back-mobile">
+ <a href="{% url 'dashboard:shipping-methods' %}">
+ <i class="material-icons">arrow_back</i>
+ </a>
+ </li>
+ <li>
+ {% if shipping_method.pk %}
+ <span class="breadcrumbs--ellipsed-item">
+ {{ shipping_method }}
+ </span>
+ {% else %}
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Add new method" context "Shipping method form breadcrumbs" %}
+ </span>
+ {% endif %}
+ </li>
+ </ul>
{% endblock %}
{% block header_extra %}
- {% if shipping_method.pk %}
+ {% if shipping_method.pk %}
<a class="dropdown-button right" href="#" data-activates="context-menu" data-constrainwidth="false">
- <i class="material-icons">more_vert</i>
+ <i class="material-icons">more_vert</i>
</a>
<ul id="context-menu" class="dropdown-content">
- <li>
- <a href="{% url 'dashboard:shipping-method-delete' pk=shipping_method.pk %}">{% trans "Delete shipping method" context "Shipping method form action" %}</a>
- </li>
+ <li>
+ <a href="{% url 'dashboard:shipping-method-delete' pk=shipping_method.pk %}">
+ {% trans "Delete shipping method" context "Shipping method form action" %}
+ </a>
+ </li>
</ul>
- {% endif %}
+ {% endif %}
{% endblock %}
{% block menu_shipping_class %} active{% endblock %}
{% block content %}
- <div class="row">
- <div class="col m12 l9">
- <div class="card">
- <form method="post" id="form-method">
- <div class="card-content">
- {% csrf_token %}
- {{ price_per_country_formset.management_form }}
- <div class="row">
- {{ shipping_method_form|materializecss }}
- </div>
- <h5 class="card-title">{% trans "Price per country" context "Shipping method form text" %}</h5>
- </div>
- <div class="formset-table-container">
- <table class="formset-table">
- <thead>
- <tr>
- <th>{% trans "Country" context "Shipping method country list" %}</th>
- <th>{% trans "Price" context "Shipping method country list" %}</th>
- <th>{% trans "Delete" context "Shipping method country list" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for form in price_per_country_formset %}
- <tr>
- <td>
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- {{ form.country_code|materializecss:"input-field s12" }}
- {% if form.non_field_errors %}
- {% for error in form.non_field_errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
- {% endif %}
- </td>
- <td>
- {{ form.price|materializecss }}
- </td>
- <td>
- {{ form.DELETE|materializecss }}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
-
- <div class="card-action right-align">
- {% if shipping_method.pk %}
- <a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">{% trans "Cancel" context "Shipping method form action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Shipping method form action" %}</button>
- {% else %}
- <a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">{% trans "Cancel" context "Shipping method form action" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Create" context "Shipping method form action" %}</button>
- {% endif %}
- </div>
- </form>
+ <div class="row">
+ <div class="col m12 l9">
+ <div class="card">
+ <form method="post" id="form-method">
+ <div class="card-content">
+ {% csrf_token %}
+ {{ price_per_country_formset.management_form }}
+ <div class="row">
+ {{ shipping_method_form|materializecss }}
</div>
- </div>
- <div class="col m12 l3 help-box"></div>
+ <h5 class="card-title">
+ {% trans "Price per country" context "Shipping method form text" %}
+ </h5>
+ </div>
+ <div class="formset-table-container">
+ <table class="formset-table">
+ <thead>
+ <tr>
+ <th>
+ {% trans "Country" context "Shipping method country list" %}
+ </th>
+ <th>
+ {% trans "Price" context "Shipping method country list" %}
+ </th>
+ <th>
+ {% trans "Delete" context "Shipping method country list" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for form in price_per_country_formset %}
+ <tr>
+ <td>
+ {% for hidden in form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+ {{ form.country_code|materializecss:"input-field s12" }}
+ {% if form.non_field_errors %}
+ {% for error in form.non_field_errors %}
+ <p class="help-block materialize-red-text">{{ error }}</p>
+ {% endfor %}
+ {% endif %}
+ </td>
+ <td>
+ {{ form.price|materializecss }}
+ </td>
+ <td>
+ {{ form.DELETE|materializecss }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ <div class="card-action right-align">
+ {% if shipping_method.pk %}
+ <a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Shipping method form action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Shipping method form action" %}
+ </button>
+ {% else %}
+ <a href="{% url 'dashboard:shipping-methods' %}" class="btn btn-flat">
+ {% trans "Cancel" context "Shipping method form action" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Create" context "Shipping method form action" %}
+ </button>
+ {% endif %}
+ </div>
+ </form>
+ </div>
</div>
+ <div class="col m12 l3 help-box"></div>
+ </div>
{% endblock %}
diff --git a/templates/dashboard/shipping/method_list.html b/templates/dashboard/shipping/method_list.html
index 4dad3d388e..9c02b59a16 100644
--- a/templates/dashboard/shipping/method_list.html
+++ b/templates/dashboard/shipping/method_list.html
@@ -3,69 +3,83 @@
{% load prices_i18n %}
{% load status %}
-{% block title %}{% trans "Shipping methods" context "Shipping method list page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% trans "Shipping methods" context "Shipping method list page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-shipping-methods{% endblock %}
{% block menu_delivery_class %}active{% endblock %}
{% block breadcrumbs %}
- <ul class="breadcrumbs">
- <li class="visible-s">{% trans "Shipping methods" context "Shipping method list breadcrumbs" %}</li>
- </ul>
+ <ul class="breadcrumbs">
+ <li class="visible-s">
+ {% trans "Shipping methods" context "Shipping method list breadcrumbs" %}
+ </li>
+ </ul>
{% endblock %}
{% block content %}
- <div class="row">
- <div class="col s12">
- <div class="card">
- <div class="data-table-header-action">
- <a href="{% url 'dashboard:shipping-method-add' %}" class="btn-data-table btn-flat" title="{% trans "Add method" context "Shipping method list add button text" %}">
- {% trans "Add" context "Product form variants tab table action" %}
- </a>
- </div>
- <div class="data-table-container">
- <table class="bordered highlight responsive data-table">
- {% if shipping_methods %}
- <thead>
- <tr>
- <th>{% trans "Name" context "Shipping methods table header" %}</th>
- <th>{% trans "Price range" context "Shipping methods table header" %}</th>
- <th class="wide">{% trans "Countries" context "Shipping methods table header" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for method in shipping_methods %}
- <tr data-action-go="{% url 'dashboard:shipping-method-detail' pk=method.pk %}">
- <td>{{ method }}</td>
- <td>
- {% if not method.price_range %}
- -
- {% elif method.price_range.min_price == method.price_range.max_price %}
- {% gross method.price_range.min_price html=True %}
- {% else %}
- {% gross method.price_range.min_price html=True %}&ndash;{% gross method.price_range.max_price html=True %}
- {% endif %}
- </td>
- <td>{{ method.countries|join:", " }}</td>
- </tr>
- {% endfor %}
- </tbody>
- {% else %}
- <tbody>
- <tr>
- <td>
- <span>
- {% trans "No Shipping methods found" context "Empty Shipping methods table message" %}
- </span>
- </td>
- </tr>
- </tbody>
- {% endif %}
- </table>
- </div>
- </div>
- </div>
+ <div class="row">
+ <div class="col s12">
+ <div class="card">
+ <div class="data-table-header-action">
+ <a href="{% url 'dashboard:shipping-method-add' %}" class="btn-data-table btn-flat" title="{% trans "Add method" context "Shipping method list add button text" %}">
+ {% trans "Add" context "Product form variants tab table action" %}
+ </a>
+ </div>
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table">
+ {% if shipping_methods %}
+ <thead>
+ <tr>
+ <th>
+ {% trans "Name" context "Shipping methods table header" %}
+ </th>
+ <th>
+ {% trans "Price range" context "Shipping methods table header" %}
+ </th>
+ <th class="wide">
+ {% trans "Countries" context "Shipping methods table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for method in shipping_methods %}
+ <tr data-action-go="{% url 'dashboard:shipping-method-detail' pk=method.pk %}">
+ <td>
+ {{ method }}
+ </td>
+ <td>
+ {% if not method.price_range %}
+ -
+ {% elif method.price_range.min_price == method.price_range.max_price %}
+ {% gross method.price_range.min_price html=True %}
+ {% else %}
+ {% gross method.price_range.min_price html=True %}&ndash;{% gross method.price_range.max_price html=True %}
+ {% endif %}
+ </td>
+ <td>
+ {{ method.countries|join:", " }}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ {% else %}
+ <tbody>
+ <tr>
+ <td>
+ <span>
+ {% trans "No Shipping methods found" context "Empty Shipping methods table message" %}
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ {% endif %}
+ </table>
</div>
- {% include "dashboard/includes/_pagination.html" %}
+ </div>
+ </div>
+ </div>
+ {% include "dashboard/includes/_pagination.html" %}
{% endblock %}
diff --git a/templates/dashboard/sites/detail.html b/templates/dashboard/sites/detail.html
index 47b67dfb40..a96311861f 100644
--- a/templates/dashboard/sites/detail.html
+++ b/templates/dashboard/sites/detail.html
@@ -2,7 +2,14 @@
{% load i18n %}
{% load materializecss %}
-{% block title %}{% if site.pk %}{{ site }}{% else %}{% trans "Add new site settings" context "Site settings page title" %}{% endif %} - {% trans "Site settings" context "Site settings page title" %} - {{ block.super }}{% endblock %}
+{% block title %}
+ {% if site.pk %}
+ {{ site }}
+ {% else %}
+ {% trans "Add new site settings" context "Site settings page title" %}
+ {% endif %}
+ - {% trans "Site settings" context "Site settings page title" %} - {{ block.super }}
+{% endblock %}
{% block body_class %}body-settings{% endblock %}
@@ -10,7 +17,9 @@
{% block breadcrumbs %}
<ul class="breadcrumbs breadcrumbs--history">
- <li class="visible-s">{% trans "Site settings" context "Site settings breadcrumbs" %}</li>
+ <li class="visible-s">
+ {% trans "Site settings" context "Site settings breadcrumbs" %}
+ </li>
</ul>
{% endblock %}
@@ -34,10 +43,13 @@
{{ form.description|materializecss }}
</div>
</div>
-
<div class="card-action right-align">
- <a class="btn btn-flat" href="{% url "dashboard:index" %}" traget="_blank">{% trans "Cancel" %}</a>
- <button type="submit" class="btn btn-flat primary">{% trans "Update" context "Site settings action" %}</button>
+ <a class="btn btn-flat" href="{% url "dashboard:index" %}" traget="_blank">
+ {% trans "Cancel" %}
+ </a>
+ <button type="submit" class="btn btn-flat primary">
+ {% trans "Update" context "Site settings action" %}
+ </button>
</div>
</form>
</div>
diff --git a/templates/materializecssform/field.html b/templates/materializecssform/field.html
index 3de4487479..9c2aeb24a2 100644
--- a/templates/materializecssform/field.html
+++ b/templates/materializecssform/field.html
@@ -2,216 +2,243 @@
{% load materializecss %}
{% load utils %}
-
{% if field|is_checkbox %}
- <div class="input input-field col {{ classes.label }}">
- <div class="{{ classes.single_value }}">
- <p>
- {% if field.auto_id %}
- <input id="{{ field.auto_id }}" name="{{ field.name }}" class="filled-in" type="checkbox">
- <label for="{{ field.auto_id }}">
- {{ field.label }}
- </label>
- {% endif %}
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </p>
- </div>
- </div>
-{% elif field|is_multiple_checkbox %}
- <div class="input input-field col {{ classes.label }}">
+ <div class="input input-field col {{ classes.label }}">
+ <div class="{{ classes.single_value }}">
+ <p>
{% if field.auto_id %}
- <label class="control-label {{ classes.label }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
+ <input id="{{ field.auto_id }}" name="{{ field.name }}" class="filled-in" type="checkbox">
+ <label for="{{ field.auto_id }}">
+ {{ field.label }}
+ </label>
{% endif %}
- {% for choice in field %}
- <p>
- <input id="{{ choice.id_for_label }}" name="{{ choice.name }}" class="filled-in" type="checkbox" value="{{ choice.choice_value }}" {% if choice.choice_value in choice.value %} checked="checked" {% endif %}>
- <label for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label>
- </p>
- {% endfor %}
-
{% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
+ <p class="help-block materialize-red-text">{{ error }}</p>
{% endfor %}
-
{% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
{% endif %}
+ </p>
</div>
+ </div>
+{% elif field|is_multiple_checkbox %}
+ <div class="input input-field col {{ classes.label }}">
+ {% if field.auto_id %}
+ <label class="control-label {{ classes.label }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
+ {% endif %}
+ </label>
+ {% endif %}
+ {% for choice in field %}
+ <p>
+ <input id="{{ choice.id_for_label }}" name="{{ choice.name }}" class="filled-in" type="checkbox" value="{{ choice.choice_value }}" {% if choice.choice_value in choice.value %} checked="checked" {% endif %}>
+ <label for="{{ choice.id_for_label }}">
+ {{ choice.choice_label }}
+ </label>
+ </p>
+ {% endfor %}
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ </div>
{% elif field|is_radio %}
+ <div class="input input-field col {{ classes.label }}">
+ {% if field.auto_id %}
+ <label class="control-label {{ classes.label }}">
+ {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}
+ </label>
+ {% endif %}
+ {% for choice in field %}
+ <p>
+ {{ choice.tag }}
+ <label for="{{ choice.id_for_label }}">
+ {{ choice.choice_label }}
+ </label>
+ </p>
+ {% endfor %}
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ </div>
+{% elif field|is_date_input %}
<div class="input input-field col {{ classes.label }}">
-
- {% if field.auto_id %}
- <label class="control-label {{ classes.label }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
+ <label class="active" for="{{ field.auto_id }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
{% endif %}
+ </label>
+ <input type="date" id="{{ field.auto_id }}" class="datepicker" name="{{ field.name }}"
+ value="{% if field.value %}{{ field.value|date:"Y-m-d" }}{% endif %}" data-value="{% if field.value %}{{ field.value|date:"Y-m-d" }}{% endif %}">
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ </div>
+{% elif field|is_select %}
+ <div class="input input-field col {{ classes.label }}">
+ {% if field|is_checkbox_select_multiple %}
+ {% if field.auto_id %}
+ <label class="control-label {{ classes.label }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
+ {% endif %}
+ </label>
+ {% endif %}
+ <div class="{{ classes.value }}">
{% for choice in field %}
- <p>
- {{ choice.tag }}
- <label for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label>
- </p>
+ <p>
+ {{ choice.tag }}
+ <label for="{{ choice.id_for_label }}">
+ {{ choice.choice_label }}
+ </label>
+ </p>
{% endfor %}
-
{% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
{% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </div>
-{% elif field|is_date_input %}
- <div class="input input-field col {{ classes.label }}">
-
- <label class="active" for="{{ field.auto_id }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
- <input type="date" id="{{ field.auto_id }}" class="datepicker"
- name="{{ field.name }}"
- value="{% if field.value %}{{ field.value|date:"Y-m-d" }}{% endif %}"
- data-value="{% if field.value %}{{ field.value|date:"Y-m-d" }}{% endif %}">
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
{% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </div>
-{% elif field|is_select %}
- <div class="input input-field col {{ classes.label }}">
- {% if field|is_checkbox_select_multiple %}
- {% if field.auto_id %}
- <label class="control-label {{ classes.label }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
- {% endif %}
- <div class="{{ classes.value }}">
- {% for choice in field %}
- <p>
- {{ choice.tag }}
- <label for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label>
- </p>
- {% endfor %}
-
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </div>
-
- {% else %}
- <label for="{{ field.id_for_label }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
- {{ field }}
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
-
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
{% endif %}
-
- </div>
-
+ </div>
+ {% else %}
+ <label for="{{ field.id_for_label }}">
+ {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}
+ </label>
+ {{ field }}
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ {% endif %}
+ </div>
{% elif field|is_textarea %}
- <div class="input input-field col {{ classes.label }}">
- <textarea id="{{ field.auto_id }}"
- class="materialize-textarea {{ field.field.widget.attrs.class }}"
- name="{{ field.name }}">{% if field.value %}{{ field.value }}{% endif %}</textarea>
- {% if field.auto_id %}
- <label class="active {{ classes.label }}" for="{{ field.auto_id }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
+ <div class="input input-field col {{ classes.label }}">
+ <textarea id="{{ field.auto_id }}" class="materialize-textarea {{ field.field.widget.attrs.class }}"
+ name="{{ field.name }}">
+ {% if field.value %}
+ {{ field.value }}
+ {% endif %}
+ </textarea>
+ {% if field.auto_id %}
+ <label class="active {{ classes.label }}" for="{{ field.auto_id }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
{% endif %}
-
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </div>
-
-{% elif field|is_file %}
- <div class="input col {{ classes.label }}">
- <p>
- {% if field.auto_id %}
- <label class="{{ classes.label }}" for="{{ field.auto_id }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label><br>
- {% endif %}
- {{ field }}
+ </label>
+ {% endif %}
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">{{ error }}</p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
</p>
- </div>
+ {% endif %}
+ </div>
+{% elif field|is_file %}
+ <div class="input col {{ classes.label }}">
+ <p>
+ {% if field.auto_id %}
+ <label class="{{ classes.label }}" for="{{ field.auto_id }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
+ {% endif %}
+ </label>
+ <br>
+ {% endif %}
+ {{ field }}
+ </p>
+ </div>
{% elif field|is_versatile_image_ppoi_click_widget %}
- <div class="input col file-field input-field {{ classes.label }}">
- {% if field.auto_id %}
- <label class="{{ classes.label }}" for="{{ field.auto_id }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
+ <div class="input col file-field input-field {{ classes.label }}">
+ {% if field.auto_id %}
+ <label class="{{ classes.label }}" for="{{ field.auto_id }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
{% endif %}
- <div class="btn">
- <span>{% trans "File" %}</span>
- <input class="file-chooser" id="{{ field.auto_id }}_0"
- name="{{ field.name }}_0" type="file">
- <input class="ppoi-input" id="{{ field.auto_id }}_1"
- name="{{ field.name }}_1" type="hidden">
- </div>
- <div class="file-path-wrapper">
- <input class="file-path" type="text">
- </div>
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
-
- </div>
+ </label>
+ {% endif %}
+ <div class="btn">
+ <span>
+ {% trans "File" %}
+ </span>
+ <input class="file-chooser" id="{{ field.auto_id }}_0"
+ name="{{ field.name }}_0" type="file">
+ <input class="ppoi-input" id="{{ field.auto_id }}_1"
+ name="{{ field.name }}_1" type="hidden">
+ </div>
+ <div class="file-path-wrapper">
+ <input class="file-path" type="text">
+ </div>
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">
+ {{ error }}
+ </p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ </div>
{% else %}
-
- <div class="input input-field col {{ classes.label }}">
- {% if field.auto_id %}
- <label class="active" for="{{ field.auto_id }}">
- {{ field.label }}{% if not field.field.required %} ({% trans "optional" context "Dashboard form labels" %}){% endif %}</label>
+ <div class="input input-field col {{ classes.label }}">
+ {% if field.auto_id %}
+ <label class="active" for="{{ field.auto_id }}">
+ {{ field.label }}
+ {% if not field.field.required %}
+ ({% trans "optional" context "Dashboard form labels" %})
{% endif %}
- {{ field }}
-
- {% for error in field.errors %}
- <p class="help-block materialize-red-text">{{ error }}</p>
- {% endfor %}
-
- {% if field.help_text %}
- <p class="help-block">
- {{ field.help_text|safe }}
- </p>
- {% endif %}
- </div>
-
+ </label>
+ {% endif %}
+ {{ field }}
+ {% for error in field.errors %}
+ <p class="help-block materialize-red-text">{{ error }}</p>
+ {% endfor %}
+ {% if field.help_text %}
+ <p class="help-block">
+ {{ field.help_text|safe }}
+ </p>
+ {% endif %}
+ </div>
{% endif %}