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.

create.html 13KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <h1>{% block title %} Add a New Resource{% endblock %}</h1>
  4. <form method="POST" action="/create" id="resource">
  5. <div class="mb-3 mt-3">
  6. <label for="type">Type</label>
  7. <select class="form-select" id="resource_type" name="resource_type" form="resource">
  8. <option selected="selected">Please choose</option>
  9. <option value="tool">Tool</option>
  10. <option value="practice">Practice</option>
  11. <option value="book">Book</option>
  12. </select>
  13. </div>
  14. <div id="resource_type_tool" class="resource_type_input" style="display: none;">
  15. <div class="mb-3 mt-3">
  16. <label for="tool_name">Tool name</label>
  17. <input class="form-control" type="text" name="tool_name" placeholder="Tool name" autofocus="">
  18. </div>
  19. <div class="mb-3 mt-3">
  20. <label for="description">Short description</label>
  21. <textarea class="form-control" rows="4" type="text" name="description" placeholder="Tool description" autofocus=""></textarea>
  22. </div>
  23. <div class="mb-3 mt-3">
  24. <label for="developer">Developer</label>
  25. <input class="form-control" type="text" name="developer" placeholder="Developer" autofocus="">
  26. </div>
  27. <div class="mb-3 mt-3">
  28. <label for="developerUrl">Developer URL</label>
  29. <input class="form-control" type="text" name="developerUrl" placeholder="Developer URL" autofocus="">
  30. </div>
  31. <div class="mb-3 mt-3">
  32. <label for="projectUrl">Project URL</label>
  33. <input class="form-control" type="text" name="projectUrl" placeholder="Project URL" autofocus="">
  34. </div>
  35. <div class="mb-3 mt-3">
  36. <label for="repositoryUrl">Repository URL</label>
  37. <input class="form-control" type="text" name="repositoryUrl" placeholder="Repository URL" autofocus="">
  38. </div>
  39. <div class="mb-3 mt-3">
  40. <label for="license">Software license</label>
  41. <input class="form-control" type="text" name="license" placeholder="Software license" autofocus="">
  42. </div>
  43. <div class="mb-3 mt-3">
  44. <label for="scriptingLanguage">Software language</label>
  45. <input class="form-control" type="text" name="scriptingLanguage" placeholder="Software language" autofocus="">
  46. </div>
  47. <div class="mb-3 mt-3">
  48. <label for="expertiseToUse">Expertise required to use</label>
  49. <input class="form-control" type="text" name="expertiseToUse" placeholder="Expertise required to use" autofocus="">
  50. </div>
  51. <div class="mb-3 mt-3">
  52. <label for="expertiseToHost">Expertise required to self-host</label>
  53. <input class="form-control" type="text" name="expertiseToHost" placeholder="Expertise required to self-host" autofocus="">
  54. </div>
  55. <div class="mb-3 mt-3">
  56. <label for="dependencies">Technical dependencies</label>
  57. <input class="form-control" type="text" name="dependencies" placeholder="Technical dependencies" autofocus="">
  58. </div>
  59. <div class="mb-3 mt-3">
  60. <label for="ingestFormats">Import / ingest formats</label>
  61. <input class="form-control" type="text" name="ingestFormats" placeholder="Import / ingest formats" autofocus="">
  62. </div>
  63. <div class="mb-3 mt-3">
  64. <label for="outputFormats">Output formats</label>
  65. <input class="form-control" type="text" name="outputFormats" placeholder="Output formats" autofocus="">
  66. </div>
  67. <div class="mb-3 mt-3">
  68. <label for="status">Platform status</label>
  69. <input class="form-control" type="text" name="status" placeholder="Platform status" autofocus="">
  70. </div>
  71. <div class="mb-3 mt-3">
  72. <label for="linked_practices">Add practices relationship(s) (hold Ctrl to select multiple options)</label>
  73. </div>
  74. <div class="mb-3 mt-3">
  75. <select name="linked_practices" id="linked_practices" aria-label="Add practices relationships" class="selectpicker" data-live-search="true" multiple>
  76. {% for resource_dropdown in resource_dropdown %}
  77. {% if resource_dropdown['type'] == 'practice' %}
  78. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  79. {% endif %}
  80. {% endfor %}
  81. </select>
  82. </div>
  83. <div class="mb-3 mt-3">
  84. <label for="linked_books">Add books relationship(s) (hold Ctrl to select multiple options)</label>
  85. </div>
  86. <div class="mb-3 mt-3">
  87. <select name="linked_books" id="linked_books" aria-label="Add books relationships" class="selectpicker" data-live-search="true" multiple>
  88. {% for resource_dropdown in resource_dropdown %}
  89. {% if resource_dropdown['type'] == 'book' %}
  90. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  91. {% endif %}
  92. {% endfor %}
  93. </select>
  94. </div>
  95. </div>
  96. <div id="resource_type_practice" class="resource_type_input" style="display: none;">
  97. <div class="mb-3 mt-3">
  98. <label for="practice_name">Practice name</label>
  99. <input class="form-control" type="text" name="practice_name" placeholder="Practice name" autofocus="">
  100. </div>
  101. <div class="mb-3 mt-3">
  102. <label for="description">Description</label>
  103. <textarea class="form-control" rows="4" type="text" name="description" placeholder="Description" autofocus=""></textarea>
  104. </div>
  105. <div class="mb-3 mt-3">
  106. <label for="longDescription">Full description</label>
  107. <textarea class="form-control" rows="4" type="text" name="longDescription" placeholder="Full description" autofocus=""></textarea>
  108. </div>
  109. <div class="mb-3 mt-3">
  110. <label for="experimental">Experimental uses</label>
  111. <textarea class="form-control" rows="4" type="text" name="experimental" placeholder="Experimental uses" autofocus=""></textarea>
  112. </div>
  113. <div class="mb-3 mt-3">
  114. <label for="considerations">Considerations</label>
  115. <textarea class="form-control" rows="4" type="text" name="considerations" placeholder="Considerations" autofocus=""></textarea>
  116. </div>
  117. <div class="mb-3 mt-3">
  118. <label for="references">Further reading</label>
  119. <textarea class="form-control" rows="4" type="text" name="references" placeholder="Further reading" autofocus=""></textarea>
  120. </div>
  121. <div class="mb-3 mt-3">
  122. <label for="linked_tools">Add tools relationship(s) (hold Ctrl to select multiple options)</label>
  123. </div>
  124. <div class="mb-3 mt-3">
  125. <select name="linked_tools" id="linked_tools" aria-label="Add tools relationships" class="selectpicker" data-live-search="true" multiple>
  126. {% for resource_dropdown in resource_dropdown %}
  127. {% if resource_dropdown['type'] == 'tool' %}
  128. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  129. {% endif %}
  130. {% endfor %}
  131. </select>
  132. </div>
  133. <div class="mb-3 mt-3">
  134. <label for="linked_books">Add books relationship(s) (hold Ctrl to select multiple options)</label>
  135. </div>
  136. <div class="mb-3 mt-3">
  137. <select name="linked_books" id="linked_books" aria-label="Add books relationships" class="selectpicker" data-live-search="true" multiple>
  138. {% for resource_dropdown in resource_dropdown %}
  139. {% if resource_dropdown['type'] == 'book' %}
  140. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  141. {% endif %}
  142. {% endfor %}
  143. </select>
  144. </div>
  145. </div>
  146. <div id="resource_type_book" class="resource_type_input" style="display: none;">
  147. <div class="mb-3 mt-3">
  148. <label for="book_name">Book name</label>
  149. <input class="form-control" type="text" name="book_name" placeholder="Book name" autofocus="">
  150. </div>
  151. <div class="mb-3 mt-3">
  152. <label for="description">Description</label>
  153. <textarea class="form-control" rows="4" type="text" name="description" placeholder="Book description" autofocus=""></textarea>
  154. </div>
  155. <div class="mb-3 mt-3">
  156. <label for="author">Author</label>
  157. <input class="form-control" type="text" name="author" placeholder="Author" autofocus="">
  158. </div>
  159. <div class="mb-3 mt-3">
  160. <label for="year">Publication year</label>
  161. <input class="form-control" type="text" name="year" placeholder="Publication year" autofocus="">
  162. </div>
  163. <div class="mb-3 mt-3">
  164. <label for="typology">Typology category</label>
  165. <input class="form-control" type="text" name="typology" placeholder="Typology category" autofocus="">
  166. </div>
  167. <div class="mb-3 mt-3">
  168. <label for="bookUrl">URL</label>
  169. <input class="form-control" type="text" name="bookUrl" placeholder="URL" autofocus="">
  170. </div>
  171. <div class="mb-3 mt-3">
  172. <label for="isbn">ISBN</label>
  173. <input class="form-control" type="text" name="isbn" placeholder="ISBN" autofocus="">
  174. </div>
  175. <div class="mb-3 mt-3">
  176. <label for="linked_tools">Add tools relationship(s) (hold Ctrl to select multiple options)</label>
  177. </div>
  178. <div class="mb-3 mt-3">
  179. <select name="linked_tools" id="linked_tools" aria-label="Add tools relationships" class="selectpicker" data-live-search="true" multiple>
  180. {% for resource_dropdown in resource_dropdown %}
  181. {% if resource_dropdown['type'] == 'tool' %}
  182. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  183. {% endif %}
  184. {% endfor %}
  185. </select>
  186. </div>
  187. <div class="mb-3 mt-3">
  188. <label for="linked_practices">Add practices relationship(s) (hold Ctrl to select multiple options)</label>
  189. </div>
  190. <div class="mb-3 mt-3">
  191. <select name="linked_practices" id="linked_practices" aria-label="Add practices relationships" class="selectpicker" data-live-search="true" multiple>
  192. {% for resource_dropdown in resource_dropdown %}
  193. {% if resource_dropdown['type'] == 'practice' %}
  194. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  195. {% endif %}
  196. {% endfor %}
  197. </select>
  198. </div>
  199. </div>
  200. <button type="submit" class="btn btn-default">Submit</button>
  201. </form>
  202. <script
  203. src="https://code.jquery.com/jquery-3.7.1.js"
  204. integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4="
  205. crossorigin="anonymous"></script>
  206. {% endblock %}