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.

244 satır
8.7KB

  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['longDescription'] %}
  162. <tr>
  163. <th>
  164. Full description
  165. </th>
  166. <td>
  167. {{ resource['longDescription']|safe }}
  168. </td>
  169. </tr>
  170. {% endif %}
  171. {% if resource['experimental'] %}
  172. <tr>
  173. <th>
  174. Experimental uses
  175. </th>
  176. <td>
  177. {{ resource['experimental']|safe }}
  178. </td>
  179. </tr>
  180. {% endif %}
  181. {% if resource['considerations'] %}
  182. <tr>
  183. <th>
  184. Considerations
  185. </th>
  186. <td>
  187. <p style="white-space: pre-line">{{ resource['considerations']|safe }}</p>
  188. </td>
  189. </tr>
  190. {% endif %}
  191. {% if resource['references'] %}
  192. <tr>
  193. <th>
  194. References:
  195. </th>
  196. <td>
  197. <p style="white-space: pre-line">{{ resource['references']|safe }}</p>
  198. </td>
  199. </tr>
  200. {% endif %}
  201. </tbody>
  202. </table>
  203. </div>
  204. </div>
  205. {% if relationships %}
  206. <div class="row">
  207. <div class="col">
  208. <h2 class="text-center">Linked resources:</h2>
  209. </div>
  210. </div>
  211. <div class="row">
  212. {% for relationship in relationships %}
  213. <div class="col-md-4 col-sm-6 py-3">
  214. {% if relationship['type'] == 'tool' %}
  215. <div class="card text-dark bg-tool mb-3">
  216. <div class="card-body">
  217. <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
  218. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  219. </a>
  220. <p class="card-text">
  221. {{ relationship['description']|truncate(100) }}
  222. </p>
  223. </div>
  224. </div>
  225. {% elif relationship['type'] == 'practice' %}
  226. <div class="card text-dark bg-practice mb-3">
  227. <div class="card-body">
  228. <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
  229. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  230. </a>
  231. <p class="card-text">
  232. {{ relationship['description']|truncate(100) }}
  233. </p>
  234. </div>
  235. </div>
  236. {% endif %}
  237. </div>
  238. {% endfor %}
  239. </div>
  240. {% endif %}
  241. {% endblock %}