|
- {% extends 'base.html' %}
-
- {% block content %}
-
- <div class="cell-margin">
- {% if book['thumbnail'] %}
- <img class="w-40 h-40 object-contain float-right m-16 grayscale rotate-[15deg]" src={{ book['thumbnail'] }} alt="cover for {{ book['Title'] }}">
- {% endif %}
- <h2 class="max-w-[30rem]">{% block title %} {{ book['Title'] or resource['name'] }} {% endblock %}</h2>
- {% if current_user.is_authenticated %}
- <div class="row text-center py-3">
- <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
- <span class="badge bg-dark">Edit</span>
- </a>
- </div>
- {% endif %}
- </div>
- <div class="row block-margin">
- <div class="col">
- <table class="table table-hover">
- <tbody>
- {% if resource['typology'] %}
- <tr>
- <th>
- Typology category:
- </th>
- <td>
- <a href="/books?typology={{ resource['typology'] }}">{{ resource['typology'] }}</a>
- </td>
- </tr>
- {% endif %}
- {% if resource['bookUrl'] %}
- <tr>
- <th>
- URL:
- </th>
- <td>
- <a href="{{ resource['bookUrl'] }}">{{ resource['bookUrl'] }}</a>
- </td>
- </tr>
- {% endif %}
- {% if book %}
- <!-- fields for books from isbntools -->
- {% if book['Title'] %}
- <tr>
- <th>
- Title:
- </th>
- <td>
- {{ book['Title'] }}
- </td>
- </tr>
- {% endif %}
- {% if book['Authors'] %}
- <tr>
- {% if book['Authors']|length > 1 %}
- <th>
- Authors:
- </th>
- <td>
- {% for author in book['Authors'] %}
- {{ author }}</br>
- {% endfor %}
- </td>
- {% else %}
- <th>
- Author:
- </th>
- <td>
- {% for author in book['Authors'] %}
- {{ author }}
- {% endfor %}
- </td>
- {% endif %}
- </tr>
- {% endif %}
- {% if book['ISBN-13'] %}
- <tr>
- <th>
- ISBN-13:
- </th>
- <td>
- {{ book['ISBN-13'] }}
- </td>
- </tr>
- {% endif %}
- {% if book['Year'] %}
- <tr>
- <th>
- Publication year:
- </th>
- <td>
- {{ book['Year'] }}
- </td>
- </tr>
- {% endif %}
- {% if book['Publisher'] %}
- <tr>
- <th>
- Publisher:
- </th>
- <td>
- {{ book['Publisher'] }}
- </td>
- </tr>
- {% endif %}
- {% if book['desc'] %}
- <tr>
- <th>
- Publisher's description:
- </th>
- <td>
- {{ book['desc'] }}
- </td>
- </tr>
- {% endif %}
- {% else %}
- <!-- fields for books from database -->
- {% if resource['name'] %}
- <tr>
- <th>
- Title:
- </th>
- <td>
- {{ resource['name'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['author'] %}
- <tr>
- <th>
- Author:
- </th>
- <td>
- {{ resource['author'] }}
- </td>
- </tr>
- {% endif %}
- {% if resource['year'] %}
- <tr>
- <th>
- Publication year:
- </th>
- <td>
- {{ resource['year'] }}
- </td>
- </tr>
- {% endif %}
- {% endif %}
- {% if resource['description'] %}
- <tr>
- <th>
- Experimental aspects:
- </th>
- <td>
- {{ resource['description'] }}
- </td>
- </tr>
- {% endif %}
- </tbody>
- </table>
- </div>
- </div>
- {% if relationships %}
- <div class="grid lg:grid-cols-3">
- {% for relationship in relationships %}
- {{ resource_small(relationship)}}
- {% endfor %}
- </div>
- {% endif %}
- {% endblock %}
|