Skip to content

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

Fix breadcrumbs and titles in product templates

Krzysztof Białogłowiczb1cb86db9a68
diff --git a/templates/dashboard/product/images.html b/templates/dashboard/product/images.html
index d5842be665..fd758ab375 100644
--- a/templates/dashboard/product/images.html
+++ b/templates/dashboard/product/images.html
@@ -4,7 +4,7 @@
{% load staticfiles %}
{% block title %}
- {{ product }} - {% trans "Images" %}
+ {% trans "Images" %} - {{ block.super }}
{% endblock %}
{% block body_class %}body-products{% endblock %}
diff --git a/templates/dashboard/product/product_detail.html b/templates/dashboard/product/product_detail.html
index 98040ff37e..8836e8653d 100644
--- a/templates/dashboard/product/product_detail.html
+++ b/templates/dashboard/product/product_detail.html
@@ -5,7 +5,7 @@
{% load staticfiles %}
{% block title %}
- {{ product }} - {% trans "Products" context "Product form page title" %} - {{ block.super }}
+ {{ product }} - {{ block.super }}
{% endblock %}
{% block body_class %}body-products{% endblock %}
diff --git a/templates/dashboard/product/product_form.html b/templates/dashboard/product/product_form.html
index 94c7ce26e0..23c1190379 100644
--- a/templates/dashboard/product/product_form.html
+++ b/templates/dashboard/product/product_form.html
@@ -7,11 +7,11 @@
{% block title %}
{% if product.pk %}
- {{ product }}
+ {% trans "Edit" context "Dashboard products list" %} - {{ product }}
{% else %}
{% trans "Add new product" context "Product form page title" %}
{% endif %}
- - {% trans "Products" context "Dashboard products list" %} - {{ block.super }}
+ - {{ block.super }}
{% endblock %}
{% block body_class %}body-products{% endblock %}
@@ -36,13 +36,15 @@
</a>
</li>
<li>
- <span class="breadcrumbs--ellipsed-item">
{% if product.pk %}
+ <a href="{% url "dashboard:product-detail" pk=product.pk %}" class="breadcrumbs--ellipsed-item">
{{ product }}
+ </a>
{% else %}
- {% trans "Add new product" context "Product form breadcrumbs" %}
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Add new product" context "Product form breadcrumbs" %}
+ </span>
{% endif %}
- </span>
</li>
{% if product.pk %}
<li>
diff --git a/templates/dashboard/product/product_image_form.html b/templates/dashboard/product/product_image_form.html
index 94fda419a3..77ffd4500f 100644
--- a/templates/dashboard/product/product_image_form.html
+++ b/templates/dashboard/product/product_image_form.html
@@ -5,9 +5,9 @@
{% block title %}
{% if product_image.pk %}
- {{ product_image.image.name }}
+ {% trans "Edit - Image" context "Image form text" %}
{% else %}
- {% trans "Add image" %}
+ {% trans "Add image" context "Image form text" %}
{% endif %} - {{ block.super }}
{% endblock %}
@@ -35,7 +35,12 @@
{% if product_image.pk %}
<li>
<span class="breadcrumbs--ellipsed-item">
- {{ product_image.alt|default:_("No description") }}
+ {% trans "Image" context "Image form text" %}
+ </span>
+ </li>
+ <li>
+ <span class="breadcrumbs--ellipsed-item">
+ {% trans "Edit" context "Image form text" %}
</span>
</li>
{% else %}
diff --git a/templates/dashboard/product/stock_form.html b/templates/dashboard/product/stock_form.html
index 2e8a4fe050..e757376526 100644
--- a/templates/dashboard/product/stock_form.html
+++ b/templates/dashboard/product/stock_form.html
@@ -6,7 +6,7 @@
{% block title %}
{% if stock.pk %}
{% blocktrans trimmed with location=stock.location context "Dashboard stock" %}
- Stock {{ variant }} - {{ location }}
+ Edit - Stock {{ variant }}
{% endblocktrans %}
{% else %}
{% trans "Add stock" context "Stock form page title" %}
@@ -42,11 +42,11 @@
</li>
{% if stock.pk %}
<li>
- <span class="breadcrumbs--ellipsed-item">
+ <a href="{% url "dashboard:variant-details" product_pk=product.pk variant_pk=variant.pk %}" class="breadcrumbs--ellipsed-item">
{% blocktrans trimmed with variant=stock.variant context "Dashboard stock" %}
Stock {{ variant }}
{% endblocktrans %}
- </span>
+ </a>
</li>
<li>
<span class="breadcrumbs--ellipsed-item">
diff --git a/templates/dashboard/product/variant_details.html b/templates/dashboard/product/variant_details.html
index 090c7ac7cd..694726652d 100644
--- a/templates/dashboard/product/variant_details.html
+++ b/templates/dashboard/product/variant_details.html
@@ -5,7 +5,7 @@
{% load staticfiles %}
{% block title %}
- {{ product }} - {% trans "Products" context "Product form page title" %} - {{ block.super }}
+ {{ variant }} - {{ block.super }}
{% endblock %}
{% block body_class %}body-products{% endblock %}
@@ -25,13 +25,13 @@
</a>
</li>
<li class="hide-on-med-and-down">
- <a href="{% url "dashboard:product-detail" pk=product.pk %}" class="breadcrumbs--ellipsed-item">
+ <a href="{% url "dashboard:product-detail" pk=product.pk %}" class="breadcrumbs--ellipsed-item">
{{ product }}
</a>
</li>
<li>
<span class="breadcrumbs--ellipsed-item">
- {{ variant.sku }}
+ {{ variant }}
</span>
</li>
</ul>
diff --git a/templates/dashboard/product/variant_form.html b/templates/dashboard/product/variant_form.html
index 262748e01e..af6f96585e 100644
--- a/templates/dashboard/product/variant_form.html
+++ b/templates/dashboard/product/variant_form.html
@@ -5,7 +5,7 @@
{% block title %}
{% if variant.pk %}
- {{ variant.sku }}{% if variant.name %} ({{ variant.name }}){% endif %}
+ {% trans "Edit" context "Variant form page title" %} - {{ variant }}
{% else %}
{% trans "Add variant" context "Variant form page title" %}
{% endif %}
@@ -38,9 +38,9 @@
</li>
{% if variant.pk %}
<li>
- <span class="breadcrumbs--ellipsed-item">
+ <a href="{% url "dashboard:variant-details" product_pk=product.pk variant_pk=variant.pk %}" class="breadcrumbs--ellipsed-item">
{{ variant }}
- </span>
+ </a>
</li>
<li>
<span class="breadcrumbs--ellipsed-item">