Commit 0d7b009c authored by Ryan Herbert's avatar Ryan Herbert

inline form labels

parent 6dd6245c
......@@ -1874,12 +1874,10 @@ h3 .uid {
.right {
float: right;
clear: both;
}
.left {
float: left;
clear: both;
}
select>option:hover {
......@@ -2286,8 +2284,13 @@ form {
text-align: right;
}
div.field_div {
float: left;
display: inline-block;
}
.form_label {
line-height: 33px;
width: 70px;
}
}
.error {
......@@ -2303,11 +2306,14 @@ form {
display: inline-block;
}
.hidden {
display: none;
}
#fieldset_container {
:not(.set_token) {
> .icon-cancel {
float: right;
clear: both;
}
}
}
......
......@@ -91,7 +91,11 @@ FormBuilder.prototype.build_textarea = function(id, className, name, set_type, p
FormBuilder.prototype.build_div = function(type) {
var d = document.createElement('div');
var s = document.createElement('div');
var c = document.createElement('div');
c.className = "clear";
d.appendChild(c);
var s = document.createElement('span');
s.className = "left form_label"
s.innerText = capitalise(type) + " " + (this.index+1);
d.appendChild(s);
return d;
......@@ -282,6 +286,7 @@ FileFormBuilder.prototype.build_file_div = function() {
FileFormBuilder.prototype.build_hidden_fields = function() {
var d = document.createElement('div');
d.className = "hidden";
var i = this.build_input('filename', 'filename', 'filename', 'text', 'file');
i.hidden = true;
i.className = '';
......
......@@ -61,9 +61,11 @@
</div>
<div id="fieldset_container">
{{ for i, file in enumerate(files): }}
<div class="clear"></div>
{{ include 'partial/file/form.html' }}
{{ pass }}
</div>
<div class="clear"></div>
<span class="button"
onclick="add_file('fieldset_container', this.dataset.index++, {{=group_ids}})"
id="file_button"
......
<div>
<div>Sample {{=i+1}}</div>
<span class="left form_label" style="line-height: 33px">Sample {{=i+1}}</span>
{{ if file is not None and 'error' in file and len(file['error']) > 0: }}
<div class="error">error: {{=", ".join(file['error'])}}</div>
{{ pass }}
{{ if file is not None and 'message' in file and len(file['message']) > 0: }}
<div>{{=", ".join(file['message'])}}</div>
{{ pass }}
<div>
<div class="hidden">
<input type="hidden" id="file_filename_{{=i}}" class="filename" name="file[{{=i}}][filename]" type="text" value="">
<input type="hidden" id="file_id_{{=i}}" name="file[{{=i}}][id]"
value="{{if 'id' in file:}}{{=file['id']}}{{pass}}" >
......
<div>Set {{=i+1}}</div>
<span class="left form_label">Set {{=i+1}}</span>
<input type="hidden" id="generic_id_{{=i}}" name="generic[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" sample_set_id="generic_sample_set_id_{{=i}}" name="generic[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
{{ if set is not None and 'error' in set and len(set['error']) > 0: }}
......
<div>Patient {{=i+1}}</div>
<span class="left form_label">Patient {{=i+1}}</span>
<input type="hidden" id="patient_id_{{=i}}" name="patient[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" sample_set_id="patient_sample_set_id_{{=i}}" name="patient[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
{{ if set is not None and 'error' in set and len(set['error']) > 0: }}
......
<div>Run {{=i+1}}</div>
<span class="left form_label">Run {{=i+1}}</span>
<input type="hidden" id="run_id_{{=i}}" name="run[{{=i}}][id]" value="{{if set is not None:}}{{=set['id']}}{{pass}}">
<input type="hidden" sample_set_id="run_sample_set_id_{{=i}}" name="run[{{=i}}][sample_set_id]" value="{{if set is not None:}}{{=set['sample_set_id']}}{{pass}}">
{{ if set is not None and 'error' in set and len(set['error']) > 0: }}
......
......@@ -18,6 +18,7 @@
{{ pass }}
{{ pass }}
</div>
<div class="clear"></div>
<span class="button"
onclick="document.getElementById('fieldset_container').appendChild(new PatientFormBuilder().build(this.dataset.index++));"
id="patient_button"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment