2023-04-21 07:48:06 +00:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% extends 'base.html' %}
|
2023-05-10 12:38:29 +00:00
|
|
|
{% set selected_tab='my_library' %}
|
2023-05-26 13:01:31 +00:00
|
|
|
|
|
|
|
{% block title %}My Library{% endblock %}
|
|
|
|
|
2023-04-21 07:48:06 +00:00
|
|
|
{% block content %}
|
2023-04-24 08:31:54 +00:00
|
|
|
|
2023-05-16 10:27:19 +00:00
|
|
|
{% if current_user.is_authenticated %}
|
2023-05-30 14:00:18 +00:00
|
|
|
{% include 'book/modals/add_book_modal.html' %}
|
2023-05-16 10:27:19 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2023-06-20 13:50:30 +00:00
|
|
|
<div class="pt-1 relative sm:rounded-lg mt-1 h-box flex flex-col">
|
2023-05-10 14:40:52 +00:00
|
|
|
{% if not current_user.is_authenticated %}
|
2023-06-20 13:50:30 +00:00
|
|
|
<div class="mx-auto my-auto h-full w-full p-2">
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
id="connectWalletBtn"
|
|
|
|
class="w-full h-full text-black dark:text-white focus:ring-4 focus:outline-none focus:ring-blue-100 font-medium rounded-lg text-sm px-4 py-2.5 justify-center text-center inline-flex items-center border border-gray-200 dark:border-gray-700">
|
2023-06-22 06:11:54 +00:00
|
|
|
<div class="my-auto">Connect your wallet to see your library!</div>
|
2023-06-20 13:50:30 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{% endif %} {% if current_user.is_authenticated and not books.total %}
|
2023-06-22 10:07:18 +00:00
|
|
|
{% if current_user.is_authenticated and books.total<1 %}
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<div class="mx-auto my-auto h-full w-full ">
|
|
|
|
<button type="button" data-modal-target="add-book-modal" data-modal-toggle="add-book-modal" class="w-full h-full text-black dark:text-white focus:ring-4 focus:outline-none focus:ring-blue-100 font-medium rounded-lg text-sm px-4 py-2.5 justify-center text-center inline-flex items-center border border-gray-200 dark:border-gray-700"> New book </div></a></div>
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% endif %}
|
2023-05-10 14:40:52 +00:00
|
|
|
{% endif %}
|
2023-06-15 08:54:09 +00:00
|
|
|
|
2023-05-10 14:40:52 +00:00
|
|
|
<!-- prettier-ignore -->
|
2023-06-15 09:52:51 +00:00
|
|
|
{% if current_user.is_authenticated and books.total %}
|
2023-06-20 13:50:30 +00:00
|
|
|
<div class="flex flex-col w-full">
|
2023-06-21 12:22:54 +00:00
|
|
|
<div class="flex justify-between items-center mt-1">
|
2023-06-22 06:09:31 +00:00
|
|
|
<h1 class="text-[2rem] font-extrabold dark:text-white ml-4">
|
|
|
|
My library
|
|
|
|
</h1>
|
|
|
|
{% if current_user.is_authenticated %} {% include
|
|
|
|
'book/components/header_buttons.html' %} {% endif %}
|
2023-06-15 08:54:09 +00:00
|
|
|
</div>
|
2023-06-20 13:50:30 +00:00
|
|
|
</div>
|
2023-06-22 06:09:31 +00:00
|
|
|
<div
|
|
|
|
class="md:hidden flex justify-between border-b py-3 px-4 border-gray-200 dark:border-gray-700">
|
|
|
|
{% include 'book/components/new_book_btn.html' %} {% include
|
|
|
|
'book/components/sort_by_btn.html' %}
|
2023-06-21 13:22:14 +00:00
|
|
|
</div>
|
2023-06-22 06:09:31 +00:00
|
|
|
{% endif %}
|
2023-06-21 13:22:14 +00:00
|
|
|
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% for book in books if not book.is_deleted %}
|
|
|
|
{% include 'book/components/book_list_item.html' %}
|
|
|
|
{% endfor %}
|
2023-05-22 11:17:52 +00:00
|
|
|
|
2023-05-01 08:15:57 +00:00
|
|
|
<!-- prettier-ignore -->
|
2023-05-10 14:40:52 +00:00
|
|
|
{% if current_user.is_authenticated and page.pages > 1 %}
|
2023-06-20 13:50:30 +00:00
|
|
|
<div class="container content-center mt-3 flex bg-white dark:bg-gray-800">
|
|
|
|
<nav aria-label="Page navigation example" class="mx-auto">
|
|
|
|
<ul class="inline-flex items-center -space-x-px">
|
|
|
|
<li>
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page=1&q={{page.query}}" class="block px-3 py-2 ml-0 leading-tight text-gray-500 bg-white border border-gray-300 rounded-l-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
2023-06-15 08:54:09 +00:00
|
|
|
<span class="sr-only">First</span>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"> <path fill-rule="evenodd" d="M15.79 14.77a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L11.832 10l3.938 3.71a.75.75 0 01.02 1.06zm-6 0a.75.75 0 01-1.06.02l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 111.04 1.08L5.832 10l3.938 3.71a.75.75 0 01.02 1.06z" clip-rule="evenodd" /> </svg>
|
|
|
|
</a>
|
2023-06-20 13:50:30 +00:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page={{page.page-1 if page.page > 1 else 1}}&q={{page.query}}" class="block px-3 py-2 ml-0 leading-tight text-gray-500 bg-white border border-gray-300 rounded-l-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
2023-06-15 08:54:09 +00:00
|
|
|
<span class="sr-only">Previous</span>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"> <path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" /> </svg>
|
|
|
|
</a>
|
2023-06-20 13:50:30 +00:00
|
|
|
</li>
|
2023-05-01 08:15:57 +00:00
|
|
|
|
2023-06-20 13:50:30 +00:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% for p in page.pages_for_links %}
|
|
|
|
<li>
|
2023-05-01 08:15:57 +00:00
|
|
|
<!-- prettier-ignore -->
|
2023-06-20 13:50:30 +00:00
|
|
|
{% if p == page.page %}
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page={{p}}&q={{page.query}}" aria-current="page" class="z-10 px-3 py-2 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white">{{p}}</a>
|
|
|
|
{% else %}
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page={{p}}&q={{page.query}}" class="px-3 py-2 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">{{p}}</a>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
2023-05-01 08:15:57 +00:00
|
|
|
|
2023-06-20 13:50:30 +00:00
|
|
|
<li>
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page={{page.page+1 if page.page < page.pages else page.pages}}&q={{page.query}}" class="block px-3 py-2 leading-tight text-gray-500 bg-white border border-gray-300 rounded-r-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
2023-06-15 08:54:09 +00:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<span class="sr-only">Next</span>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"> <path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> </svg>
|
|
|
|
</a>
|
2023-06-20 13:50:30 +00:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<a href="{{ url_for('book.my_library') }}?page={{page.pages}}&q={{page.query}}" class="block px-3 py-2 leading-tight text-gray-500 bg-white border border-gray-300 rounded-r-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
2023-06-15 08:54:09 +00:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
<span class="sr-only">Last</span>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"> <path fill-rule="evenodd" d="M10.21 14.77a.75.75 0 01.02-1.06L14.168 10 10.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> <path fill-rule="evenodd" d="M4.21 14.77a.75.75 0 01.02-1.06L8.168 10 4.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> </svg>
|
|
|
|
</a>
|
2023-06-20 13:50:30 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
2023-05-01 08:15:57 +00:00
|
|
|
{% endif %}
|
2023-05-26 13:01:31 +00:00
|
|
|
</div>
|
2023-04-21 07:48:06 +00:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% endblock %}
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% block scripts %}
|
|
|
|
{% endblock %}
|