супер попа (обновление)

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich
2022-04-16 17:30:06 +10:00
parent c8025acc79
commit 30fd8f0ec3
14 changed files with 623 additions and 338 deletions

View File

@@ -3,9 +3,16 @@
{% block main %}
<link href="/css/books.css" rel="stylesheet">
<article class="book">
<img src="/books/{{ book.id|e }}/cover" alt='Обложка книги "{{ book.title|e }}"'>
<h3><a href="/books/{{ book.id|e }}">{{ book.title|e }}</a></h3>
<p>{{ book.description|e|length|trim(' ') > 80 ? book.description|e|slice(0, 80)|trim(' ') ~ '...' : book.description|e}}</p>
</article>
<section id="book">
<h2>{{ book.title|e }}</h2>
<img class="unselectable" src="/storage/books/{{ book.id|e }}/{{ page|e }}" alt='Страница отсутствует'>
<nav>
<ul>
{% if page != 0 %}
<li class="previous unselectable" type="button"><a href="/books/{{ book.id|e }}/{{ page|e - 1 }}" title="Страница №{{ page|e - 1 }}">Назад</a></li>
{% endif %}
<li class="next unselectable" type="button"><a href="/books/{{ book.id|e }}/{{ page|e + 1 }}" title="Страница №{{ page|e + 1 }}">Вперёд</a></li>
</ul>
</nav>
</section>
{% endblock %}

View File

@@ -5,13 +5,17 @@
<link href="/css/upload.css" rel="stylesheet">
<section id="books">
<form class="upload" action="/books/write" enctype="multipart/form-data" method="POST">
{% if account is not empty %}
{% if account.permissions.books is defined and account.permissions.books == 1 %}
<form class="upload unselectable" action="/storage/books/write" enctype="multipart/form-data" method="POST">
<input type="file" name="books[]" accept=".pdf" oninput="this.parentElement.submit();" multiple="true">
<p>+</p>
</form>
{% endif %}
{% endif %}
{% for book in books %}
<article class="book">
<img src="/books/{{ book.id|e }}/cover" alt='Обложка книги "{{ book.title|e }}"'>
<img src="/storage/books/{{ book.id|e }}/0" class="unselectable" alt='Обложка книги "{{ book.title|e }}"'>
<h4><a href="/books/{{ book.id|e }}">{{ book.title|e }}</a></h3>
</article>
{% endfor %}