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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends 'base.html' %}
  2. {% block content %}
  3. <h1>{% block title %} Edit "{{ resource['name'] }}" {% endblock %}</h1>
  4. <form method="post">
  5. <div class="mb-3 mt-3">
  6. <label for="name">Name</label>
  7. <input type="text" name="name" placeholder="Name"
  8. class="form-control"
  9. value="{{ request.form['name'] or resource['name'] }}">
  10. </input>
  11. </div>
  12. <div class="mb-3 mt-3">
  13. <label for="description">Description</label>
  14. <textarea name="description" placeholder="Description"
  15. class="form-control">{{ request.form['description'] or resource['description'] }}</textarea>
  16. </div>
  17. {% if resource['type'] == 'tool' %}
  18. <div class="mb-3 mt-3">
  19. <label for="projectUrl">Project URL</label>
  20. <input type="text" name="projectUrl" placeholder="Project URL"
  21. class="form-control"
  22. value="{{ request.form['projectUrl'] or resource['projectUrl'] }}">
  23. </input>
  24. </div>
  25. <div class="mb-3 mt-3">
  26. <label for="repositoryUrl">Repository URL</label>
  27. <input type="text" name="repositoryUrl" placeholder="Repository URL"
  28. class="form-control"
  29. value="{{ request.form['repositoryUrl'] or resource['repositoryUrl'] }}">
  30. </input>
  31. </div>
  32. <div class="mb-3 mt-3">
  33. <label for="expertiseToUse">Expertise required to use</label>
  34. <input type="text" name="expertiseToUse" placeholder="Expertise required to use"
  35. class="form-control"
  36. value="{{ request.form['expertiseToUse'] or resource['expertiseToUse'] }}">
  37. </input>
  38. </div>
  39. <div class="mb-3 mt-3">
  40. <label for="expertiseToHost">Expertise required to host</label>
  41. <input type="text" name="expertiseToHost" placeholder="Expertise required to host"
  42. class="form-control"
  43. value="{{ request.form['expertiseToHost'] or resource['expertiseToHost'] }}">
  44. </input>
  45. </div>
  46. <div class="mb-3 mt-3">
  47. <label for="dependencies">Technical dependencies</label>
  48. <input type="text" name="dependencies" placeholder="Technical dependencies"
  49. class="form-control"
  50. value="{{ request.form['dependencies'] or resource['dependencies'] }}">
  51. </input>
  52. </div>
  53. <div class="mb-3 mt-3">
  54. <label for="ingestFormats">Import / ingest formats</label>
  55. <input type="text" name="ingestFormats" placeholder="Import / ingest formats"
  56. class="form-control"
  57. value="{{ request.form['ingestFormats'] or resource['ingestFormats'] }}">
  58. </input>
  59. </div>
  60. <div class="mb-3 mt-3">
  61. <label for="outputFormats">Output formats</label>
  62. <input type="text" name="outputFormats" placeholder="Output formats"
  63. class="form-control"
  64. value="{{ request.form['outputFormats'] or resource['outputFormats'] }}">
  65. </input>
  66. </div>
  67. <div class="mb-3 mt-3">
  68. <label for="status">Platform status</label>
  69. <input type="text" name="status" placeholder="Platform status"
  70. class="form-control"
  71. value="{{ request.form['status'] or resource['status'] }}">
  72. </input>
  73. </div>
  74. <div class="mb-3 mt-3">
  75. <label for="linked_practice_id">Linked resources</label>
  76. </div>
  77. <div class="mb-3 mt-3">
  78. <select name="linked_resources" id="linked_resources" aria-label="Linked resources" class="selectpicker" data-live-search="true" multiple>
  79. {% for resource_dropdown in resource_dropdown %}
  80. {% if resource_dropdown['type'] != 'tool' %}
  81. {% if links and resource_dropdown in links %}
  82. <option value="{{ resource_dropdown['id'] }}" selected>{{ resource_dropdown['name'] }}</option>
  83. {% else %}
  84. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  85. {% endif %}
  86. {% endif %}
  87. {% endfor %}
  88. </select>
  89. </div>
  90. {% elif resource['type'] == 'practice' %}
  91. <div class="mb-3 mt-3">
  92. <label for="linked_practice_id">Linked resources</label>
  93. </div>
  94. <div class="mb-3 mt-3">
  95. <select name="linked_resources" id="linked_resources" aria-label="Linked resources" class="selectpicker" data-live-search="true" multiple>
  96. {% for resource_dropdown in resource_dropdown %}
  97. {% if resource_dropdown['type'] != 'practice' %}
  98. {% if links and resource_dropdown in links %}
  99. <option value="" selected>{{ resource_dropdown['name'] }}</option>
  100. {% else %}
  101. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  102. {% endif %}
  103. {% endif %}
  104. {% endfor %}
  105. </select>
  106. </div>
  107. {% endif %}
  108. {% if links %}
  109. <div class="mb-3 mt-3">
  110. <label for="linked_practice_id">Remove linked resources</label>
  111. </div>
  112. <div class="mb-3 mt-3">
  113. <select name="remove_linked_resources" id="remove_linked_resources" aria-label="Remove linked resources" class="selectpicker" data-live-search="true" multiple>
  114. {% for link in links %}
  115. <option value="{{ link['id'] }}">{{ link['name'] }}</option>
  116. {% endfor %}
  117. </select>
  118. </div>
  119. {% endif %}
  120. <div class="mb-3 mt-3">
  121. <button type="submit" class="btn btn-primary">Submit</button>
  122. </div>
  123. </form>
  124. <hr>
  125. {% if resource['type'] == 'tool' %}
  126. <form action="{{ url_for('tool.delete_tool', tool_id=resource['id']) }}" method="POST">
  127. <input type="submit" value="Delete"
  128. class="btn btn-danger btn-sm"
  129. onclick="return confirm('Are you sure you want to delete this tool?')">
  130. </form>
  131. {% endif %}
  132. {% if resource['type'] == 'practice' %}
  133. <form action="{{ url_for('practice.delete_practice', practice_id=resource['id']) }}" method="POST">
  134. <input type="submit" value="Delete"
  135. class="btn btn-danger btn-sm"
  136. onclick="return confirm('Are you sure you want to delete this practice?')">
  137. </form>
  138. {% endif %}
  139. {% endblock %}