You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

book.html 5.2KB

1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
1 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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="border-r-2 border-black pr-8">
  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 huge-title 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 class="">
  34. {% if current_user.is_authenticated %}
  35. <div class="">
  36. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  37. <span class="badge bg-dark">Edit</span>
  38. </a>
  39. </div>
  40. {% endif %}
  41. <div class="facts ">
  42. {% if resource['typology'] %}
  43. <div class="">
  44. <h3>Typology category</h3>
  45. <a href="/books?typology={{ resource['typology'] }}">{{ resource['typology'] }}</a>
  46. </div>
  47. {% endif %}
  48. {% if resource['bookUrl'] %}
  49. <div class="">
  50. <h3>URL</h3>
  51. <a target="_blank" href="{{ resource['bookUrl'] }}">{{ resource['bookUrl'] }}</a>
  52. </div>
  53. {% endif %}
  54. <!-- fields for books from isbntools -->
  55. {% if resource['ISBN-13'] %}
  56. <div class="">
  57. <h3>
  58. ISBN-13
  59. </h3>
  60. <div>
  61. {{ resource['ISBN-13'] }}
  62. </div>
  63. </div>
  64. {% endif %}
  65. {% if resource['Publisher'] %}
  66. <div class="">
  67. <h3>
  68. Publisher
  69. </h3>
  70. <div>
  71. {{ resource['Publisher'] }}
  72. </div>
  73. </div>
  74. {% endif %}
  75. <!-- fields for books from database -->
  76. {% if resource['name'] %}
  77. <!-- <div class="">
  78. <h3>Title</h3>
  79. <div class="">{{ resource['name'] }}</div>
  80. </div> -->
  81. {% endif %}
  82. {% if resource['author'] %}
  83. <div class="">
  84. <h3>Author</h3>
  85. <div class="">{{ resource['author'] }}</div>
  86. </div>
  87. {% endif %}
  88. {% if resource['year'] %}
  89. <div class="">
  90. <h3>Publication year</h3>
  91. <div>
  92. {{ resource['year'] }}
  93. </div>
  94. </div>
  95. {% endif %}
  96. {% if resource['desc'] %}
  97. <div class="col-span-2">
  98. <h3>Publisher's description</h3>
  99. <div class="">{{ resource['desc'] }}</div>
  100. </div>
  101. {% endif %}
  102. {% if resource['description'] %}
  103. <div class="col-span-2">
  104. <h3>
  105. Experimental aspects:
  106. </h3>
  107. <div>
  108. {{ resource['description'] }}
  109. </div>
  110. </div>
  111. {% endif %}
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="right p-4 pr-8 lg:p-0">
  117. <div class="grid lg:grid-cols-2">
  118. {{ relationships_links(resource) }}
  119. </div>
  120. </div>
  121. </div>
  122. {% endblock %}