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.

resource.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="row">
  4. <div class="col">
  5. <h1 class="text-center">{% block title %} {{ resource['name'] }} {% endblock %}</h1>
  6. </div>
  7. </div>
  8. {% if current_user.is_authenticated %}
  9. {% if resource['type'] == 'tool' %}
  10. <div class="row text-center py-3">
  11. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  12. <span class="badge bg-dark">Edit</span>
  13. </a>
  14. </div>
  15. {% elif resource['type'] == 'practice' %}
  16. <div class="row text-center py-3">
  17. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  18. <span class="badge bg-dark">Edit</span>
  19. </a>
  20. </div>
  21. {% endif %}
  22. {% endif %}
  23. <div class="row">
  24. <div class="col">
  25. <table class="table table-hover">
  26. <tbody>
  27. <tr>
  28. <th>
  29. Created:
  30. </th>
  31. <td>
  32. {{ resource['created'].strftime("%Y-%m-%d %H:%M") }} UTC
  33. </td>
  34. </tr>
  35. {% if resource['description'] %}
  36. <tr>
  37. <th>
  38. Description:
  39. </th>
  40. <td>
  41. {{ resource['description'] }}
  42. </td>
  43. </tr>
  44. {% endif %}
  45. <!-- fields for tools -->
  46. {% if resource['developer'] %}
  47. <tr>
  48. <th>
  49. Developer
  50. </th>
  51. <td>
  52. {% if resource['developerUrl'] %}
  53. <a href="{{ resource['developerUrl'] }}">{{ resource['developer'] }}</a>
  54. {% else %}
  55. {{ resource['developer'] }}
  56. {% endif %}
  57. </td>
  58. </tr>
  59. {% endif %}
  60. {% if resource['license'] %}
  61. <tr>
  62. <th>
  63. Software license:
  64. </th>
  65. <td>
  66. {{ resource['license'] }}
  67. </td>
  68. </tr>
  69. {% endif %}
  70. {% if resource['scriptingLanguage'] %}
  71. <tr>
  72. <th>
  73. Software language(s):
  74. </th>
  75. <td>
  76. {{ resource['scriptingLanguage'] }}
  77. </td>
  78. </tr>
  79. {% endif %}
  80. {% if resource['projectUrl'] %}
  81. <tr>
  82. <th>
  83. Project page:
  84. </th>
  85. <td>
  86. <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
  87. </td>
  88. </tr>
  89. {% endif %}
  90. {% if resource['repositoryUrl'] %}
  91. <tr>
  92. <th>
  93. Code repository:
  94. </th>
  95. <td>
  96. <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
  97. </td>
  98. </tr>
  99. {% endif %}
  100. {% if resource['expertiseToUse'] %}
  101. <tr>
  102. <th>
  103. Expertise required to use:
  104. </th>
  105. <td>
  106. {{ resource['expertiseToUse'] }}
  107. </td>
  108. </tr>
  109. {% endif %}
  110. {% if resource['expertiseToHost'] %}
  111. <tr>
  112. <th>
  113. Expertise required to self-host:
  114. </th>
  115. <td>
  116. {{ resource['expertiseToHost'] }}
  117. </td>
  118. </tr>
  119. {% endif %}
  120. {% if resource['dependencies'] %}
  121. <tr>
  122. <th>
  123. Technical dependencies:
  124. </th>
  125. <td>
  126. {{ resource['dependencies'] }}
  127. </td>
  128. </tr>
  129. {% endif %}
  130. {% if resource['ingestFormats'] %}
  131. <tr>
  132. <th>
  133. Import / ingest formats:
  134. </th>
  135. <td>
  136. {{ resource['ingestFormats'] }}
  137. </td>
  138. </tr>
  139. {% endif %}
  140. {% if resource['outputFormats'] %}
  141. <tr>
  142. <th>
  143. Output formats:
  144. </th>
  145. <td>
  146. {{ resource['outputFormats'] }}
  147. </td>
  148. </tr>
  149. {% endif %}
  150. {% if resource['status'] %}
  151. <tr>
  152. <th>
  153. Platform status:
  154. </th>
  155. <td>
  156. {{ resource['status'] }}
  157. </td>
  158. </tr>
  159. {% endif %}
  160. <!-- fields for practices -->
  161. {% if resource['experimental'] %}
  162. <tr>
  163. <th>
  164. How is this / Can this be an experimental practice?
  165. </th>
  166. <td>
  167. {{ resource['experimental'] }}
  168. </td>
  169. </tr>
  170. {% endif %}
  171. {% if resource['lessonsLearned'] %}
  172. <tr>
  173. <th>
  174. How has it been applied experimentally (lessons learned for authors and publishers)?
  175. </th>
  176. <td>
  177. <p style="white-space: pre-line">{{ resource['lessonsLearned'] }}</p>
  178. </td>
  179. </tr>
  180. {% endif %}
  181. {% if resource['references'] %}
  182. <tr>
  183. <th>
  184. References:
  185. </th>
  186. <td>
  187. <p style="white-space: pre-line">{{ resource['references'] }}</p>
  188. </td>
  189. </tr>
  190. {% endif %}
  191. </tbody>
  192. </table>
  193. </div>
  194. </div>
  195. {% if relationships %}
  196. <div class="row">
  197. <div class="col">
  198. <h2 class="text-center">Linked resources:</h2>
  199. </div>
  200. </div>
  201. <div class="row">
  202. {% for relationship in relationships %}
  203. <div class="col-md-4 col-sm-6 py-3">
  204. {% if relationship['type'] == 'tool' %}
  205. <div class="card text-dark bg-tool mb-3">
  206. <div class="card-body">
  207. <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
  208. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  209. </a>
  210. <p class="card-text">
  211. {{ relationship['description']|truncate(100) }}
  212. </p>
  213. </div>
  214. </div>
  215. {% elif relationship['type'] == 'practice' %}
  216. <div class="card text-dark bg-practice mb-3">
  217. <div class="card-body">
  218. <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
  219. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  220. </a>
  221. <p class="card-text">
  222. {{ relationship['description']|truncate(100) }}
  223. </p>
  224. </div>
  225. </div>
  226. {% endif %}
  227. </div>
  228. {% endfor %}
  229. </div>
  230. {% endif %}
  231. {% endblock %}