From d5a623c1eb75e8f35b22e25be36383bb07564c67 Mon Sep 17 00:00:00 2001 From: pi3c Date: Mon, 25 Sep 2023 22:54:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B8=D0=BF=D0=BA=D0=B8=D0=B9=20=D1=84?= =?UTF-8?q?=D1=83=D1=82=D0=B5=D1=80=20=D0=B1=D0=B5=D0=B7=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F,=20=D1=83?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BB=20=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=BC=D1=83=D1=81=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproger/blog/blog.py | 1 + pyproger/blog/urls.py | 2 +- pyproger/static/css/style.css | 20 ++++++++++++++++++++ pyproger/templates/blog/base.html | 16 ++++++++++++---- pyproger/templates/site/index.html | 9 --------- 5 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 pyproger/static/css/style.css delete mode 100755 pyproger/templates/site/index.html diff --git a/pyproger/blog/blog.py b/pyproger/blog/blog.py index 0efc94d..baa6a90 100644 --- a/pyproger/blog/blog.py +++ b/pyproger/blog/blog.py @@ -4,6 +4,7 @@ bp = Blueprint( "bp_blog", __name__, template_folder="templates/blog", + static_folder="static", ) from . import urls diff --git a/pyproger/blog/urls.py b/pyproger/blog/urls.py index 59f7906..5db58fa 100644 --- a/pyproger/blog/urls.py +++ b/pyproger/blog/urls.py @@ -14,7 +14,7 @@ locale.setlocale(locale.LC_ALL, "") @bp.route("/", 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 diff --git a/pyproger/static/css/style.css b/pyproger/static/css/style.css new file mode 100644 index 0000000..d654fc9 --- /dev/null +++ b/pyproger/static/css/style.css @@ -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; +} + diff --git a/pyproger/templates/blog/base.html b/pyproger/templates/blog/base.html index d0d435c..d7553f0 100644 --- a/pyproger/templates/blog/base.html +++ b/pyproger/templates/blog/base.html @@ -4,6 +4,7 @@ + {% 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,12 +36,19 @@ </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" crossorigin="anonymous"></script> diff --git a/pyproger/templates/site/index.html b/pyproger/templates/site/index.html deleted file mode 100755 index ef60fdd..0000000 --- a/pyproger/templates/site/index.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> - -<body> - <div> - <a href="{{ url_for('admin.index') }}">админ панель</a> - </div> -</body> - -</html>