From f54fd3d7174afc1758633e694e4bb26488cf9b0c Mon Sep 17 00:00:00 2001 From: Priec Date: Wed, 17 Jun 2026 14:19:43 +0200 Subject: [PATCH] editing product now works well --- assets/views/admin/catalog/category_form.html | 21 +++++++-------- assets/views/admin/catalog/product_form.html | 27 +++++++++---------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/assets/views/admin/catalog/category_form.html b/assets/views/admin/catalog/category_form.html index 7e2d3a2..0ba8a33 100644 --- a/assets/views/admin/catalog/category_form.html +++ b/assets/views/admin/catalog/category_form.html @@ -1,38 +1,37 @@ {% extends "admin/base.html" %} -{% set editing = category %} -{% block title %}{% if editing %}{{ t(key="edit-category", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-category", lang=lang | default(value='sk')) }}{% endif %}{% endblock title %} +{% block title %}{% if category %}{{ t(key="edit-category", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-category", lang=lang | default(value='sk')) }}{% endif %}{% endblock title %} {% block crumb %}{{ t(key="admin-categories", lang=lang | default(value='sk')) }}{% endblock crumb %} {% block content %}

- {% if editing %}{{ t(key="edit-category", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-category", lang=lang | default(value='sk')) }}{% endif %} + {% if category %}{{ t(key="edit-category", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-category", lang=lang | default(value='sk')) }}{% endif %}

{{ t(key="cancel", lang=lang | default(value='sk')) }}
-
-
-
@@ -43,7 +42,7 @@ class="w-full rounded-radius border border-outline bg-surface px-3 py-2 text-sm text-on-surface focus:outline-2 focus:outline-primary dark:border-outline-dark dark:bg-surface-dark dark:text-on-surface-dark"> {% for parent in parents %} - {% endfor %} @@ -53,12 +52,12 @@
+ class="w-full rounded-radius border border-outline bg-surface px-3 py-2 text-sm text-on-surface focus:outline-2 focus:outline-primary dark:border-outline-dark dark:bg-surface-dark dark:text-on-surface-dark">{% if category and category.description %}{{ category.description }}{% endif %}
- {% if editing and category.image_id %} + {% if category and category.image_id %} {% endif %} diff --git a/assets/views/admin/catalog/product_form.html b/assets/views/admin/catalog/product_form.html index c332d71..e061e68 100644 --- a/assets/views/admin/catalog/product_form.html +++ b/assets/views/admin/catalog/product_form.html @@ -1,38 +1,37 @@ {% extends "admin/base.html" %} -{% set editing = product %} -{% block title %}{% if editing %}{{ t(key="edit-product", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-product", lang=lang | default(value='sk')) }}{% endif %}{% endblock title %} +{% block title %}{% if product %}{{ t(key="edit-product", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-product", lang=lang | default(value='sk')) }}{% endif %}{% endblock title %} {% block crumb %}{{ t(key="admin-products", lang=lang | default(value='sk')) }}{% endblock crumb %} {% block content %}

- {% if editing %}{{ t(key="edit-product", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-product", lang=lang | default(value='sk')) }}{% endif %} + {% if product %}{{ t(key="edit-product", lang=lang | default(value='sk')) }}{% else %}{{ t(key="new-product", lang=lang | default(value='sk')) }}{% endif %}

{{ t(key="cancel", lang=lang | default(value='sk')) }}
-
-
-
@@ -40,12 +39,12 @@
-
-
@@ -56,14 +55,14 @@ class="w-full rounded-radius border border-outline bg-surface px-3 py-2 text-sm text-on-surface focus:outline-2 focus:outline-primary dark:border-outline-dark dark:bg-surface-dark dark:text-on-surface-dark"> {% for category in categories %} - + {% endfor %}
-
@@ -71,12 +70,12 @@
+ class="w-full rounded-radius border border-outline bg-surface px-3 py-2 text-sm text-on-surface focus:outline-2 focus:outline-primary dark:border-outline-dark dark:bg-surface-dark dark:text-on-surface-dark">{% if product and product.description %}{{ product.description }}{% endif %}
- {% if editing and product.image %} + {% if product and product.image %} {% endif %}