Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

book.html 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="cell-margin grid grid-cols-[2fr,1fr]">
  4. <div class="left">
  5. <div class="mb-8">
  6. <div class="mb-2">Book</div>
  7. {% if resource['thumbnail'] %}
  8. <div class="float-right">
  9. <img class="w-40 h-40 object-contain m-16 rotate-[15deg]" src={{ resource['thumbnail'] }} alt="cover for {{ resource['Title'] }}">
  10. </div>
  11. {% endif %}
  12. <h2 class="book mb-2 max-w-[30rem]">{% block title %} {{ resource['Title'] or resource['name'] }} {% endblock %}</h2>
  13. {% if resource['Year'] %}
  14. {{ resource['Year'] }}
  15. {% endif %}
  16. {% if resource['Authors'] %}
  17. <div class="">
  18. {% if resource['Authors']|length > 1 %}
  19. <div class="">
  20. {% for author in resource['Authors'] %}
  21. {{ author }}</br>
  22. {% endfor %}
  23. </div>
  24. {% else %}
  25. <div>
  26. {% for author in resource['Authors'] %}
  27. {{ author }}
  28. {% endfor %}
  29. </div>
  30. {% endif %}
  31. </div>
  32. {% endif %}
  33. </div>
  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>Author</h3>
  86. <div class="">{{ resource['author'] }}</div>
  87. </div>
  88. {% endif %}
  89. {% if resource['year'] %}
  90. <div class="">
  91. <h3>Publication year</h3>
  92. <div>
  93. {{ resource['year'] }}
  94. </div>
  95. </div>
  96. {% endif %}
  97. {% if resource['desc'] %}
  98. <div class="col-span-2">
  99. <h3>Publisher's description</h3>
  100. <div class="">{{ resource['desc'] }}</div>
  101. </div>
  102. {% endif %}
  103. {% if resource['description'] %}
  104. <div class="col-span-2">
  105. <h3>
  106. Experimental aspects:
  107. </h3>
  108. <div>
  109. {{ resource['description'] }}
  110. </div>
  111. </div>
  112. {% endif %}
  113. </div>
  114. </div>
  115. </div>
  116. <div class="right lg:mt-16">
  117. <div class=" max-w-[30rem] mx-auto p-4">
  118. {{ relationships_links(relationships) }}
  119. </div>
  120. </div>
  121. </div>
  122. {% endblock %}