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 5.7KB

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