Commit 863a59fb authored by Ryan Herbert's avatar Ryan Herbert

form_builder.js partial/file/form alter form order

Place sets field at the end of the form. since it can expand a lot, we
don't want other fields to move around as a consequence.

See #3046
parent fb1718dd
......@@ -258,9 +258,9 @@ FileFormBuilder.prototype.build = function(index) {
div.appendChild(this.createCloseButton());
div.appendChild(this.build_hidden_fields());
div.appendChild(this.build_file_div());
div.appendChild(this.build_set_div());
div.appendChild(this.build_date('sampling_date', 'file'));
div.appendChild(this.build_info('file', this.group_ids));
div.appendChild(this.build_set_div());
return div;
}
......
......@@ -46,6 +46,21 @@
</div>
</div>
</div>
<div class="field_div">
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text"
value="{{if 'sampling_date' in file and file['sampling_date'] is not None:}}{{=file['sampling_date']}}{{pass}}"
placeholder="Sampling Date (yyyy-mm-dd)" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
</div>
<div class="field_div">
<textarea id="file_info_{{=i}}"
onfocus="new VidjilAutoComplete().setupTags(this);"
data-needs-atwho="true"
data-keys="{{=group_ids}}"
class="text form-control"
name="file[{{=i}}][info]"
rows="1"
placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea>
</div>
<div class="field_div">
<div class="token_div form-control" onclick="$('#token_input_{{=i}}').focus()">
<input
......@@ -76,19 +91,4 @@
type="text">
</div>
</div>
<div class="field_div">
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text"
value="{{if 'sampling_date' in file and file['sampling_date'] is not None:}}{{=file['sampling_date']}}{{pass}}"
placeholder="Sampling Date (yyyy-mm-dd)" pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
</div>
<div class="field_div">
<textarea id="file_info_{{=i}}"
onfocus="new VidjilAutoComplete().setupTags(this);"
data-needs-atwho="true"
data-keys="{{=group_ids}}"
class="text form-control"
name="file[{{=i}}][info]"
rows="1"
placeholder="Info">{{if 'info' in file and file['info'] is not None:}}{{=file['info']}}{{pass}}</textarea>
</div>
</div>
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