Перешел на структуру шаблонов
All checks were successful
Auto-Deploy-Shop / deploy (push) Successful in 7s
All checks were successful
Auto-Deploy-Shop / deploy (push) Successful in 7s
This commit is contained in:
44
products/templates/products/list copy.html
Normal file
44
products/templates/products/list copy.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Мой Магазин</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; margin: 40px; }
|
||||
.product { border-bottom: 1px solid #ccc; padding: 10px; margin-bottom: 10px; }
|
||||
.admin-link { background: #417690; color: white; padding: 10px; text-decoration: none; border-radius: 4px; }
|
||||
img { max-width: 200px; height: auto; display: block; margin-top: 10px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="background: #28a745; color: white; text-align: center; padding: 20px; font-family: sans-serif; border-bottom: 4px solid #1e7e34;">
|
||||
<h1 style="margin: 0;">🚀 Система автоматизирована!</h1>
|
||||
<p style="margin: 5px 0 0;">Этот билд был собран и развернут автоматически через Gitea Actions.</p>
|
||||
<small>Время деплоя: 21.01.2026</small>
|
||||
|
||||
<!-- 🔥 Вот здесь вывод переменной окружения -->
|
||||
<p style="margin-top: 15px; font-size: 14px;">
|
||||
<strong>ENV_TYPE:</strong> {{ env_type }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h1>Список товаров</h1>
|
||||
<a href="/admin/" class="admin-link">Перейти в панельку админа</a>
|
||||
<hr>
|
||||
|
||||
{% for product in products %}
|
||||
<div class="product">
|
||||
<h2>{{ product.name }}</h2>
|
||||
<p>{{ product.description }}</p>
|
||||
<p><strong>Цена: {{ product.price }} руб.</strong></p>
|
||||
{% if product.image %}
|
||||
<img src="{{ product.image.url }}" alt="{{ product.name }}">
|
||||
{% else %}
|
||||
<p>Нет изображения</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p>Товаров пока нет.</p>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,44 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Мой Магазин</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; margin: 40px; }
|
||||
.product { border-bottom: 1px solid #ccc; padding: 10px; margin-bottom: 10px; }
|
||||
.admin-link { background: #417690; color: white; padding: 10px; text-decoration: none; border-radius: 4px; }
|
||||
img { max-width: 200px; height: auto; display: block; margin-top: 10px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="background: #28a745; color: white; text-align: center; padding: 20px; font-family: sans-serif; border-bottom: 4px solid #1e7e34;">
|
||||
<h1 style="margin: 0;">🚀 Система автоматизирована!</h1>
|
||||
<p style="margin: 5px 0 0;">Этот билд был собран и развернут автоматически через Gitea Actions.</p>
|
||||
<small>Время деплоя: 21.01.2026</small>
|
||||
<!-- templates/products/list.html -->
|
||||
{% extends 'base.html' %}
|
||||
|
||||
<!-- 🔥 Вот здесь вывод переменной окружения -->
|
||||
<p style="margin-top: 15px; font-size: 14px;">
|
||||
<strong>ENV_TYPE:</strong> {{ env_type }}
|
||||
</p>
|
||||
</div>
|
||||
{% block title %}Список продуктов{% endblock %}
|
||||
|
||||
<h1>Список товаров</h1>
|
||||
<a href="/admin/" class="admin-link">Перейти в панельку админа</a>
|
||||
<hr>
|
||||
|
||||
{% for product in products %}
|
||||
<div class="product">
|
||||
<h2>{{ product.name }}</h2>
|
||||
<p>{{ product.description }}</p>
|
||||
<p><strong>Цена: {{ product.price }} руб.</strong></p>
|
||||
{% if product.image %}
|
||||
<img src="{{ product.image.url }}" alt="{{ product.name }}">
|
||||
{% else %}
|
||||
<p>Нет изображения</p>
|
||||
{% endif %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>Список продуктов</h1>
|
||||
<div class="row">
|
||||
{% for product in products %}
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ product.name }}</h5>
|
||||
<p class="card-text">{{ product.description }}</p>
|
||||
<p class="card-text"><strong>Цена: {{ product.price }} руб.</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-12">
|
||||
<p>Продуктов пока нет.</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% empty %}
|
||||
<p>Товаров пока нет.</p>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,7 @@
|
||||
from django.urls import path
|
||||
from .views import product_list
|
||||
|
||||
app_name = 'products' # Это нужно добавить для регистрации пространства имён
|
||||
urlpatterns = [
|
||||
path('', product_list, name='product_list'),
|
||||
path('', product_list, name='list'),
|
||||
]
|
||||
Reference in New Issue
Block a user