|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- {% extends 'base.html' %}
-
- {% block content %}
- <h1>{% block title %} Edit "{{ resource['name'] }}" {% endblock %}</h1>
-
- <form method="post">
- <div class="mb-3 mt-3">
- <label for="name">Name</label>
- <input type="text" name="name" placeholder="Name"
- class="form-control"
- value="{{ request.form['name'] or resource['name'] }}">
- </input>
- </div>
-
- <div class="mb-3 mt-3">
- <label for="description">Description</label>
- <textarea name="description" placeholder="Description"
- class="form-control">{{ request.form['description'] or resource['description'] }}</textarea>
- </div>
-
- {% if resource['type'] == 'tool' %}
- <div class="mb-3 mt-3">
- <label for="projectUrl">Project URL</label>
- <input type="text" name="projectUrl" placeholder="Project URL"
- class="form-control"
- value="{{ request.form['projectUrl'] or resource['projectUrl'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="repositoryUrl">Repository URL</label>
- <input type="text" name="repositoryUrl" placeholder="Repository URL"
- class="form-control"
- value="{{ request.form['repositoryUrl'] or resource['repositoryUrl'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="expertiseToUse">Expertise required to use</label>
- <input type="text" name="expertiseToUse" placeholder="Expertise required to use"
- class="form-control"
- value="{{ request.form['expertiseToUse'] or resource['expertiseToUse'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="expertiseToHost">Expertise required to host</label>
- <input type="text" name="expertiseToHost" placeholder="Expertise required to host"
- class="form-control"
- value="{{ request.form['expertiseToHost'] or resource['expertiseToHost'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="dependencies">Technical dependencies</label>
- <input type="text" name="dependencies" placeholder="Technical dependencies"
- class="form-control"
- value="{{ request.form['dependencies'] or resource['dependencies'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="ingestFormats">Import / ingest formats</label>
- <input type="text" name="ingestFormats" placeholder="Import / ingest formats"
- class="form-control"
- value="{{ request.form['ingestFormats'] or resource['ingestFormats'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="outputFormats">Output formats</label>
- <input type="text" name="outputFormats" placeholder="Output formats"
- class="form-control"
- value="{{ request.form['outputFormats'] or resource['outputFormats'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="status">Platform status</label>
- <input type="text" name="status" placeholder="Platform status"
- class="form-control"
- value="{{ request.form['status'] or resource['status'] }}">
- </input>
- </div>
- <div class="mb-3 mt-3">
- <label for="linked_practice_id">Linked resources</label>
- </div>
- <div class="mb-3 mt-3">
- <select name="linked_resources" id="linked_resources" aria-label="Linked resources" class="selectpicker" data-live-search="true" multiple>
- {% for resource_dropdown in resource_dropdown %}
- {% if resource_dropdown['type'] != 'tool' %}
- {% if resource_dropdown in links %}
- <option value="{{ resource_dropdown['id'] }}" selected>{{ resource_dropdown['name'] }}</option>
- {% else %}
- <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
- {% endif %}
- {% endif %}
- {% endfor %}
- </select>
- </div>
-
- {% elif resource['type'] == 'practice' %}
- <div class="mb-3 mt-3">
- <label for="linked_practice_id">Linked resources</label>
- </div>
- <div class="mb-3 mt-3">
- <select name="linked_resources" id="linked_resources" aria-label="Linked resources" class="selectpicker" data-live-search="true" multiple>
- {% for resource_dropdown in resource_dropdown %}
- {% if resource_dropdown['type'] != 'practice' %}
- {% if resource_dropdown in links %}
- <option value="{{ resource_dropdown['id'] }}" selected>{{ resource_dropdown['name'] }}</option>
- {% else %}
- <option value="{{ resource_dropdown['id'] }}">{{ resource_dropdown['name'] }}</option>
- {% endif %}
- {% endif %}
- {% endfor %}
- </select>
- </div>
- {% endif %}
-
- <div class="mb-3 mt-3">
- <button type="submit" class="btn btn-primary">Submit</button>
- </div>
- </form>
- <hr>
-
- {% if resource['type'] == 'tool' %}
- <form action="{{ url_for('tool.delete_tool', tool_id=resource['id']) }}" method="POST">
- <input type="submit" value="Delete"
- class="btn btn-danger btn-sm"
- onclick="return confirm('Are you sure you want to delete this tool?')">
- </form>
- {% endif %}
- {% endblock %}
|