aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/templates
diff options
context:
space:
mode:
authorPjotr Prins2020-04-19 12:19:29 -0500
committerGitHub2020-04-19 12:19:29 -0500
commitc4ba1c7b868b2b9b2b7c7b4f87e2856409b1767d (patch)
treeeda50e35b2f3d65c7d71e11f8d02973075f0f498 /bh20simplewebuploader/templates
parentf9d65865cf06bdd55ba40c932267b371484d5029 (diff)
parent528186eea8a70ecab6359a07aef3be87177d5144 (diff)
downloadbh20-seq-resource-c4ba1c7b868b2b9b2b7c7b4f87e2856409b1767d.tar.gz
bh20-seq-resource-c4ba1c7b868b2b9b2b7c7b4f87e2856409b1767d.tar.lz
bh20-seq-resource-c4ba1c7b868b2b9b2b7c7b4f87e2856409b1767d.zip
Merge pull request #24 from adamnovak/dropdowns
Add dropdown support to web uploader metadata form
Diffstat (limited to 'bh20simplewebuploader/templates')
-rw-r--r--bh20simplewebuploader/templates/form.html19
1 files changed, 15 insertions, 4 deletions
diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html
index df66e8c..6993cf5 100644
--- a/bh20simplewebuploader/templates/form.html
+++ b/bh20simplewebuploader/templates/form.html
@@ -211,7 +211,6 @@
<div id="metadata_fill_form_spot">
<div id="metadata_fill_form">
- {{ record }}
{% for record in fields %}
{% if 'heading' in record %}
@@ -221,15 +220,27 @@
<div class="record">
<h4>{{ record['heading'] }}</h4>
{% else %}
- <label for="{{ record['id'] }}">
+ <label for="{{ record['id'] }}" title="{{ record.get('docstring', '') }}">
{{ record['label'] }}
{{ "*" if record['required'] else "" }}
- {% if 'ref_url' in record %}
- <a href="{{ record['ref_url'] }}" title="More Info" target="_blank">?</a>
+ {% if 'docstring' in record %}
+ <a href='javascript:alert({{ record['docstring'] | tojson }})'>❓</a>
+ {% endif %}
+ {% if 'ref_iri' in record %}
+ <a href="{{ record['ref_iri'] }}" target="_blank" title="Ontology Link">🔗</a>
{% endif %}
</label>
+ {% if record['type'] == 'select' %}
+ <select id="{{ record['id'] }}" name="{{ record['id'] }}" {{ "required" if record['required'] else "" }}>
+ <option value="" selected>Choose one...</option>
+ {% for option in record['options'] %}
+ <option value="{{ option[1] }}">{{ option[0] }}</option>
+ {% endfor %}
+ </select>
+ {% else %}
<input type="{{ record['type'] }}" id="{{ record['id'] }}" name="{{ record['id'] }}" {{ "required" if record['required'] else "" }}>
{% endif %}
+ {% endif %}
{% if loop.index == loop.length %}
</div>
{% endif %}