many fixes in design and add shirt story type for creation book
This commit is contained in:
@@ -40,12 +40,22 @@ include 'views/layouts/header.php';
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="d-flex justify-content-center gap-4 flex-wrap mb-4">
|
||||
<?php if (!$is_short_story): ?>
|
||||
<div class="text-center">
|
||||
<div class="h4 text-primary mb-0"><?= count($chapters) ?></div>
|
||||
<small class="text-muted">Глав</small>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="text-center">
|
||||
<div class="h4 text-success mb-0"><?= array_sum(array_column($chapters, 'word_count')) ?></div>
|
||||
<div class="h4 text-success mb-0">
|
||||
<?php if ($is_short_story && !empty($book['content'])): ?>
|
||||
<?= number_format(mb_strlen($book['content']) - mb_strlen(str_replace(' ', '', $book['content'])) + 1) ?>
|
||||
<?php elseif (!$is_short_story): ?>
|
||||
<?= array_sum(array_column($chapters, 'word_count')) ?>
|
||||
<?php else: ?>
|
||||
0
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<small class="text-muted">Слов</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,7 +91,13 @@ include 'views/layouts/header.php';
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if (empty($chapters)): ?>
|
||||
<?php if ($is_short_story && !empty($book['content'])): ?>
|
||||
<div class="chapter-content mb-5">
|
||||
<div class="chapter-text" style="line-height: 1.8; font-size: 1.1em;">
|
||||
<?= $book['content'] ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif (empty($chapters)): ?>
|
||||
<div class="text-center py-5">
|
||||
<i class="bi bi-file-text fs-1 text-muted"></i>
|
||||
<h3 class="h4 text-muted mt-3">В этой книге пока нет глав</h3>
|
||||
@@ -105,9 +121,9 @@ include 'views/layouts/header.php';
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr class="my-5">
|
||||
|
||||
|
||||
<?php foreach ($chapters as $index => $chapter): ?>
|
||||
<div class="chapter-content mb-5" id="chapter-<?= $chapter['id'] ?>">
|
||||
<h2 class="border-bottom pb-2 mb-4">
|
||||
@@ -117,7 +133,7 @@ include 'views/layouts/header.php';
|
||||
<div class="chapter-text" style="line-height: 1.8; font-size: 1.1em;">
|
||||
<?= $chapter['content'] ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center mt-4">
|
||||
<a href="#top" class="btn btn-outline-primary btn-sm">
|
||||
<i class="bi bi-arrow-up"></i> Наверх
|
||||
@@ -146,6 +162,7 @@ include 'views/layouts/header.php';
|
||||
.chapter-text p {
|
||||
margin-bottom: 1.5em;
|
||||
text-align: justify;
|
||||
text-indent: 2em;
|
||||
}
|
||||
|
||||
.chapter-text .dialogue {
|
||||
|
||||
Reference in New Issue
Block a user