Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="en" data-theme="light">
<html lang="ru" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Python Books{% endblock %}</title>
<title>{% block title %}Книги по Python{% endblock %}</title>

<!-- Tailwind CSS with DaisyUI -->
<script src="https://cdn.tailwindcss.com"></script>
Expand All @@ -23,31 +23,31 @@
<div class="navbar-start">
<a href="/" class="btn btn-ghost normal-case text-xl">
<i class="fas fa-book text-primary"></i>
Python Books
Книги по Python
</a>
</div>

<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal px-1">
<li><a href="/" class="btn btn-ghost">Home</a></li>
<li><a href="/" class="btn btn-ghost">Главная</a></li>
<li>
<details>
<summary class="btn btn-ghost">Categories</summary>
<summary class="btn btn-ghost">Категории</summary>
<ul class="p-2 bg-base-100 rounded-t-none">
<li><a href="#" hx-get="/books/?category=beginner" hx-target="#books-container" hx-push-url="true">Beginner</a></li>
<li><a href="#" hx-get="/books/?category=intermediate" hx-target="#books-container" hx-push-url="true">Intermediate</a></li>
<li><a href="#" hx-get="/books/?category=advanced" hx-target="#books-container" hx-push-url="true">Advanced</a></li>
<li><a href="#" hx-get="/books/?category=beginner" hx-target="#books-container" hx-push-url="true">Начальный</a></li>
<li><a href="#" hx-get="/books/?category=intermediate" hx-target="#books-container" hx-push-url="true">Средний</a></li>
<li><a href="#" hx-get="/books/?category=advanced" hx-target="#books-container" hx-push-url="true">Продвинутый</a></li>
</ul>
</details>
</li>
<li><a href="#" class="btn btn-ghost">Free Books</a></li>
<li><a href="#" class="btn btn-ghost">Бесплатные книги</a></li>
</ul>
</div>

<div class="navbar-end">
<div class="form-control">
<input type="text"
placeholder="Search books..."
placeholder="Поиск книг..."
class="input input-bordered w-24 md:w-auto"
name="search"
hx-get="/books/search/"
Expand All @@ -60,8 +60,8 @@
<i class="fas fa-sun"></i>
</div>
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
<li><a onclick="document.documentElement.setAttribute('data-theme', 'light')">Light</a></li>
<li><a onclick="document.documentElement.setAttribute('data-theme', 'dark')">Dark</a></li>
<li><a onclick="document.documentElement.setAttribute('data-theme', 'light')">Светлая</a></li>
<li><a onclick="document.documentElement.setAttribute('data-theme', 'dark')">Тёмная</a></li>
<li><a onclick="document.documentElement.setAttribute('data-theme', 'cupcake')">Cupcake</a></li>
</ul>
</div>
Expand All @@ -76,17 +76,17 @@
<!-- Footer -->
<footer class="footer footer-center p-10 bg-base-200 text-base-content rounded">
<div class="grid grid-flow-col gap-4">
<a href="#" class="link link-hover">About</a>
<a href="#" class="link link-hover">Contact</a>
<a href="#" class="link link-hover">Submit a Book</a>
<a href="#" class="link link-hover">О нас</a>
<a href="#" class="link link-hover">Контакты</a>
<a href="#" class="link link-hover">Добавить книгу</a>
</div>
<div class="grid grid-flow-col gap-4">
<a href="#" class="text-xl"><i class="fab fa-github"></i></a>
<a href="#" class="text-xl"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-xl"><i class="fab fa-python"></i></a>
</div>
<div>
<p>&copy; 2024 Python Books. All rights reserved.</p>
<p>&copy; 2024 Книги по Python. Все права защищены.</p>
</div>
</footer>

Expand Down
18 changes: 9 additions & 9 deletions templates/books/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 class="text-3xl font-bold mb-2">{{ book.title }}</h1>
</span>
<span class="badge badge-outline">
<i class="fas fa-file-alt mr-1"></i>
{{ book.total_pages }} pages
{{ book.total_pages }} стр.
</span>
<span class="badge badge-outline">
<i class="fas fa-barcode mr-1"></i>
Expand All @@ -42,19 +42,19 @@ <h1 class="text-3xl font-bold mb-2">{{ book.title }}</h1>

<!-- Description -->
<div class="prose max-w-none">
<h3>Description</h3>
<h3>Описание</h3>
<p>{{ book.description }}</p>
</div>

<!-- Action Buttons -->
<div class="mt-6 flex gap-2">
<a href="#" class="btn btn-primary">
<i class="fas fa-external-link-alt mr-2"></i>
View on {{ book.publisher.name }}
Посмотреть на {{ book.publisher.name }}
</a>
<button class="btn btn-secondary">
<i class="fas fa-heart mr-2"></i>
Add to Wishlist
Добавить в желанное
</button>
</div>
</div>
Expand All @@ -63,7 +63,7 @@ <h3>Description</h3>
<!-- Comments Section -->
<div class="divider my-8"></div>
<div class="mt-8">
<h3 class="text-2xl font-bold mb-4">Comments</h3>
<h3 class="text-2xl font-bold mb-4">Комментарии</h3>

<!-- Add Comment Form -->
<div class="card bg-base-100 shadow-xl mb-6">
Expand All @@ -73,17 +73,17 @@ <h3 class="text-2xl font-bold mb-4">Comments</h3>
hx-swap="afterbegin">
<div class="form-control">
<label class="label">
<span class="label-text">Add a comment</span>
<span class="label-text">Добавить комментарий</span>
</label>
<textarea class="textarea textarea-bordered"
name="text"
placeholder="Share your thoughts about this book..."
placeholder="Поделитесь своими мыслями о этой книге..."
required></textarea>
</div>
<div class="form-control mt-6">
<button class="btn btn-primary">
<i class="fas fa-comment mr-2"></i>
Post Comment
Опубликовать комментарий
</button>
</div>
</form>
Expand All @@ -107,7 +107,7 @@ <h4 class="font-semibold">{{ comment.user.username }}</h4>
{% empty %}
<div class="text-center py-8 text-base-content/60">
<i class="fas fa-comment-slash text-4xl mb-2"></i>
<p>No comments yet. Be the first to share your thoughts!</p>
<p>Комментариев пока нет. Станьте первым, кто поделится своими мыслями!</p>
</div>
{% endfor %}
</div>
Expand Down
46 changes: 23 additions & 23 deletions templates/books/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% extends 'base.html' %}

{% block title %}Python Books - Find the best Python programming books{% endblock %}
{% block title %}Книги по Python - Найдите лучшие книги по программированию на Python{% endblock %}

{% block content %}
<div class="hero bg-gradient-to-r from-primary to-secondary text-primary-content rounded-lg mb-8">
<div class="hero-content text-center">
<div class="max-w-md">
<h1 class="mb-5 text-5xl font-bold">Python Books</h1>
<p class="mb-5">Discover the best Python programming books for every skill level. From beginners to experts, find your next great read.</p>
<h1 class="mb-5 text-5xl font-bold">Книги по Python</h1>
<p class="mb-5">Откройте для себя лучшие книги по программированию на Python для любого уровня навыков. От новичков до экспертов - найдите свою следующую отличную книгу.</p>
<button class="btn btn-accent" onclick="document.getElementById('search-input').focus()">
Start Exploring
Начать исследование
</button>
</div>
</div>
Expand All @@ -18,15 +18,15 @@ <h1 class="mb-5 text-5xl font-bold">Python Books</h1>
<!-- Filters -->
<div class="card bg-base-100 shadow-xl mb-8">
<div class="card-body">
<h2 class="card-title mb-4">Filter Books</h2>
<h2 class="card-title mb-4">Фильтр книг</h2>
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="form-control">
<label class="label">
<span class="label-text">Search</span>
<span class="label-text">Поиск</span>
</label>
<input type="text"
id="search-input"
placeholder="Search books, authors..."
placeholder="Поиск книг, авторов..."
class="input input-bordered"
name="search"
hx-get="/books/search/"
Expand All @@ -37,35 +37,35 @@ <h2 class="card-title mb-4">Filter Books</h2>

<div class="form-control">
<label class="label">
<span class="label-text">Category</span>
<span class="label-text">Категория</span>
</label>
<select class="select select-bordered"
name="category"
hx-get="/books/filter/"
hx-trigger="change"
hx-target="#books-container"
hx-push-url="true">
<option value="">All Categories</option>
<option value="beginner">Beginner</option>
<option value="intermediate">Intermediate</option>
<option value="advanced">Advanced</option>
<option value="web">Web Development</option>
<option value="data">Data Science</option>
<option value="ml">Machine Learning</option>
<option value="">Все категории</option>
<option value="beginner">Начальный</option>
<option value="intermediate">Средний</option>
<option value="advanced">Продвинутый</option>
<option value="web">Веб-разработка</option>
<option value="data">Наука о данных</option>
<option value="ml">Машинное обучение</option>
</select>
</div>

<div class="form-control">
<label class="label">
<span class="label-text">Publisher</span>
<span class="label-text">Издатель</span>
</label>
<select class="select select-bordered"
name="publisher"
hx-get="/books/filter/"
hx-trigger="change"
hx-target="#books-container"
hx-push-url="true">
<option value="">All Publishers</option>
<option value="">Все издатели</option>
{% for publisher in publishers %}
<option value="{{ publisher.id }}">{{ publisher.name }}</option>
{% endfor %}
Expand All @@ -74,19 +74,19 @@ <h2 class="card-title mb-4">Filter Books</h2>

<div class="form-control">
<label class="label">
<span class="label-text">Sort By</span>
<span class="label-text">Сортировать по</span>
</label>
<select class="select select-bordered"
name="sort"
hx-get="/books/filter/"
hx-trigger="change"
hx-target="#books-container"
hx-push-url="true">
<option value="-created">Newest</option>
<option value="title">Title A-Z</option>
<option value="-title">Title Z-A</option>
<option value="published_at">Oldest</option>
<option value="-published_at">Latest Published</option>
<option value="-created">Новейшие</option>
<option value="title">Название от А до Я</option>
<option value="-title">Название от Я до А</option>
<option value="published_at">Старейшие</option>
<option value="-published_at">Последние опубликованные</option>
</select>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions templates/books/partials/books_grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2 class="card-title text-sm">{{ book.title }}</h2>
hx-target="#modal-content"
hx-swap="innerHTML"
onclick="book_modal.showModal()">
View Details
Подробнее
</button>
</div>
</div>
Expand Down Expand Up @@ -87,7 +87,7 @@ <h2 class="card-title text-sm">{{ book.title }}</h2>
<div class="text-6xl text-base-content/20 mb-4">
<i class="fas fa-book"></i>
</div>
<h3 class="text-2xl font-bold mb-2">No books found</h3>
<p class="text-base-content/70">Try adjusting your search or filter criteria.</p>
<h3 class="text-2xl font-bold mb-2">Книги не найдены</h3>
<p class="text-base-content/70">Попробуйте изменить критерии поиска или фильтрации.</p>
</div>
{% endif %}