липкий футер без наполнения, убрал старый мусор

main
Сергей Ванюшкин 2023-09-25 22:54:00 +03:00
parent 6163505ca0
commit d5a623c1eb
5 changed files with 34 additions and 14 deletions

View File

@ -4,6 +4,7 @@ bp = Blueprint(
"bp_blog",
__name__,
template_folder="templates/blog",
static_folder="static",
)
from . import urls

View File

@ -14,7 +14,7 @@ locale.setlocale(locale.LC_ALL, "")
@bp.route("/<int:page>", methods=["GET"])
def index(page=1):
session["back_url"] = request.url
per_page = 2
per_page = 4
posts, total_pages = get_paginated_posts(page, per_page)
list_pages = [
x for x in range(1, total_pages + 1) if x >= page - 2 and x <= page + 2

View File

@ -0,0 +1,20 @@
html, body {
box-sizing: border-box;
height: 100%;
padding: 0;
margin: 0;
}
.wrapper {
box-sizing: border-box;
min-height: 100%;
display: flex;
flex-direction: column;
}
.page-header, .page-footer {
flex-grow: 0;
flex-shrink: 0;
}
.page-body {
flex-grow: 1;
}

View File

@ -4,6 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<title>
{% block title %}
{% endblock title %}
@ -13,9 +14,9 @@
</head>
<body>
<div id="main-container" class="container-fluid">
<div id="main-container" class="container-fluid wrapper">
<nav class="navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-bottom-4"
<nav class="page-header navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-bottom-4"
data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="{{ url_for(".index")}}">
@ -35,11 +36,18 @@
</div>
</nav>
<div id="content-container" class="container-fluid">
<div id="content-container" class="page-body container-fluid">
{% block content %} {% endblock %}
</div>
</div>
<footer class="page-footer navbar p-2 navbar-expand-lg bg-dark border-bottom border-bottom-dark rounded-top-4"
data-bs-theme="dark">
<div class="container-fluid">
<div class="navbar-text fs-6">pi3c</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"

View File

@ -1,9 +0,0 @@
<html>
<body>
<div>
<a href="{{ url_for('admin.index') }}">админ панель</a>
</div>
</body>
</html>