diff --git a/bober_bbq/admin/tech_cards.py b/bober_bbq/admin/tech_cards.py index c032f44..aef10a4 100644 --- a/bober_bbq/admin/tech_cards.py +++ b/bober_bbq/admin/tech_cards.py @@ -46,6 +46,8 @@ def tech_card_edit(product_id): upload_dir.mkdir(parents=True, exist_ok=True) file.save(upload_dir / secure_filename(filename)) card.photo_url = f"/static/uploads/{filename}" + elif request.form.get("remove_photo"): + card.photo_url = "" db.session.commit() log_action("tech_card_save", f"Оновлено тех карту «{product.name}»") diff --git a/bober_bbq/templates/admin/order_detail.html b/bober_bbq/templates/admin/order_detail.html index d5a833e..f885615 100644 --- a/bober_bbq/templates/admin/order_detail.html +++ b/bober_bbq/templates/admin/order_detail.html @@ -74,7 +74,12 @@ ТоварК-стьЦінаСума {% for item in order.items %} - {{ item.product_name }} + + {{ item.product_name }} + {% if tech_cards_nav_visible and item.product_id %} + 📋 тех карта + {% endif %} + {{ item.quantity }} {{ item.product_price }} грн {{ item.line_total }} грн diff --git a/bober_bbq/templates/admin/tech_card_form.html b/bober_bbq/templates/admin/tech_card_form.html index 091ac62..3a2b6ae 100644 --- a/bober_bbq/templates/admin/tech_card_form.html +++ b/bober_bbq/templates/admin/tech_card_form.html @@ -2,7 +2,7 @@ {% block page_title %}Тех карта: {{ product.name }}{% endblock %} {% block content %}