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.

204 lines
7.2KB

  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. {% endif %}
  16. {% if resource['type'] == 'practice' %}
  17. <div class="row text-center py-3">
  18. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  19. <span class="badge bg-dark">Edit</span>
  20. </a>
  21. </div>
  22. {% endif %}
  23. {% endif %}
  24. <div class="row">
  25. <div class="col">
  26. <table class="table table-hover">
  27. <tbody>
  28. <tr>
  29. <th>
  30. Created:
  31. </th>
  32. <td>
  33. {{ resource['created'].strftime("%Y-%m-%d %H:%M") }} UTC
  34. </td>
  35. </tr>
  36. {% if resource['description'] %}
  37. <tr>
  38. <th>
  39. Description:
  40. </th>
  41. <td>
  42. {{ resource['description'] }}
  43. </td>
  44. </tr>
  45. {% endif %}
  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. </tbody>
  161. </table>
  162. </div>
  163. </div>
  164. {% if relationships %}
  165. <div class="row">
  166. <div class="col">
  167. <h2 class="text-center">Linked resources:</h2>
  168. </div>
  169. </div>
  170. <div class="row">
  171. {% for relationship in relationships %}
  172. <div class="col-md-4 col-sm-6 py-3">
  173. {% if relationship['type'] == 'tool' %}
  174. <div class="card text-dark bg-tool mb-3">
  175. <div class="card-body">
  176. <a href="{{ url_for('tool.show_tool', tool_id=relationship['id']) }}">
  177. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  178. </a>
  179. <p class="card-text">
  180. {{ relationship['description']|truncate(100) }}
  181. </p>
  182. </div>
  183. </div>
  184. {% endif %}
  185. {% if relationship['type'] == 'practice' %}
  186. <div class="card text-dark bg-practice mb-3">
  187. <div class="card-body">
  188. <a href="{{ url_for('practice.show_practice', practice_id=relationship['id']) }}">
  189. <h3 class="card-title text-center text-dark">{{ relationship['name'] }}</h3>
  190. </a>
  191. <p class="card-text">
  192. {{ relationship['description']|truncate(100) }}
  193. </p>
  194. </div>
  195. </div>
  196. {% endif %}
  197. </div>
  198. {% endfor %}
  199. </div>
  200. {% endif %}
  201. {% endblock %}