finish line!
This commit is contained in:
+17
-17
@@ -97,14 +97,14 @@ include 'views/layouts/header.php';
|
||||
<button type="submit" class="contrast">
|
||||
💾 Сохранить изменения
|
||||
</button>
|
||||
<a href="<?= SITE_URL ?>/books" role="button" class="secondary">
|
||||
<!-- <a href="<?= SITE_URL ?>/books" role="button" class="secondary">
|
||||
❌ Отмена
|
||||
</a>
|
||||
</a> -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ($book): ?>
|
||||
<div style="margin-top: 2rem; padding: 1rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<div style="margin-top: 0.5rem; padding: 0rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<h3>Публичная ссылка для чтения</h3>
|
||||
<div style="display: flex; gap: 5px; align-items: center; flex-wrap: wrap;">
|
||||
<input type="text"
|
||||
@@ -112,12 +112,12 @@ include 'views/layouts/header.php';
|
||||
value="<?= e(SITE_URL . '/book/' . $book['share_token']) ?>"
|
||||
readonly
|
||||
style="flex: 1; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; background: white;">
|
||||
<button type="button" onclick="copyShareLink()" class="compact-button secondary">
|
||||
<button type="button" onclick="copyShareLink()" class="adaptive-button">
|
||||
📋 Копировать
|
||||
</button>
|
||||
<form method="post" action="<?= SITE_URL ?>/books/<?= $book['id'] ?>/regenerate-token" style="display: inline;">
|
||||
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
|
||||
<button type="submit" class="compact-button secondary" onclick="return confirm('Создать новую ссылку? Старая ссылка перестанет работать.')">
|
||||
<button type="submit" class="adaptive-button secondary" onclick="return confirm('Создать новую ссылку? Старая ссылка перестанет работать.')">
|
||||
🔄 Обновить
|
||||
</button>
|
||||
</form>
|
||||
@@ -126,20 +126,20 @@ include 'views/layouts/header.php';
|
||||
<strong>Примечание:</strong> В публичном просмотре отображаются только главы со статусом "Опубликована"
|
||||
</p>
|
||||
</div>
|
||||
<div style="margin-top: 2rem; padding: 1rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<div style="margin-top: 0.5rem; padding: 0rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<h3>Экспорт книги</h3>
|
||||
<p style="margin-bottom: 0.5rem;">Экспортируйте книгу в различные форматы:</p>
|
||||
<div style="display: flex; gap: 5px; flex-wrap: wrap;">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/pdf" class="adaptive-button secondary" target="_blank">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/pdf" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 PDF
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/docx" class="adaptive-button secondary" target="_blank">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/docx" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📝 DOCX
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/html" class="adaptive-button secondary" target="_blank">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/html" class="adaptive-button secondary" target="_blank" role="button">
|
||||
🌐 HTML
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/txt" class="adaptive-button secondary" target="_blank">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/txt" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 TXT
|
||||
</a>
|
||||
</div>
|
||||
@@ -147,13 +147,13 @@ include 'views/layouts/header.php';
|
||||
<strong>Примечание:</strong> Экспортируются все главы книги (включая черновики)
|
||||
</p>
|
||||
</div>
|
||||
<div style="margin-top: 3rem;">
|
||||
<div style="margin-top: 0.5rem;">
|
||||
<h2>Главы этой книги</h2>
|
||||
<div style="display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 1rem;">
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters" class="adaptive-button secondary">
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters" class="adaptive-button secondary" role="button">
|
||||
📑 Все главы
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters/create" class="adaptive-button secondary">
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters/create" class="adaptive-button secondary" role="button">
|
||||
✏️ Добавить главу
|
||||
</a>
|
||||
</div>
|
||||
@@ -189,18 +189,18 @@ include 'views/layouts/header.php';
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="text-align: center; padding: 2rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<div style="text-align: center; padding: 0.5rem; background: var(--card-background-color); border-radius: 5px;">
|
||||
<p style="margin-bottom: 1rem;">В этой книге пока нет глав.</p>
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters/create" class="adaptive-button secondary">
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters/create" class="adaptive-button secondary" role="button">
|
||||
✏️ Добавить первую главу
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div style="margin-top: 2rem; text-align: center;">
|
||||
<div style="margin-top: 0.5rem; text-align: center;">
|
||||
<form method="post" action="<?= SITE_URL ?>/books/<?= $book['id'] ?>/delete" style="display: inline;" onsubmit="return confirm('Вы уверены, что хотите удалить книгу «<?= e($book['title']) ?>»? Все главы также будут удалены.');">
|
||||
<input type="hidden" name="csrf_token" value="<?= generate_csrf_token() ?>">
|
||||
<button type="submit" class="button" style="background: #ff4444; border-color: #ff4444; color: white;">
|
||||
<button type="submit" class="adaptive-button red-btn">
|
||||
🗑️ Удалить книгу
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -6,8 +6,8 @@ include 'views/layouts/header.php';
|
||||
<h1>Мои книги <small style="color: #ccc; font-size:1rem;">(Всего книг: <?= count($books) ?>)</small></h1>
|
||||
|
||||
|
||||
<div style="display: flex; justify-content: right; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem;">
|
||||
<a href="<?= SITE_URL ?>/books/create" class="action-button primary">➕ Новая книга</a>
|
||||
<div style="display: flex; justify-content: left; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem;">
|
||||
<a href="<?= SITE_URL ?>/books/create" class="action-button primary" role="button">➕ Новая книга</a>
|
||||
<?php if (!empty($books)): ?>
|
||||
<a href="#" onclick="showDeleteAllConfirmation()" class="action-button delete">🗑️ Удалить все книги</a>
|
||||
<?php endif; ?>
|
||||
@@ -81,7 +81,7 @@ include 'views/layouts/header.php';
|
||||
<a href="<?= SITE_URL ?>/books/<?= $book['id'] ?>/chapters" class="compact-button secondary-btn">
|
||||
📑 Главы
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/book/<?= $book['share_token'] ?>" class="compact-button secondary-btn" target="_blank">
|
||||
<a href="<?= SITE_URL ?>/book/<?= $book['share_token'] ?>" class="compact-button green-btn" target="_blank">
|
||||
👁️ Просмотр
|
||||
</a>
|
||||
</div>
|
||||
|
||||
+43
-32
@@ -3,8 +3,8 @@
|
||||
include 'views/layouts/header.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<article style="max-width: 800px; margin: 0 auto;">
|
||||
<div class="container" style="padding: 0em; margin: 0em auto; width: 90%;">
|
||||
<article style="margin: 0 auto;">
|
||||
<header style="text-align: center; margin-bottom: 2rem;">
|
||||
<?php if (!empty($book['cover_image'])): ?>
|
||||
<div style="margin-bottom: 1rem;">
|
||||
@@ -18,7 +18,7 @@ include 'views/layouts/header.php';
|
||||
<h1 style="margin-bottom: 0.5rem;"><?= e($book['title']) ?></h1>
|
||||
|
||||
<p style="color: #666; font-style: italic; margin-bottom: 0.5rem;">
|
||||
Автор: <a href="<?= SITE_URL ?>/author/<?= $book['user_id'] ?>"><?= e($author_name) ?></a>
|
||||
Автор: <a href="<?= SITE_URL ?>/author/<?= $book['user_id'] ?>"><?= e($author['display_name']??$author['username']) ?></a>
|
||||
</p>
|
||||
|
||||
<?php if (!empty($book['genre'])): ?>
|
||||
@@ -33,12 +33,43 @@ include 'views/layouts/header.php';
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; font-size: 0.9em; color: #666;">
|
||||
<div style="display: block; justify-content: center; gap: 1rem; flex-wrap: wrap; font-size: 0.9em; color: #666;">
|
||||
<span>Глав: <?= count($chapters) ?></span>
|
||||
<span>Слов: <?= array_sum(array_column($chapters, 'word_count')) ?></span>
|
||||
<a href="<?= SITE_URL ?>/export/shared/<?= $book['share_token'] ?>" class="adaptive-button secondary" style="font-size: 0.8em;">
|
||||
📄 Скачать книгу
|
||||
</a>
|
||||
<p>
|
||||
<?php if (!is_logged_in()): ?>
|
||||
<div style="display: flex; gap: 5px; flex-wrap: wrap; justify-content: center;">
|
||||
<a href="<?= SITE_URL ?>/export/shared/<?= $book['share_token'] ?>/pdf" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 PDF
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/shared/<?= $book['share_token'] ?>/docx" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📝 DOCX
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/shared/<?= $book['share_token'] ?>/html" class="adaptive-button secondary" target="_blank" role="button">
|
||||
🌐 HTML
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/shared/<?= $book['share_token'] ?>/txt" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 TXT
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (is_logged_in()): ?>
|
||||
<div style="display: flex; gap: 5px; flex-wrap: wrap; justify-content: center;">
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/pdf" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 PDF
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/docx" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📝 DOCX
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/html" class="adaptive-button secondary" target="_blank" role="button">
|
||||
🌐 HTML
|
||||
</a>
|
||||
<a href="<?= SITE_URL ?>/export/<?= $book['id'] ?>/txt" class="adaptive-button secondary" target="_blank" role="button">
|
||||
📄 TXT
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -48,23 +79,15 @@ include 'views/layouts/header.php';
|
||||
<p>Автор еще не опубликовал содержание книги</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<h2 style="text-align: center; margin-bottom: 2rem;">Оглавление</h2>
|
||||
|
||||
<h3 style="text-align: center; margin-bottom: 2rem; margin-top: 0em;">Оглавление</h3>
|
||||
<div class="chapters-list">
|
||||
<?php foreach ($chapters as $index => $chapter): ?>
|
||||
<article style="margin-bottom: 1rem; padding: 1rem; background: var(--card-background-color); border-radius: 8px;">
|
||||
<h3 style="margin-top: 0;">
|
||||
|
||||
<h6 style="margin-top: 0; margin-bottom: 0em;">
|
||||
<a href="#chapter-<?= $chapter['id'] ?>" style="text-decoration: none;">
|
||||
Глава <?= $index + 1 ?>: <?= e($chapter['title']) ?>
|
||||
</a>
|
||||
</h3>
|
||||
<div style="display: flex; gap: 10px; align-items: center;">
|
||||
<small style="color: var(--muted-color);">
|
||||
Слов: <?= $chapter['word_count'] ?>
|
||||
| Обновлено: <?= date('d.m.Y', strtotime($chapter['updated_at'])) ?>
|
||||
</small>
|
||||
</div>
|
||||
</article>
|
||||
</h6>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
@@ -77,20 +100,8 @@ include 'views/layouts/header.php';
|
||||
</h2>
|
||||
|
||||
<div style="margin-top: 1.5rem; line-height: 1.6;">
|
||||
<?php if ($book['editor_type'] == 'markdown'): ?>
|
||||
<?= $Parsedown->text($chapter['content']) ?>
|
||||
<?php else: ?>
|
||||
<?= $chapter['content'] ?>
|
||||
<?php endif; ?>
|
||||
<?= $chapter['content'] ?>
|
||||
</div>
|
||||
|
||||
<?php if ($index < count($chapters) - 1): ?>
|
||||
<div style="text-align: center; margin-top: 2rem;">
|
||||
<a href="#chapter-<?= $chapters[$index + 1]['id'] ?>" class="button">
|
||||
📖 Следующая глава
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user