From 3b3595d6b818e2923bffee025128a7179e48b5ff Mon Sep 17 00:00:00 2001 From: pi3c Date: Thu, 28 Sep 2023 20:22:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B8=20=D0=BD=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D1=83=D1=82=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproger/blog/urls.py | 2 +- pyproger/templates/blog/base.html | 134 ++++++++++++++++++++++++-- pyproger/templates/blog/index.html | 6 +- pyproger/templates/blog/postview.html | 12 +-- 4 files changed, 133 insertions(+), 21 deletions(-) diff --git a/pyproger/blog/urls.py b/pyproger/blog/urls.py index 5db58fa..59f7906 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 = 4 + per_page = 2 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/templates/blog/base.html b/pyproger/templates/blog/base.html index d7553f0..0256edd 100644 --- a/pyproger/templates/blog/base.html +++ b/pyproger/templates/blog/base.html @@ -11,7 +11,13 @@ - + + + +
@@ -28,10 +34,9 @@
@@ -40,15 +45,126 @@
{% block content %} {% endblock %}
- -
-
- -
-
+ + +
+ +
+ + + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+ + + + + © 2023 + Сергей Ванюшкин +
+ г.Нарьян-Мар Ненецкий А.О +
+ + + + + diff --git a/pyproger/templates/blog/index.html b/pyproger/templates/blog/index.html index d29b929..6b1970a 100644 --- a/pyproger/templates/blog/index.html +++ b/pyproger/templates/blog/index.html @@ -9,8 +9,6 @@ {% endblock %} {% block content %} -
-
{% for p in posts %} @@ -30,9 +28,7 @@ {{ p.Post.create_datetime.strftime('%d %B, %Y') }} -
{% endfor %} -
{% endblock %} diff --git a/pyproger/templates/blog/postview.html b/pyproger/templates/blog/postview.html index 575f60b..8cf1d02 100644 --- a/pyproger/templates/blog/postview.html +++ b/pyproger/templates/blog/postview.html @@ -1,22 +1,22 @@ {% extends 'blog/base.html' %} {% block title %} -{{title}} + {{title}} {% endblock %} {% block menu_title %} -{{ menu_title }} + {{ menu_title }} {% endblock %} {% block content %} - -
+

{{ post.Post.title | safe }}

{{ post.Post.text | safe }} -
- + Назад +
+ {% endblock %}