Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

142 lines
5.0KB

  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="cell-margin grid mt-16 lg:grid-cols-2">
  4. <div class="left">
  5. <div class="mb-2">Book</div>
  6. <div class="lg:border-r-2 border-black pr-8 resource">
  7. {% if resource.references %}
  8. <div class="float-right">
  9. <img class="w-14 h-14 lg:w-40 lg:h-40 object-contain lg:m-16 rotate-[15deg]" src={{ resource.references
  10. }} alt="cover for {{ resource['Title'] }}">
  11. </div>
  12. {% endif %}
  13. <h2 class="book huge-title mb-2 max-w-[30rem]">{% block title %} {{ resource.name }} {% endblock %}</h2>
  14. {% if resource['Year'] %}
  15. {{ resource['Year'] }}
  16. {% endif %}
  17. {% if resource['Authors'] %}
  18. <div class="">
  19. {% if resource['Authors']|length > 1 %}
  20. <div class="">
  21. {% for author in resource['Authors'] %}
  22. {{ author }}</br>
  23. {% endfor %}
  24. </div>
  25. {% else %}
  26. <div>
  27. {% for author in resource['Authors'] %}
  28. {{ author }}
  29. {% endfor %}
  30. </div>
  31. {% endif %}
  32. </div>
  33. {% endif %}
  34. <div class="">
  35. {% if current_user.is_authenticated %}
  36. <div class="">
  37. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  38. <span class="badge bg-dark">Edit</span>
  39. </a>
  40. </div>
  41. {% endif %}
  42. <div class="facts ">
  43. {% if resource['typology'] %}
  44. <div class="">
  45. <h3>Typology category</h3>
  46. <a href="/books?typology={{ resource['typology'] }}">{{ resource['typology'] }}</a>
  47. </div>
  48. {% endif %}
  49. {% if resource['bookUrl'] %}
  50. <div class="">
  51. <h3>URL</h3>
  52. <a target="_blank" href="{{ resource['bookUrl'] }}">{{ resource['bookUrl'] }}</a>
  53. </div>
  54. {% endif %}
  55. <!-- fields for books from isbntools -->
  56. {% if resource['ISBN-13'] %}
  57. <div class="">
  58. <h3>
  59. ISBN-13
  60. </h3>
  61. <div>
  62. {{ resource['ISBN-13'] }}
  63. </div>
  64. </div>
  65. {% endif %}
  66. {% if resource['Publisher'] %}
  67. <div class="">
  68. <h3>
  69. Publisher
  70. </h3>
  71. <div>
  72. {{ resource['Publisher'] }}
  73. </div>
  74. </div>
  75. {% endif %}
  76. <!-- fields for books from database -->
  77. {% if resource['name'] %}
  78. <!-- <div class="">
  79. <h3>Title</h3>
  80. <div class="">{{ resource['name'] }}</div>
  81. </div> -->
  82. {% endif %}
  83. {% if resource['author'] %}
  84. <div class="">
  85. <h3>
  86. {% if ' and ' in resource['author'] or ',' in resource['author'] %}
  87. Authors
  88. {% else %}
  89. Author
  90. {% endif %}
  91. </h3>
  92. <div class="">{{ resource['author'] }}</div>
  93. </div>
  94. {% endif %}
  95. {% if resource['year'] %}
  96. <div class="">
  97. <h3>Publication year</h3>
  98. <div>
  99. {{ resource['year'] }}
  100. </div>
  101. </div>
  102. {% endif %}
  103. {% if resource['desc'] %}
  104. <div class="lg:col-span-2">
  105. <h3>Publisher's description</h3>
  106. <div class="">{{ resource['desc'] }}</div>
  107. </div>
  108. {% endif %}
  109. {% if resource['description'] %}
  110. <div class="lg:col-span-2">
  111. <h3>
  112. Experimental aspects:
  113. </h3>
  114. <div>
  115. {{ resource['description']|safe }}
  116. </div>
  117. </div>
  118. {% endif %}
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="right p-4 pr-8 lg:p-0">
  124. <div class="grid lg:grid-cols-2">
  125. {{ relationships_links(resource) }}
  126. </div>
  127. </div>
  128. </div>
  129. {% endblock %}