Commit 40c99d4e authored by Mathieu Giraud's avatar Mathieu Giraud

views/*: bikeshedding, batch patient/run/set creation

parent 1611f363
......@@ -12,7 +12,7 @@
value="{{if set is not None:}}{{=set['name']}}{{pass}}" required placeholder="Name">
</div>
<div class="field_div">
<textarea
<input
onfocus="$(this).data('group-ids', [$('#group_select option:selected').val()]);
new VidjilAutoComplete().setupAtWho(this);"
data-needs-atwho="true"
......@@ -20,5 +20,5 @@
id="sample_set_info_{{=i}}"
name="generic[{{=i}}][info]"
rows="1"
placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea>
placeholder="set information (#tags can be used)">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</input>
</div>
......@@ -8,7 +8,7 @@
<div>{{=", ".join(set['message'])}}</div>
{{ pass }}
<div class="field_div">
<input class="form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text"
<input class="stringid form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text"
value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Patient ID">
</div>
<div class="field_div">
......@@ -25,7 +25,7 @@
title="birth date" 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))" placeholder="yyyy-mm-dd">
</div>
<div class="field_div">
<textarea
<input
onfocus="$(this).data('keys', [$('#group_select option:selected').val()]);
new VidjilAutoComplete().setupTags(this);"
data-needs-atwho="true"
......@@ -33,5 +33,5 @@
id="patient_info_{{=i}}"
name="patient[{{=i}}][info]"
rows="1"
placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea>
placeholder="patient information (#tags can be used)">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</input>
</div>
......@@ -8,12 +8,12 @@
<div>{{=", ".join(set['message'])}}</div>
{{ pass }}
<div class="field_div">
<input class="form-control" id="run_id_label_{{=i}}" name="run[{{=i}}][id_label]" type="text"
value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="Run ID"><span></span>
<input class="stringid form-control" id="run_id_label_{{=i}}" name="run[{{=i}}][id_label]" type="text"
value="{{if set is not None and set['id_label'] is not None:}}{{=set['id_label']}}{{pass}}" placeholder="run ID"><span></span>
</div>
<div class="field_div">
<input class="string form-control" id="run_name_{{=i}}" name="run[{{=i}}][name]" type="text"
value="{{if set is not None:}}{{=set['name']}}{{pass}}" required placeholder="Name">
value="{{if set is not None:}}{{=set['name']}}{{pass}}" required placeholder="run name">
</div>
<div class="field_div">
<input id="run_date_{{=i}}" name="run[{{=i}}][run_date]" type="text" class="date form-control"
......@@ -21,7 +21,7 @@
placeholder="yyyy-mm-dd" title="run date" 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
<input
onfocus="$(this).data('group-ids', [$('#group_select option:selected').val()]);
new VidjilAutoComplete().setupAtWho(this);"
data-needs-atwho="true"
......@@ -29,13 +29,14 @@
id="run_info_{{=i}}"
name="run[{{=i}}][info]"
rows="1"
placeholder="Info">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</textarea>
placeholder="run information (#tags can be used)">{{if set is not None and set['info'] is not None:}}{{=set['info']}}{{pass}}</input>
</div>
<div class="field_div">
<input id="run_sequencer_{{=i}}" name="run[{{=i}}][sequencer]" type="text" class="form-control"
value="{{if set is not None and set['sequencer'] is not None:}}{{=set['sequencer']}}{{pass}}" placeholder="Sequencer">
<input id="run_sequencer_{{=i}}" name="run[{{=i}}][sequencer]" type="text" class="form-control sequencer"
value="{{if set is not None and set['sequencer'] is not None:}}{{=set['sequencer']}}{{pass}}" placeholder="sequencer">
</div>
<div class="field_div">
<input id="run_pcr_{{=i}}" name="run[{{=i}}][pcr]" type="text" class="form-control"
value="{{if set is not None and set['pcr'] is not None:}}{{=set['pcr']}}{{pass}}" placeholder="PCR">
<input id="run_pcr_{{=i}}" name="run[{{=i}}][pcr]" type="text" class="form-control pcr"
value="{{if set is not None and set['pcr'] is not None:}}{{=set['pcr']}}{{pass}}" placeholder="primers, capture...">
</div>
{{extend 'db_layout.html'}}
<h3>Add patients, runs, or sets</h3>
<form id="object_form" action="DB_ADDRESS/sample_set/submit" enctype="multipart/form-data" method="post">
<div {{ if len(groups) <= 1: }} class="hiddenCheckBox" {{pass}}>
<label for="group_select" id="patient_group__label">Owner Group: </label>
{{= SELECT(*[OPTION(g['name'], _value=g['id']) for g in groups], _id="group_select", _name="group", _value=master_group, value=master_group) }}
</div>
<div class="buttons_add_elements">
<span class="button"
Patients, runs and sets are different ways to group samples.
You can create at once several of these sets:
<span class="button2"
onclick="document.getElementById('fieldset_container').appendChild(new PatientFormBuilder().build(this.dataset.index++));"
id="patient_button"
data-index="{{=len(sets[defs.SET_TYPE_PATIENT])}}">add patient</span>
<span class="button"
<span class="button2"
onclick="document.getElementById('fieldset_container').appendChild(new RunFormBuilder().build(this.dataset.index++));"
id="run_button"
data-index="{{=len(sets[defs.SET_TYPE_RUN])}}">add run</span>
<span class="button"
<span class="button2"
onclick="document.getElementById('fieldset_container').appendChild(new GenericFormBuilder().build(this.dataset.index++));"
id="generic_button"
data-index="{{=len(sets[defs.SET_TYPE_GENERIC])}}">add set</span>
......@@ -37,6 +40,3 @@
<input type="submit" value="save" class="btn"></td>
</form>
<div>
(* required fields)
</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