aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/templates
diff options
context:
space:
mode:
authorAdam Novak2020-05-05 14:27:58 -0700
committerAdam Novak2020-05-05 14:27:58 -0700
commit07ff2d0f44d07bcca830f020e72ae2389a909f4f (patch)
tree3303cf2a6785164bc30253d49ac57098b47028e5 /bh20simplewebuploader/templates
parent0add6e53959fd0e7395f35289d958827b8d5a611 (diff)
downloadbh20-seq-resource-07ff2d0f44d07bcca830f020e72ae2389a909f4f.tar.gz
bh20-seq-resource-07ff2d0f44d07bcca830f020e72ae2389a909f4f.tar.lz
bh20-seq-resource-07ff2d0f44d07bcca830f020e72ae2389a909f4f.zip
Add JS at front end for lists, and date support on backend
Diffstat (limited to 'bh20simplewebuploader/templates')
-rw-r--r--bh20simplewebuploader/templates/form.html56
1 files changed, 32 insertions, 24 deletions
diff --git a/bh20simplewebuploader/templates/form.html b/bh20simplewebuploader/templates/form.html
index ffd4158..cea444c 100644
--- a/bh20simplewebuploader/templates/form.html
+++ b/bh20simplewebuploader/templates/form.html
@@ -32,10 +32,10 @@
<div class="search">
<input id="search-input" id="global-search" type="search" placeholder="FASTA uri" required>
<button class="button search-button" type="submit" onclick="search()">
- <span class="icon ion-search">
- <span class="sr-only">Search</span>
- </span>
- </button>
+ <span class="icon ion-search">
+ <span class="sr-only">Search</span>
+ </span>
+ </button>
</div>
</section>
@@ -116,26 +116,34 @@
<div class="record">
<h4>{{ record['heading'] }}</h4>
{% else %}
- <label for="{{ record['id'] }}" title="{{ record.get('docstring', '') }}">
- {{ record['label'] }}
- {{ "*" if record['required'] else "" }}
- {% if 'docstring' in record %}
- <a href='javascript:alert({{ record['docstring'] | tojson }})'>❓</a>
+ <div class="field-group" data-keypath="{{ record['id'] }}">
+ <div class="field" data-number="0">
+ <label for="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}" title="{{ record.get('docstring', '') }}">
+ {{ record['label'] }}
+ {{ "*" if record['required'] else "" }}
+ {% 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 class="control" id="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}" name="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}" {{ "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 class="control" type="{{ record['type'] }}" id="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}" name="{{ record['id'] }}{{ '[0]' if record['list'] else ''}}" {{ "required" if record['required'] else "" }} {{ ("step=" + record['step']) if 'step' in record else ""}}>
+ {% endif %}
+ </div>
+ {% if record['list'] %}
+ <button type="button" title="Remove field" class="remove-field hidden">➖</button>
+ <button type="button" title="Add field" class="add-field">➕</button>
{% 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 "" }} {{ ("step=" + record['step']) if 'step' in record else ""}}>
- {% endif %}
+ </div>
{% endif %}
{% if loop.index == loop.length %}
</div>
@@ -190,7 +198,7 @@
</div>
<script type="text/javascript">
- let scriptRoot = {{ request.script_root|tojson|safe }};
+ let scriptRoot = {{ request.script_root|tojson|safe }};
</script>
<script type="text/javascript" src="/static/main.js"></script>