Skip to content

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

Use base modal in category modal templates

Anna Siwikaff054407303
diff --git a/templates/dashboard/category/modal/confirm_delete.html b/templates/dashboard/category/modal/confirm_delete.html
index c8d217aae0..010592f429 100644
--- a/templates/dashboard/category/modal/confirm_delete.html
+++ b/templates/dashboard/category/modal/confirm_delete.html
@@ -1,4 +1,4 @@
-{% extends "dashboard/base_modal_confirm_delete.html" %}
+{% extends "dashboard/base_modal.html" %}
{% load i18n %}
{% load mptt_tags %}
@@ -8,35 +8,41 @@
{% endblock %}
{% block title %}
-{% blocktrans with category=category trimmed context "Remove category modal title" %}
+{% blocktrans trimmed with category=category context "Remove category modal title" %}
Remove category {{ category }}
{% endblocktrans %}
{% endblock %}
{% block content %}
-{% blocktrans with category=category trimmed context "Remove category modal title" %}
-Are you sure you want to remove category <strong>{{ category }}</strong>?
-{% endblocktrans %}
-{% if descendants %}
-<p>
-{% trans "The following child categories will be removed:" context "Delete category form text about descendant categories" %}
-<ul>
- {% recursetree descendants %}
- {{ node.name }},
- {% if not node.is_leaf_node %}
- {{ children }}
- {% endif %}
- {% endrecursetree %}
-</ul>
-</p>
-{% endif %}
-{% if products_count %}
-<p>
-{% blocktrans count counter=products_count trimmed context "Remove category form text about products" %}
- There is one product in this category that will be removed.
- {% plural %}
- There are {{ counter }} products in this category that will be removed.
-{% endblocktrans %}
-</p>
-{% endif %}
-{% endblock content %}
+<div class="col">
+ {% blocktrans trimmed with category=category context "Remove category modal title" %}
+ Are you sure you want to remove category <strong>{{ category }}</strong>?
+ {% endblocktrans %}
+ {% if descendants %}
+ <p>
+ {% trans "The following child categories will be removed:" context "Remove category modal text about descendant categories" %}
+ <ul>
+ {% recursetree descendants %}
+ {{ node.name }},
+ {% if not node.is_leaf_node %}
+ {{ children }}
+ {% endif %}
+ {% endrecursetree %}
+ </ul>
+ </p>
+ {% endif %}
+ {% if products_count %}
+ <p>
+ {% blocktrans count counter=products_count trimmed context "Remove category modal text about products" %}
+ There is one product in this category that will be removed.
+ {% plural %}
+ There are {{ counter }} products in this category that will be removed.
+ {% endblocktrans %}
+ </p>
+ {% endif %}
+</div>
+{% endblock %}
+
+{% block primary_action %}
+{% trans "Remove" context "Modal remove category primary action" %}
+{% endblock %}
diff --git a/templates/dashboard/category/modal/edit.html b/templates/dashboard/category/modal/edit.html
new file mode 100644
index 0000000000..0b89adb425
--- /dev/null
+++ b/templates/dashboard/category/modal/edit.html
@@ -0,0 +1,25 @@
+{% extends "dashboard/base_modal.html" %}
+
+{% load i18n %}
+{% load materializecss %}
+{% load mptt_tags %}
+
+{% block action_url %}
+{% url "dashboard:category-edit" root_pk=category.pk %}
+{% endblock %}
+
+{% block title %}
+{% blocktrans trimmed with category=category context "Edit category modal title" %}
+Edit {{ category }}
+{% endblocktrans %}
+{% endblock %}
+
+{% block content %}
+{{ form.name|materializecss:"s8 m10" }}
+{{ form.hidden|materializecss:"s4 m2" }}
+{{ form.description|materializecss }}
+{% endblock %}
+
+{% block primary_action %}
+{% trans "Update" context "Edit category primary action" %}
+{% endblock %}