Added base html
This commit is contained in:
parent
2919761b2f
commit
972ee3e4d4
@ -16,6 +16,9 @@ Including another URLconf
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
from main.views import main_page
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', main_page),
|
||||
]
|
||||
|
55
main/templates/base/base.html
Normal file
55
main/templates/base/base.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru" class="h-100">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
|
||||
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
|
||||
crossorigin="anonymous">
|
||||
|
||||
<style>
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
<body class="d-flex flex-column h-100">
|
||||
{% include 'base/menu.html' %}
|
||||
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container mt-4 mb-4">
|
||||
<h1 class="mb-4">
|
||||
{% block heading %}
|
||||
{% endblock %}
|
||||
</h1>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-light">
|
||||
<div class="container">
|
||||
<small class="text-muted mt-auto">Сайт сделан учениками Школы Программистов (Группа №02)</small>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
</body>
|
||||
</html>
|
26
main/templates/base/menu.html
Normal file
26
main/templates/base/menu.html
Normal file
@ -0,0 +1,26 @@
|
||||
<header>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<nav class="navbar navbar-light" style="background-color: #a3f2fd;">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="media/images/access.png" width="30" height="30" class="d-inline-block align-top" alt="" loading="lazy">
|
||||
Access Controller
|
||||
</a>
|
||||
{% if request.user.is_authenticated %}
|
||||
|
||||
<div class="btn-group" role="group" aria-label="Basic example">
|
||||
<a class="btn btn-secondary" href="">Выйти</a>
|
||||
<a class="btn btn-secondary" href="">Профиль</a>
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="btn-group" role="group" aria-label="Basic example">
|
||||
<a class="btn btn-secondary" href="">Войти</a>
|
||||
<a class="btn btn-secondary" href="">Зарегистрироваться</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</nav>
|
||||
</header>
|
17
main/templates/pages/index.html
Normal file
17
main/templates/pages/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
{% extends 'base/base.html' %}
|
||||
|
||||
{% block title %}
|
||||
Главная
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex h-300 text-center">
|
||||
<div class="mt-5 d-flex w-50 h-300 p-3 mx-auto flex-column">
|
||||
|
||||
<h2 class="mt-4 mb-4">Добро пожаловать!</h2>
|
||||
<h4 class=" mt-4">Мы рады приветствовать Вас на нашем сайте. Главная его задача - выдавать права пользователям системы по запросу самого
|
||||
пользователя.</h4>
|
||||
<h5 class="lead mt-4">Сайт использует API ZenDesk.</h5>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,3 +1,5 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def main_page(request):
|
||||
return render(request, 'pages/index.html')
|
||||
|
Loading…
x
Reference in New Issue
Block a user