Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

128 lines
5.2KB

  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 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 resource_dropdown in links %}
  99. <option value="{{ resource_dropdown['id'] }}" 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. <div class="mb-3 mt-3">
  109. <button type="submit" class="btn btn-primary">Submit</button>
  110. </div>
  111. </form>
  112. <hr>
  113. {% if resource['type'] == 'tool' %}
  114. <form action="{{ url_for('tool.delete_tool', tool_id=resource['id']) }}" method="POST">
  115. <input type="submit" value="Delete"
  116. class="btn btn-danger btn-sm"
  117. onclick="return confirm('Are you sure you want to delete this tool?')">
  118. </form>
  119. {% endif %}
  120. {% endblock %}