Skip to content

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

Add backgorund_image_alt of Category and Collection to dashboard

fowczarek0e77f9b58568
diff --git a/saleor/dashboard/category/forms.py b/saleor/dashboard/category/forms.py
index 3d561e16d6..af6c222645 100644
--- a/saleor/dashboard/category/forms.py
+++ b/saleor/dashboard/category/forms.py
@@ -26,7 +26,9 @@ class CategoryForm(forms.ModelForm):
'description': pgettext_lazy('Description', 'Description'),
'background_image': pgettext_lazy(
'Category form',
- 'Background Image')}
+ 'Background Image'),
+ 'background_image_alt': pgettext_lazy(
+ 'Description of a category image', 'Image description')}
def save(self, commit=True):
self.instance.slug = slugify(unidecode(self.instance.name))
diff --git a/saleor/dashboard/collection/forms.py b/saleor/dashboard/collection/forms.py
index 67dd0893bd..35ec27a4c9 100644
--- a/saleor/dashboard/collection/forms.py
+++ b/saleor/dashboard/collection/forms.py
@@ -25,6 +25,8 @@ class CollectionForm(forms.ModelForm):
'background_image': pgettext_lazy(
'Background image of a collection',
'Background image'),
+ 'background_image_alt': pgettext_lazy(
+ 'Description of a collection image', 'Image description'),
'is_published': pgettext_lazy(
'Collection published toggle',
'Published'),
diff --git a/templates/dashboard/category/form.html b/templates/dashboard/category/form.html
index 6f60d58172..6e63cf5144 100644
--- a/templates/dashboard/category/form.html
+++ b/templates/dashboard/category/form.html
@@ -101,6 +101,9 @@
<div class="row">
{{ form.background_image|materializecss }}
</div>
+ <div class="row">
+ {{ form.background_image_alt|materializecss }}
+ </div>
{% include "dashboard/includes/_google_preview.html" with object=category form=form %}
</div>
</div>
diff --git a/templates/dashboard/collection/detail.html b/templates/dashboard/collection/detail.html
index 771afcb1a8..3c7740cc9f 100644
--- a/templates/dashboard/collection/detail.html
+++ b/templates/dashboard/collection/detail.html
@@ -60,6 +60,9 @@
<div class="row">
{{ form.background_image|materializecss }}
</div>
+ <div class="row">
+ {{ form.background_image_alt|materializecss }}
+ </div>
<span class="card-title">{% trans 'Availability' context 'Collection form card title: availability sub form' %}</span>
<div class="row">
{{ form.is_published|materializecss }}