Skip to content

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

Use common delete confirmation modal for category deletion

Jakub Draganek20e8564bc3b1
diff --git a/templates/dashboard/category/modal_confirm_delete.html b/templates/dashboard/category/modal_confirm_delete.html
index ec3b886aa0..6fb823b3d3 100644
--- a/templates/dashboard/category/modal_confirm_delete.html
+++ b/templates/dashboard/category/modal_confirm_delete.html
@@ -1,51 +1,39 @@
+{% extends "dashboard/modal_confirm_delete.html" %}
+
{% load i18n %}
{% 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 %}
+{% block action_url %}
+{% url "dashboard:category-delete" pk=category.pk %}
+{% endblock %}
+
+{% block title %}
+{% blocktrans with category=category trimmed context "Delete category modal title" %}
+ Are you sure you want to delete the category {{ category }}?
+{% endblocktrans %}
+{% endblock %}
+
+{% block content %}
+{% 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 %}
- </div>
- <div class="modal-footer">
- <button type="submit" class="modal-action btn-flat">
- {% trans "Delete" context "Dashboard delete action" %}
- </button>
- <a href="#!" class="modal-action modal-close btn-flat">
- {% trans "Cancel" context "Dashboard cancel action" %}
- </a>
- </div>
-</form>
+ </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 %}
+{% endblock content %}