2023-06-13 17:03:36 +03:00
{% set selected_tab='explore_books' %}
<!-- prettier - ignore -->
{% extends 'base.html' %}
{% block content %}
< div class = "border-b pt-1 border-gray-200 dark:border-gray-700" >
<!-- prettier - ignore -->
< h1 class = "hidden md:inline font-extrabold text-lg dark:text-white ml-4 mt-5" > Open Common Law< / h1 >
< div class = "flex justify-between" >
< p
class="hidden md:block text-sm ml-4 w-1/2 text-gray-500 text-center md:text-left dark:text-gray-400">
An open-source law hosting platform that allows online communities to
easily create, collaborate, and publish their own body of law.
< / p >
< div class = "flex" >
<!-- prettier - ignore -->
{% if current_user.is_authenticated %}
{% include 'book/components/header_buttons.html' %}
{% endif %}
< / div >
< / div >
<!-- prettier - ignore -->
< ul class = "flex md:flex-wrap -mb-px text-xs md:text-sm font-medium text-center" id = "myTab" data-tabs-toggle = "#myTabContent" role = "tablist" >
< li class = "mr-2 w-full md:w-auto" role = "presentation" >
<!-- prettier - ignore -->
< a href = "{{url_for('home.get_all')}}" class = "inline-flex p-4 rounded-t-lg" id = "last-interpretations-tab" data-tabs-target = "#last-interpretations" type = "button" role = "tab" aria-controls = "last-interpretations" aria-selected = "false" > < svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "w-6 h-6 mr-3" > < path stroke-linecap = "round" stroke-linejoin = "round" d = "M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" / > < / svg >
Latest Interpretations
< / a >
< / li >
< li class = "mr-2 w-full md:w-auto" role = "presentation" >
<!-- prettier - ignore -->
< button class = "inline-flex p-4 rounded-t-lg hover:text-gray-600 dark:hover:text-gray-300" id = "explore-books-tab" data-tabs-target = "#explore-books" type = "button" role = "tab" aria-controls = "explore-books" aria-selected = "true" > < svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "w-6 h-6 mr-3" > < path stroke-linecap = "round" stroke-linejoin = "round" d = "M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9" / > < / svg >
Explore Books
< / button >
< / li >
< / ul >
< / div >
< div id = "myTabContent" >
<!-- prettier - ignore -->
< div class = "hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800" id = "last-interpretations" role = "tabpanel" aria-labelledby = "last-interpretations-tab" > < / div >
< div
class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800"
id="explore-books"
role="tabpanel"
aria-labelledby="explore-books-tab">
2023-06-15 15:58:57 +03:00
{% if not books.total %}
< p
class="hidden md:block text-l ml-4 w-1/2 mt-2 text-gray-500 text-center md:text-left dark:text-gray-400">
Books not found!
< / p >
{% endif %} {% for book in books if not book.is_deleted %}
2023-06-13 17:03:36 +03:00
<!-- prettier - ignore -->
< dl class = " bg-white dark:bg-gray-900 max-w-full p-5 text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700 m-3 border-2 border-gray-200 border-solid rounded-lg dark:border-gray-700" >
< dt class = "mb-2" > < a class = "flex flex-col" href = "{{url_for('book.collection_view',book_id=book.id)}}" > {{book.label}}< / a > < / dt >
< dd class = "flex flex-col md:flex-row text-lg font-semibold text-gray-500 md:text-lg dark:text-gray-400" >
{% if book.versions %}
< p > Last updated by < a href = "{{url_for('user.profile',user_id=book.owner.id)}}" class = " text-blue-500 {% if book.owner.is_deleted %}line-through{% endif %}" > {{book.owner.username}}< / a > on {{book.versions[-1].updated_at.strftime('%B %d, %Y')}} < / p >
{% endif %}
< div class = "flex ml-auto align-center justify-center space-x-3" >
< span class = "book-star-block space-x-0.5 flex items-center" >
< svg class = "star-btn cursor-pointer w-4 h-4 inline-flex mr-1 {% if book.current_user_has_star %}fill-yellow-300{% endif %}" data-book-id = {{ book . id } } xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 22 22" stroke-width = "1" stroke = "currentColor" > < path stroke-linecap = "round" stroke-linejoin = "round" d = "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" / > < / svg >
< a href = "{{ url_for('book.statistic_view', book_id=book.id ) }}" class = "total-stars" > {{ book.stars|length }}< / a >
< / span >
< span class = "space-x-0.5 flex items-center" >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 22 22" stroke-width = "1" stroke = "currentColor" class = "w-4 h-4 inline-flex mr-1" > < path stroke-linecap = "round" stroke-linejoin = "round" d = "M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" / > < / svg >
< p > {{ book.interpretations|length }}< / p >
< / span >
< span class = "space-x-0.5 flex items-center" >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 22 22" stroke-width = "1" stroke = "currentColor" class = "w-4 h-4 inline-flex mr-1" > < path stroke-linecap = "round" stroke-linejoin = "round" d = "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" / > < / svg >
< p > {{ book.approved_comments|length }}< / p >
< / span >
< / div >
< / dd >
< / dl >
{% endfor %}
< / div >
< / div >
{% endblock %}