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.

219 lines
7.9KB

  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. {% elif resource['type'] == 'book' %}
  22. <div class="row text-center py-3">
  23. <a href="{{ url_for('book.edit_book', book_id=resource['id']) }}">
  24. <span class="badge bg-dark">Edit</span>
  25. </a>
  26. </div>
  27. {% endif %}
  28. {% endif %}
  29. <div class="row">
  30. <div class="col">
  31. <table class="table table-hover">
  32. <tbody>
  33. <tr>
  34. <th>
  35. Created:
  36. </th>
  37. <td>
  38. {{ resource['created'].strftime("%Y-%m-%d %H:%M") }} UTC
  39. </td>
  40. </tr>
  41. {% if resource['description'] %}
  42. <tr>
  43. <th>
  44. Description:
  45. </th>
  46. <td>
  47. {{ resource['description'] }}
  48. </td>
  49. </tr>
  50. {% endif %}
  51. {% if resource['developer'] %}
  52. <tr>
  53. <th>
  54. Developer
  55. </th>
  56. <td>
  57. {% if resource['developerUrl'] %}
  58. <a href="{{ resource['developerUrl'] }}">{{ resource['developer'] }}</a>
  59. {% else %}
  60. {{ resource['developer'] }}
  61. {% endif %}
  62. </td>
  63. </tr>
  64. {% endif %}
  65. {% if resource['license'] %}
  66. <tr>
  67. <th>
  68. Software license:
  69. </th>
  70. <td>
  71. {{ resource['license'] }}
  72. </td>
  73. </tr>
  74. {% endif %}
  75. {% if resource['scriptingLanguage'] %}
  76. <tr>
  77. <th>
  78. Software language(s):
  79. </th>
  80. <td>
  81. {{ resource['scriptingLanguage'] }}
  82. </td>
  83. </tr>
  84. {% endif %}
  85. {% if resource['projectUrl'] %}
  86. <tr>
  87. <th>
  88. Project page:
  89. </th>
  90. <td>
  91. <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
  92. </td>
  93. </tr>
  94. {% endif %}
  95. {% if resource['repositoryUrl'] %}
  96. <tr>
  97. <th>
  98. Code repository:
  99. </th>
  100. <td>
  101. <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
  102. </td>
  103. </tr>
  104. {% endif %}
  105. {% if resource['expertiseToUse'] %}
  106. <tr>
  107. <th>
  108. Expertise required to use:
  109. </th>
  110. <td>
  111. {{ resource['expertiseToUse'] }}
  112. </td>
  113. </tr>
  114. {% endif %}
  115. {% if resource['expertiseToHost'] %}
  116. <tr>
  117. <th>
  118. Expertise required to self-host:
  119. </th>
  120. <td>
  121. {{ resource['expertiseToHost'] }}
  122. </td>
  123. </tr>
  124. {% endif %}
  125. {% if resource['dependencies'] %}
  126. <tr>
  127. <th>
  128. Technical dependencies:
  129. </th>
  130. <td>
  131. {{ resource['dependencies'] }}
  132. </td>
  133. </tr>
  134. {% endif %}
  135. {% if resource['ingestFormats'] %}
  136. <tr>
  137. <th>
  138. Import / ingest formats:
  139. </th>
  140. <td>
  141. {{ resource['ingestFormats'] }}
  142. </td>
  143. </tr>
  144. {% endif %}
  145. {% if resource['outputFormats'] %}
  146. <tr>
  147. <th>
  148. Output formats:
  149. </th>
  150. <td>
  151. {{ resource['outputFormats'] }}
  152. </td>
  153. </tr>
  154. {% endif %}
  155. {% if resource['status'] %}
  156. <tr>
  157. <th>
  158. Platform status:
  159. </th>
  160. <td>
  161. {{ resource['status'] }}
  162. </td>
  163. </tr>
  164. {% endif %}
  165. </tbody>
  166. </table>
  167. </div>
  168. </div>
  169. {% if relationships %}
  170. <div class="row">
  171. <div class="col">
  172. <h2 class="text-center">Linked resources:</h2>
  173. </div>
  174. </div>
  175. <div class="row">
  176. {% for relationship in relationships %}
  177. <div class="col-md-4 col-sm-6 py-3">
  178. {% if relationship['type'] == 'tool' %}
  179. <div class="card text-dark bg-tool mb-3">
  180. <div class="card-body">
  181. <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
  182. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  183. </a>
  184. <p class="card-text">
  185. {{ relationship['description']|truncate(100) }}
  186. </p>
  187. </div>
  188. </div>
  189. {% elif relationship['type'] == 'practice' %}
  190. <div class="card text-dark bg-practice mb-3">
  191. <div class="card-body">
  192. <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
  193. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  194. </a>
  195. <p class="card-text">
  196. {{ relationship['description']|truncate(100) }}
  197. </p>
  198. </div>
  199. </div>
  200. {% elif relationship['type'] == 'book' %}
  201. <div class="card text-dark bg-book mb-3">
  202. <div class="card-body">
  203. <a href="{{ url_for('book.show_book', book_id=relationship['id']) }}">
  204. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  205. </a>
  206. <p class="card-text">
  207. {{ relationship['description']|truncate(100) }}
  208. </p>
  209. </div>
  210. </div>
  211. {% endif %}
  212. </div>
  213. {% endfor %}
  214. </div>
  215. {% endif %}
  216. {% endblock %}