選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

resource.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <div class="cell-margin grid gap-8 grid-cols-[2fr,1fr]">
  4. <div class="left">
  5. <div class="mb-2 capitalize">{{ resource['type'] }}</div>
  6. <h2 class="block-margin {{ resource['type'] }}">
  7. {% block title %}
  8. {% autoescape false %}
  9. {{ resource['name'] | replace(" ","<br>") }}
  10. {% endautoescape %}
  11. {% endblock %}
  12. </h2>
  13. {% if current_user.is_authenticated %}
  14. {% if resource['type'] == 'tool' %}
  15. <div class="row text-center py-3">
  16. <a href="{{ url_for('tool.edit_tool', tool_id=resource['id']) }}">
  17. <span class="">Edit</span>
  18. </a>
  19. </div>
  20. {% elif resource['type'] == 'practice' %}
  21. <div class="row text-center py-3">
  22. <a href="{{ url_for('practice.edit_practice', practice_id=resource['id']) }}">
  23. <span class="">Edit</span>
  24. </a>
  25. </div>
  26. {% endif %}
  27. {% endif %}
  28. <div class="facts">
  29. {% if resource['description'] %}
  30. <div class="">
  31. <h3>Description</h3>
  32. {{ resource['description'] }}
  33. </div>
  34. {% endif %}
  35. <!-- fields for tools -->
  36. {% if resource['developer'] %}
  37. <div class="">
  38. <h3>Developer</h3>
  39. {% if resource['developerUrl'] %}
  40. <a href="{{ resource['developerUrl'] }}">{{ resource['developer'] }}</a>
  41. {% else %}
  42. {{ resource['developer'] }}
  43. {% endif %}
  44. </div>
  45. {% endif %}
  46. {% if resource['license'] %}
  47. <div class="">
  48. <h3>Software license</h3>
  49. {{ resource['license'] }}
  50. </div>
  51. {% endif %}
  52. {% if resource['scriptingLanguage'] %}
  53. <div class="">
  54. <h3>Software language(s)</h3>
  55. {{ resource['scriptingLanguage'] }}
  56. </div>
  57. {% endif %}
  58. {% if resource['projectUrl'] %}
  59. <div class="">
  60. <h3>Project page</h3>
  61. <a href="{{ resource['projectUrl'] }}">{{ resource['projectUrl'] }}</a>
  62. </div>
  63. {% endif %}
  64. {% if resource['repositoryUrl'] %}
  65. <div class="">
  66. <h3>Code repository</h3>
  67. <a href="{{ resource['repositoryUrl'] }}">{{ resource['repositoryUrl'] }}</a>
  68. </div>
  69. {% endif %}
  70. {% if resource['ingestFormats'] %}
  71. <div class="">
  72. <h3>Import / ingest formats</h3>
  73. {{ resource['ingestFormats'] }}
  74. </div>
  75. {% endif %}
  76. {% if resource['outputFormats'] %}
  77. <div class="">
  78. <h3>Output formats</h3>
  79. {{ resource['outputFormats'] }}
  80. </div>
  81. {% endif %}
  82. {% if resource['status'] %}
  83. <div class="">
  84. <h3>Platform status</h3>
  85. {{ resource['status'] }}
  86. </div>
  87. {% endif %}
  88. <!-- fields for practices -->
  89. {% if resource['longDescription'] %}
  90. <div class="col-span-2">
  91. <h3>Full description</h3>
  92. {{ resource['longDescription']|safe }}
  93. </div>
  94. {% endif %}
  95. {% if resource['experimental'] %}
  96. <div class="col-span-2">
  97. <h3>Experimental uses</h3>
  98. {{ resource['experimental']|safe }}
  99. </div>
  100. {% endif %}
  101. {% if resource['considerations'] %}
  102. <div class="col-span-2">
  103. <h3>Considerations</h3>
  104. <p>{{ resource['considerations']|safe }}</p>
  105. </div>
  106. {% endif %}
  107. {% if resource['references'] %}
  108. <div class="col-span-2">
  109. <h3> References </h3>
  110. <p>{{ resource['references']|safe }}</p>
  111. </div>
  112. {% endif %}
  113. <div class="">
  114. <h3>Created</h3>
  115. {{ resource['created'].strftime("%Y-%m-%d %H:%M") }} UTC
  116. </div>
  117. </div>
  118. </div>
  119. <div class="right lg:mt-16 max-w-[30rem] mx-auto p-4">
  120. {{ relationships_links(relationships) }}
  121. {% if resource.tools %}
  122. TOOLS:
  123. {% for tool in resource.tools %}
  124. {{ tool.name }};
  125. {% endfor %}
  126. {% endif %}
  127. {% if resource.practices %}
  128. PRACTICES:
  129. {% for practice in resource.practices %}
  130. {{ practice.name }};
  131. {% endfor %}
  132. {% endif %}
  133. {% if resource.books %}
  134. BOOKS:
  135. {% for book in resource.books %}
  136. {{ book.name }};
  137. {% endfor %}
  138. {% endif %}
  139. </div>
  140. </div>
  141. {% endblock %}