Commit 9627d660 authored by Ryan Herbert's avatar Ryan Herbert

forms reduce size of date fields

parent b779f20a
......@@ -2478,6 +2478,11 @@ form {
width: 234px;
}
&.date {
min-width: 60px;
width: 60px;
}
}
[hidden] {
display: none !important;
......
......@@ -117,9 +117,9 @@ FormBuilder.prototype.build_date = function(id, object, name, label) {
}
var d = this.build_wrapper();
var i = this.build_input(id, 'date', name, 'text', object, label+' (yyyy-mm-dd)', false);
var i = this.build_input(id, 'date', name, 'text', object, 'yyyy-mm-dd', false);
i.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))";
i.title = "yyyy-mm-dd"
i.title = label;
d.appendChild(i);
return d;
}
......
......@@ -42,9 +42,9 @@
</div>
</div>
<div class="field_div">
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text"
<input class="date form-control" id="sampling_date_{{=i}}" name="file[{{=i}}][sampling_date]" type="text" title="sampling date"
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))">
placeholder="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}}"
......
......@@ -8,7 +8,7 @@
<div>{{=", ".join(set['message'])}}</div>
{{ pass }}
<div class="field_div">
<input class="date form-control" id="patient_id_label_{{=i}}" name="patient[{{=i}}][id_label]" type="text"
<input class="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">
......@@ -22,7 +22,7 @@
<div class="field_div">
<input class="date form-control" id="patient_birth_{{=i}}" name="patient[{{=i}}][birth]" type="text"
value="{{if set is not None and set['birth'] is not None:}}{{=set['birth']}}{{pass}}"
title="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))" placeholder="Birth (yyyy-mm-dd)">
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
......
......@@ -8,7 +8,7 @@
<div>{{=", ".join(set['message'])}}</div>
{{ pass }}
<div class="field_div">
<input class="date form-control" id="run_id_label_{{=i}}" name="run[{{=i}}][id_label]" type="text"
<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>
</div>
<div class="field_div">
......@@ -18,7 +18,7 @@
<div class="field_div">
<input id="run_date_{{=i}}" name="run[{{=i}}][run_date]" type="text" class="date form-control"
value="{{if set is not None and set['run_date'] is not None:}}{{=set['run_date']}}{{pass}}"
placeholder="Date (yyyy-mm-dd)" title="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))">
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
......
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