您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

136 行
4.7KB

  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">
  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>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="lg: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="lg:col-span-2">
  105. <h3>
  106. Experimental aspects:
  107. </h3>
  108. <div>
  109. {{ resource['description']|safe }}
  110. </div>
  111. </div>
  112. {% endif %}
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="right p-4 pr-8 lg:p-0">
  118. <div class="grid lg:grid-cols-2">
  119. {{ relationships_links(resource) }}
  120. </div>
  121. </div>
  122. </div>
  123. {% endblock %}