From a6c3740a419dc22757d261660058e8578b025fa0 Mon Sep 17 00:00:00 2001 From: Vinejar <Хуев@мыло.чпок> Date: Mon, 31 Mar 2025 06:05:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B2=D1=81?= =?UTF-8?q?=D1=8F=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hentai_manga_model/views.py | 16 +++++- templates/manga_catalog.html | 37 +++++++++++--- templates/static/css/manga_catalog.css | 68 ++++++++++++++++++++++++-- templates/static/css/manga_view.css | 9 ++-- 4 files changed, 112 insertions(+), 18 deletions(-) diff --git a/Hentai_manga_model/views.py b/Hentai_manga_model/views.py index 0eb6ddc..7d4be7a 100644 --- a/Hentai_manga_model/views.py +++ b/Hentai_manga_model/views.py @@ -2,15 +2,27 @@ from django.shortcuts import render from .models import manga_collection from django.core.paginator import Paginator +from django.shortcuts import render +from .models import manga_collection +from django.core.paginator import Paginator + def manga_catalog(request): + # Получаем все записи all_manga = list(manga_collection.find({})) + + # Создаем пагинатор paginator = Paginator(all_manga, 20) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) + + # Получаем общее количество манги в базе + total_manga_count = manga_collection.count_documents({}) + return render(request, 'manga_catalog.html', { 'page_obj': page_obj, - 'manga_list': page_obj.object_list + 'manga_list': page_obj.object_list, + 'total_manga_count': total_manga_count # Добавляем счетчик в контекст }) def show_manga(request, manga_id): @@ -29,4 +41,4 @@ def show_manga_page(request, manga_id, page_number): "manga": manga, "img_url": img_url, "page_number": page_number - }) \ No newline at end of file + }) diff --git a/templates/manga_catalog.html b/templates/manga_catalog.html index 05028ac..04cbcac 100644 --- a/templates/manga_catalog.html +++ b/templates/manga_catalog.html @@ -1,12 +1,13 @@ {% load static %} - -
-
-

Каталог манги

+
+

Дроч.кам

+
Манги на сайте: {{ total_manga_count }}
+
+
@@ -33,7 +34,7 @@

{{ manga.original_title }}

- + {% if manga.tags %}
{% for tag in manga.tags %} @@ -43,11 +44,31 @@ {% endif %}
-
- Страниц: - {{ manga.len_manga }} +
+ Страниц: + {{ manga.len_manga }} +
+ +
+
+ Дата: + {{ manga.date }} +
+ + {% if manga.manga_link %} + + Читать в источнике + + {% endif %} +
+ + + +
+ +
{% endfor %} diff --git a/templates/static/css/manga_catalog.css b/templates/static/css/manga_catalog.css index 5f57fc3..600fb12 100644 --- a/templates/static/css/manga_catalog.css +++ b/templates/static/css/manga_catalog.css @@ -6,6 +6,38 @@ body { font-family: Arial, sans-serif; } +.catalog-header { + min-height: 50px; + display: flex; + position: sticky; + top: 0; + width: 100%; + height: 5%; + background-color: #3987cf; + z-index: 1000; + align-items: center; + justify-content: space-between; /* Распределяет пространство между элементами */ + padding: 0 20px; /* Добавляем отступы по бокам */ +} + +.title-site { + color: #ffffff; + position: absolute; /* Абсолютное позиционирование */ + left: 50%; /* Сдвигаем на 50% вправо */ + transform: translateX(-50%); /* Корректируем положение на половину своей ширины */ + margin: 0; /* Убираем стандартные отступы */ +} + +.titles-cont { + position: absolute; + color: #ffffff; + left: 65%; + + + +} + + .catalog-container { max-width: 50%; margin: 0 auto; @@ -41,6 +73,7 @@ body { height: 100%; object-fit: cover; display: block; + box-shadow: 0 0 15px #39accf; } /* Кнопка "Читать" поверх изображения */ @@ -50,16 +83,41 @@ body { left: 0; right: 0; padding: 12px 0; - background: rgba(74, 137, 220, 0.9); + background: #2478c2; color: white; text-align: center; text-decoration: none; font-weight: bold; transition: background 0.3s; } +/* Строка с мета-информацией */ +.meta-row { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + margin-top: auto; +} + +/* Кнопка "Читать в источнике" */ +.read-original-button { + padding: 6px 12px; + background: #6497c5; + color: white; + text-decoration: none; + border-radius: 4px; + font-size: 14px; + transition: background 0.3s; + white-space: nowrap; + margin-left: 15px; +} + +.read-original-button:hover { + background: #5a6268; +} .read-button:hover { - background: rgba(59, 125, 216, 0.95); + background: #2478c2; } /* Информация справа */ @@ -71,6 +129,9 @@ body { } .manga-title h3 { + width: 100%; + padding-bottom: 3px; + border-bottom: 1px solid #3987cf; margin: 0 0 8px 0; color: #333; font-size: 20px; @@ -101,12 +162,13 @@ body { margin-bottom: 10px; } -.meta-label { +.manga-meta{ font-weight: bold; color: #555; margin-right: 5px; } + /* Адаптивность */ @media (max-width: 768px) { .catalog-container { diff --git a/templates/static/css/manga_view.css b/templates/static/css/manga_view.css index 1e131a0..35838a2 100644 --- a/templates/static/css/manga_view.css +++ b/templates/static/css/manga_view.css @@ -16,7 +16,7 @@ body { width: 100%; min-height: 100vh; align-items: center; - background-color: green; + background-color: #ffffff; justify-content: center; @@ -26,9 +26,8 @@ body { min-height: 100vh; width: 50%; place-items: center; - background-color: white; + background-color: #cee6fd; flex-direction: column; - border: dashed white; } @@ -37,7 +36,7 @@ body { padding: 15px 0; margin-bottom: 0; width: 100%; - border-bottom: dashed green; + border-bottom: dashed #ffffff; } @@ -134,7 +133,7 @@ body { align-items: center; gap: 15px; width: 100%; - border-top: dashed green; + border-top: dashed #ffffff; }