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.

206 lines
7.1KB

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