Перешел на структуру шаблонов
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:
13
templates/about.html
Normal file
13
templates/about.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- templates/about.html -->
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}О нас{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1>О нас</h1>
|
||||
<p>Это описание нашего проекта.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
28
templates/base.html
Normal file
28
templates/base.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!-- templates/base.html -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Мой проект{% endblock %}</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигационная панель -->
|
||||
{% include 'components/navbar.html' %}
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-4">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Футер -->
|
||||
{% include 'components/footer.html' %}
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
{% block extra_js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
6
templates/components/footer.html
Normal file
6
templates/components/footer.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<!-- templates/components/footer.html -->
|
||||
<footer class="bg-dark text-white text-center py-4 mt-5">
|
||||
<div class="container">
|
||||
<p>© 2023 Мой проект. Все права защищены.</p>
|
||||
</div>
|
||||
</footer>
|
||||
30
templates/components/navbar.html
Normal file
30
templates/components/navbar.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!-- templates/components/navbar.html -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'home' %}">Мой проект</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'home' %}">Главная</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'products:list' %}">Продукты</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Выход</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Вход</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
17
templates/home.html
Normal file
17
templates/home.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!-- templates/home.html -->
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Главная страница{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="jumbotron">
|
||||
<h1 class="display-4">Добро пожаловать!</h1>
|
||||
<p class="lead">Это главная страница нашего проекта.</p>
|
||||
<hr class="my-4">
|
||||
<p>Здесь можно разместить основную информацию о проекте.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user