Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

172 rindas
6.3KB

  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="cell-margin">
  4. {% if book['thumbnail'] %}
  5. <img class="w-40 h-40 object-contain float-right m-16 grayscale rotate-[15deg]" src={{ book['thumbnail'] }} alt="cover for {{ book['Title'] }}">
  6. {% endif %}
  7. <h2 class="max-w-[30rem]">{% block title %} {{ book['Title'] or resource['name'] }} {% endblock %}</h2>
  8. {% if current_user.is_authenticated %}
  9. <div class="row text-center py-3">
  10. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  11. <span class="badge bg-dark">Edit</span>
  12. </a>
  13. </div>
  14. {% endif %}
  15. </div>
  16. <div class="row block-margin">
  17. <div class="col">
  18. <table class="table table-hover">
  19. <tbody>
  20. {% if resource['typology'] %}
  21. <tr>
  22. <th>
  23. Typology category:
  24. </th>
  25. <td>
  26. <a href="/books?typology={{ resource['typology'] }}">{{ resource['typology'] }}</a>
  27. </td>
  28. </tr>
  29. {% endif %}
  30. {% if resource['bookUrl'] %}
  31. <tr>
  32. <th>
  33. URL:
  34. </th>
  35. <td>
  36. <a href="{{ resource['bookUrl'] }}">{{ resource['bookUrl'] }}</a>
  37. </td>
  38. </tr>
  39. {% endif %}
  40. {% if book %}
  41. <!-- fields for books from isbntools -->
  42. {% if book['Title'] %}
  43. <tr>
  44. <th>
  45. Title:
  46. </th>
  47. <td>
  48. {{ book['Title'] }}
  49. </td>
  50. </tr>
  51. {% endif %}
  52. {% if book['Authors'] %}
  53. <tr>
  54. {% if book['Authors']|length > 1 %}
  55. <th>
  56. Authors:
  57. </th>
  58. <td>
  59. {% for author in book['Authors'] %}
  60. {{ author }}</br>
  61. {% endfor %}
  62. </td>
  63. {% else %}
  64. <th>
  65. Author:
  66. </th>
  67. <td>
  68. {% for author in book['Authors'] %}
  69. {{ author }}
  70. {% endfor %}
  71. </td>
  72. {% endif %}
  73. </tr>
  74. {% endif %}
  75. {% if book['ISBN-13'] %}
  76. <tr>
  77. <th>
  78. ISBN-13:
  79. </th>
  80. <td>
  81. {{ book['ISBN-13'] }}
  82. </td>
  83. </tr>
  84. {% endif %}
  85. {% if book['Year'] %}
  86. <tr>
  87. <th>
  88. Publication year:
  89. </th>
  90. <td>
  91. {{ book['Year'] }}
  92. </td>
  93. </tr>
  94. {% endif %}
  95. {% if book['Publisher'] %}
  96. <tr>
  97. <th>
  98. Publisher:
  99. </th>
  100. <td>
  101. {{ book['Publisher'] }}
  102. </td>
  103. </tr>
  104. {% endif %}
  105. {% if book['desc'] %}
  106. <tr>
  107. <th>
  108. Publisher's description:
  109. </th>
  110. <td>
  111. {{ book['desc'] }}
  112. </td>
  113. </tr>
  114. {% endif %}
  115. {% else %}
  116. <!-- fields for books from database -->
  117. {% if resource['name'] %}
  118. <tr>
  119. <th>
  120. Title:
  121. </th>
  122. <td>
  123. {{ resource['name'] }}
  124. </td>
  125. </tr>
  126. {% endif %}
  127. {% if resource['author'] %}
  128. <tr>
  129. <th>
  130. Author:
  131. </th>
  132. <td>
  133. {{ resource['author'] }}
  134. </td>
  135. </tr>
  136. {% endif %}
  137. {% if resource['year'] %}
  138. <tr>
  139. <th>
  140. Publication year:
  141. </th>
  142. <td>
  143. {{ resource['year'] }}
  144. </td>
  145. </tr>
  146. {% endif %}
  147. {% endif %}
  148. {% if resource['description'] %}
  149. <tr>
  150. <th>
  151. Experimental aspects:
  152. </th>
  153. <td>
  154. {{ resource['description'] }}
  155. </td>
  156. </tr>
  157. {% endif %}
  158. </tbody>
  159. </table>
  160. </div>
  161. </div>
  162. {% if relationships %}
  163. <div class="grid lg:grid-cols-3">
  164. {% for relationship in relationships %}
  165. {{ resource_small(relationship)}}
  166. {% endfor %}
  167. </div>
  168. {% endif %}
  169. {% endblock %}