您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. {{ links }}
  79. <select name="linked_resources" id="linked_resources" aria-label="Linked resources" class="selectpicker" data-live-search="true" multiple>
  80. {% for resource_dropdown in resource_dropdown %}
  81. {% if resource_dropdown['type'] != 'tool' %}
  82. <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
  83. {% endif %}
  84. {% endfor %}
  85. </select>
  86. </div>
  87. {% endif %}
  88. <div class="mb-3 mt-3">
  89. <button type="submit" class="btn btn-primary">Submit</button>
  90. </div>
  91. </form>
  92. <hr>
  93. {% if resource['type'] == 'tool' %}
  94. <form action="{{ url_for('tool.delete_tool', tool_id=resource['id']) }}" method="POST">
  95. <input type="submit" value="Delete"
  96. class="btn btn-danger btn-sm"
  97. onclick="return confirm('Are you sure you want to delete this tool?')">
  98. </form>
  99. {% endif %}
  100. {% endblock %}