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.

resource.html 7.7KB

3 jaren geleden
3 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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['ingestFormats'] %}
  101. <tr>
  102. <th>
  103. Import / ingest formats:
  104. </th>
  105. <td>
  106. {{ resource['ingestFormats'] }}
  107. </td>
  108. </tr>
  109. {% endif %}
  110. {% if resource['outputFormats'] %}
  111. <tr>
  112. <th>
  113. Output formats:
  114. </th>
  115. <td>
  116. {{ resource['outputFormats'] }}
  117. </td>
  118. </tr>
  119. {% endif %}
  120. {% if resource['status'] %}
  121. <tr>
  122. <th>
  123. Platform status:
  124. </th>
  125. <td>
  126. {{ resource['status'] }}
  127. </td>
  128. </tr>
  129. {% endif %}
  130. <!-- fields for practices -->
  131. {% if resource['longDescription'] %}
  132. <tr>
  133. <th>
  134. Full description
  135. </th>
  136. <td>
  137. {{ resource['longDescription']|safe }}
  138. </td>
  139. </tr>
  140. {% endif %}
  141. {% if resource['experimental'] %}
  142. <tr>
  143. <th>
  144. Experimental uses
  145. </th>
  146. <td>
  147. {{ resource['experimental']|safe }}
  148. </td>
  149. </tr>
  150. {% endif %}
  151. {% if resource['considerations'] %}
  152. <tr>
  153. <th>
  154. Considerations
  155. </th>
  156. <td>
  157. <p style="white-space: pre-line">{{ resource['considerations']|safe }}</p>
  158. </td>
  159. </tr>
  160. {% endif %}
  161. {% if resource['references'] %}
  162. <tr>
  163. <th>
  164. References:
  165. </th>
  166. <td>
  167. <p style="white-space: pre-line">{{ resource['references']|safe }}</p>
  168. </td>
  169. </tr>
  170. {% endif %}
  171. </tbody>
  172. </table>
  173. </div>
  174. </div>
  175. {% if relationships %}
  176. <div class="row">
  177. <div class="col">
  178. <h2 class="text-center">Linked resources:</h2>
  179. </div>
  180. </div>
  181. <div class="row">
  182. {% for relationship in relationships %}
  183. <div class="col-md-4 col-sm-6 py-3">
  184. {% if relationship['type'] == 'tool' %}
  185. <div class="card text-dark bg-tool mb-3">
  186. <div class="card-body">
  187. <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
  188. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  189. </a>
  190. <p class="card-text">
  191. {{ relationship['description']|truncate(100) }}
  192. </p>
  193. </div>
  194. </div>
  195. {% elif relationship['type'] == 'practice' %}
  196. <div class="card text-dark bg-practice mb-3">
  197. <div class="card-body">
  198. <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
  199. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  200. </a>
  201. <p class="card-text">
  202. {{ relationship['description']|truncate(100) }}
  203. </p>
  204. </div>
  205. </div>
  206. {% endif %}
  207. </div>
  208. {% endfor %}
  209. </div>
  210. {% endif %}
  211. {% endblock %}