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.

170 lines
5.8KB

  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. <tr>
  38. <th>
  39. Description:
  40. </th>
  41. <td>
  42. {{ resource['description'] }}
  43. </td>
  44. </tr>
  45. {% if resource['projectUrl'] %}
  46. <tr>
  47. <th>
  48. Project page:
  49. </th>
  50. <td>
  51. <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
  52. </td>
  53. </tr>
  54. {% endif %}
  55. {% if resource['repositoryUrl'] %}
  56. <tr>
  57. <th>
  58. Code repository:
  59. </th>
  60. <td>
  61. <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
  62. </td>
  63. </tr>
  64. {% endif %}
  65. {% if resource['expertiseToUse'] %}
  66. <tr>
  67. <th>
  68. Expertise required to use:
  69. </th>
  70. <td>
  71. {{ resource['expertiseToUse'] }}
  72. </td>
  73. </tr>
  74. {% endif %}
  75. {% if resource['expertiseToHost'] %}
  76. <tr>
  77. <th>
  78. Expertise required to self-host:
  79. </th>
  80. <td>
  81. {{ resource['expertiseToHost'] }}
  82. </td>
  83. </tr>
  84. {% endif %}
  85. {% if resource['dependencies'] %}
  86. <tr>
  87. <th>
  88. Technical dependencies:
  89. </th>
  90. <td>
  91. {{ resource['dependencies'] }}
  92. </td>
  93. </tr>
  94. {% endif %}
  95. {% if resource['ingestFormats'] %}
  96. <tr>
  97. <th>
  98. Import / ingest formats:
  99. </th>
  100. <td>
  101. {{ resource['ingestFormats'] }}
  102. </td>
  103. </tr>
  104. {% endif %}
  105. {% if resource['outputFormats'] %}
  106. <tr>
  107. <th>
  108. Output formats:
  109. </th>
  110. <td>
  111. {{ resource['outputFormats'] }}
  112. </td>
  113. </tr>
  114. {% endif %}
  115. {% if resource['status'] %}
  116. <tr>
  117. <th>
  118. Platform status:
  119. </th>
  120. <td>
  121. {{ resource['status'] }}
  122. </td>
  123. </tr>
  124. {% endif %}
  125. </tbody>
  126. </table>
  127. </div>
  128. </div>
  129. {% if links %}
  130. <div class="row">
  131. <div class="col">
  132. <h2 class="text-center">Linked resources:</h2>
  133. </div>
  134. </div>
  135. <div class="row">
  136. {% for link in links %}
  137. <div class="col-md-4 col-sm-6 py-3">
  138. {% if link['type'] == 'tool' %}
  139. <div class="card text-dark bg-tool mb-3">
  140. <div class="card-body">
  141. <a href="{{ url_for('tool.show_tool', tool_id=link['id']) }}">
  142. <h3 class="card-title text-center text-dark">{{ link['name'] }}</h3>
  143. </a>
  144. <p class="card-text">
  145. {{ link['description']|truncate(100) }}
  146. </p>
  147. </div>
  148. </div>
  149. {% endif %}
  150. {% if link['type'] == 'practice' %}
  151. <div class="card text-dark bg-practice mb-3">
  152. <div class="card-body">
  153. <a href="{{ url_for('practice.show_practice', practice_id=link['id']) }}">
  154. <h3 class="card-title text-center text-dark">{{ link['name'] }}</h3>
  155. </a>
  156. <p class="card-text">
  157. {{ link['description']|truncate(100) }}
  158. </p>
  159. </div>
  160. </div>
  161. {% endif %}
  162. </div>
  163. {% endfor %}
  164. </div>
  165. {% endif %}
  166. {% endblock %}