finish line!

This commit is contained in:
2025-11-26 17:25:27 +08:00
parent 833d125f64
commit 14434bc2ac
261 changed files with 4530 additions and 1014 deletions
+9 -34
View File
@@ -3,10 +3,7 @@ include 'views/layouts/header.php';
?>
<h1>Редактирование серии: <?= e($series['title']) ?></h1>
<div class="grid">
<div>
<article>
<article>
<h2>Основная информация</h2>
<form method="post" action="/series/<?= $series['id'] ?>/edit">
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
@@ -23,18 +20,16 @@ include 'views/layouts/header.php';
<button type="submit" class="primary-btn">Сохранить изменения</button>
</form>
</article>
</article>
<div class="grid">
<div>
<article>
<h2>Добавить книгу в серию</h2>
<?php
$available_books = $bookModel->getBooksNotInSeries($_SESSION['user_id'], $series['id']);
?>
<?php if (!empty($available_books)): ?>
<form method="post" action="/series/<?= $series['id'] ?>/add-book">
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
<label for="book_id">
Выберите книгу
<select id="book_id" name="book_id" required>
@@ -44,17 +39,15 @@ include 'views/layouts/header.php';
<?php endforeach; ?>
</select>
</label>
<label for="sort_order">
Порядковый номер в серии
<input type="number" id="sort_order" name="sort_order" value="<?= count($books_in_series) + 1 ?>" min="1">
</label>
<button type="submit" class="secondary-btn">Добавить в серию</button>
</form>
<?php else: ?>
<p>Все ваши книги уже добавлены в эту серию или у вас нет доступных книг.</p>
<a href="/books/create" class="primary-btn">Создать новую книгу</a>
<a href="/books/create" class="primary-btn" role="button">Создать новую книгу</a>
<?php endif; ?>
</article>
</div>
@@ -76,12 +69,12 @@ include 'views/layouts/header.php';
<strong><?= e($book['title']) ?></strong>
<small>Порядок: <?= $book['sort_order_in_series'] ?></small>
</div>
<div class="book-actions">
<a href="/books/<?= $book['id'] ?>/edit" class="compact-button">Редактировать</a>
<div class="book-actions" style="display: grid; min-width: 2rem; margin-top: 1rem;">
<a href="/books/<?= $book['id'] ?>/edit" class="compact-button" role="button" style="margin-top: 0em;">✏️</a>
<form method="post" action="/series/<?= $series['id'] ?>/remove-book/<?= $book['id'] ?>"
style="display: inline;" onsubmit="return confirm('Удалить книгу из серии?')">
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
<button type="submit" class="compact-button delete-btn">Удалить</button>
<button type="submit" class="compact-button red-btn" style="margin-top: 0em;">🗑️</button>
</form>
</div>
<input type="hidden" name="order[]" value="<?= $book['id'] ?>">
@@ -98,24 +91,6 @@ include 'views/layouts/header.php';
<p>В этой серии пока нет книг. Добавьте книги с помощью формы слева.</p>
<?php endif; ?>
</article>
<article>
<h2>Статистика серии</h2>
<div class="stats-list">
<p><strong>Количество книг:</strong> <?= count($books_in_series) ?></p>
<?php
$total_words = 0;
$total_chapters = 0;
foreach ($books_in_series as $book) {
$stats = $bookModel->getBookStats($book['id']);
$total_words += $stats['total_words'] ?? 0;
$total_chapters += $stats['chapter_count'] ?? 0;
}
?>
<p><strong>Всего глав:</strong> <?= $total_chapters ?></p>
<p><strong>Всего слов:</strong> <?= $total_words ?></p>
</div>
</article>
</div>
</div>
Regular → Executable
+7 -8
View File
@@ -2,9 +2,9 @@
include 'views/layouts/header.php';
?>
<div style="display: flex; justify-content: between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;">
<div style="display: block; justify-content: between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;">
<h1 style="margin: 0;">Мои серии книг</h1>
<a href="/series/create" class="action-button primary"> Создать серию</a>
<a href="/series/create" class="action-button primary" role="button">➕ Создать серию</a>
</div>
<?php if (empty($series)): ?>
@@ -15,7 +15,7 @@ include 'views/layouts/header.php';
Создайте свою первую серию, чтобы организовать книги в циклы и сериалы.
</p>
<div style="display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;">
<a href="/series/create" class="action-button primary">Создать серию</a>
<a href="/series/create" class="action-button primary" role="button">Создать серию</a>
<a href="/books" class="action-button secondary">Перейти к книгам</a>
</div>
</article>
@@ -61,18 +61,17 @@ include 'views/layouts/header.php';
</div>
</div>
<div class="series-actions">
<a href="/series/<?= $ser['id'] ?>/edit" class="compact-button primary-btn">
<div class="series-actions" style="display:grid;">
<a href="/series/<?= $ser['id'] ?>/edit" class="compact-button primary-btn" role="button">
✏️ Управление
</a>
<a href="/series/<?= $ser['id'] ?>/view" class="compact-button secondary-btn" target="_blank">
<a href="/series/<?= $ser['id'] ?>/view" class="compact-button secondary-btn" target="_blank" role="button">
👁️ Публично
</a>
<form method="post" action="/series/<?= $ser['id'] ?>/delete"
style="display: inline;"
onsubmit="return confirm('Удалить серию? Книги останутся, но будут удалены из серии.')">
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
<button type="submit" class="compact-button delete-btn">🗑️</button>
<button type="submit" class="compact-button red-btn">🗑️ Удалить</button>
</form>
</div>
</article>