| 
                        123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 | 
                        - {% extends 'base.html' %}
 - 
 - {% block content %}
 - 
 -     {% if book['thumbnail'] %}
 -         <img class="img-fluid mx-auto d-block py-3" src={{ book['thumbnail'] }} alt="cover for {{ book['Title'] }}">
 -     {% else %}
 -         <div class="row">
 -             <div class="col">
 -                 <h1 class="text-center">{% block title %} {{ book['Title'] or resource['name'] }} {% endblock %}</h1>
 -             </div>
 -         </div>
 -     {% endif %}
 -     {% 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 class="row">
 -         <div class="col">
 -             <table class="table table-hover">
 -                 <tbody>
 -                     {% if resource['typology'] %}
 -                     <tr>
 -                         <th>
 -                             Typology category:
 -                         </th>
 -                         <td>
 -                             <a href="{{ 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="row">
 -         <div class="col">
 -             <h2 class="text-center">Linked resources:</h2>
 -         </div>
 -     </div>
 -     <div class="row">
 -     {% for relationship in relationships %}
 -         <div class="col-md-4 col-sm-6 py-3">
 -         {% if relationship['type'] == 'tool' %}
 -         <div class="card text-dark bg-tool mb-3">
 -             <div class="card-body">
 -                 <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
 -                     <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
 -                 </a>
 -                 <p class="card-text">
 -                     {{ relationship['description']|truncate(100) }}
 -                 </p>
 -             </div>
 -         </div>
 -         {% elif relationship['type'] == 'practice' %}
 -         <div class="card text-dark bg-practice mb-3">
 -             <div class="card-body">
 -                 <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
 -                     <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
 -                 </a>
 -                 <p class="card-text">
 -                     {{ relationship['description']|truncate(100) }}
 -                 </p>
 -             </div>
 -         </div>
 -         {% elif relationship['type'] == 'book' %}
 -         <div class="card text-dark bg-book mb-3">
 -             <div class="card-body">
 -                 <a href="{{ url_for('book.show_book', book_id=relationship['id']) }}">
 -                     <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
 -                 </a>
 -                 <p class="card-text">
 -                     {{ relationship['description']|truncate(100) }}
 -                 </p>
 -             </div>
 -         </div>
 -         {% endif %}
 -         </div>
 -     {% endfor %}
 -     </div>
 -     {% endif %}
 - {% endblock %}
 
 
  |