Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
255 lines (248 sloc) 11.7 KB
<!DOCTYPE html>
<html>
<head>
<title>{{^id}}Add{{/id}}{{#id}}Edit{{/id}} report</title>
{{>head}}
</head>
<body>
<div data-role="page">
<div data-role="header">
{{>home}}
<h1>{{^id}}Add{{/id}}{{#id}}Edit{{/id}} report</h1>
{{#id}}
{{#page_config.can_delete}}
<form action="{{svc}}/reports/{{id}}" method="post" data-ajax="false"
data-wq-json="true" data-wq-background-sync="false"
onsubmit="return require('wq/app').confirmSubmit(this, 'Are you sure you want to delete this record?');">
{{>csrf}}
<input type=hidden name="_method" value="DELETE">
<button type="submit" data-icon="delete" class="ui-btn-right">
Delete
</button>
</form>
{{/page_config.can_delete}}
{{/id}}
</div>
<div role="main" class="ui-content">
<form action="{{svc}}/reports/{{id}}" method="post" data-ajax="false"
data-wq-json="true"
{{#outbox_id}}
data-wq-outbox-id="{{outbox_id}}"
data-wq-outbox-preserve=""
{{/outbox_id}}>
{{>csrf}}
{{#id}}
<input type=hidden name="_method" value="PUT">
{{/id}}
<input type="hidden" name="status[slug]" value="valid">
<div class="ui-grid-a ui-responsive">
<div class="ui-block-a">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Event</li>
{{#event}}
{{^new_attachment}}{{#id}}
<input type="hidden" name="event[{{@index}}][id]" value="{{id}}">
{{/id}}{{/new_attachment}}
<li class="ui-field-contain">
<label for='report-event-site[slug]'>Site</label>
<select id='report-event-site[slug]' data-xform-type='string' name='event[site][slug]' required>
<option value="">Select one...</option>
{{#site[slug]_list}}
<option value="{{id}}"{{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{label}}
</option>
{{/site[slug]_list}}
</select>
<p class='error report-event-site[slug]-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-event-date'>Date</label>
<input id='report-event-date' type='date' data-xform-type='date' name='event[date]' required value="{{date}}">
<p class='error report-event-date-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-event-type[slug]'>Type</label>
<select id='report-event-type[slug]' data-xform-type='string' name='event[type][slug]' required>
<option value="">Select one...</option>
{{#type[slug]_list}}
<option value="{{id}}"{{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{label}}
</option>
{{/type[slug]_list}}
</select>
<p class='error report-event-type[slug]-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-event-depth'>Depth</label>
<input id='report-event-depth' type='number' data-xform-type='decimal' name='event[depth]' step='0.001' value="{{depth}}">
<p class='error report-event-depth-errors'></p>
</li>
{{/event}}
</ul>
</div>
<div class="ui-block-b">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Activity</li>
<li class="ui-field-contain">
<label for='report-project[slug]'>Project</label>
<select id='report-project[slug]' data-xform-type='string' name='project[slug]'>
<option value="">Select one...</option>
{{#project[slug]_list}}
<option value="{{id}}"{{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{label}}
</option>
{{/project[slug]_list}}
</select>
<p class='error report-project[slug]-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-time'>Time</label>
<input id='report-time' type='time' data-xform-type='time' name='time' value="{{time}}">
<p class='error report-time-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-activity_id'>Activity ID</label>
<input id='report-activity_id' type='text' data-xform-type='string' name='activity_id' value="{{activity_id}}">
<p class='error report-activity_id-errors'></p>
</li>
<li class="ui-field-contain">
<label for='report-comment'>Comment</label>
<textarea id='report-comment' name='comment' data-xform-type="text">{{comment}}</textarea>
<p class='error report-comment-errors'></p>
</li>
</ul>
</div>
</div>
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Results</li>
<li>
<table data-role='table' class='entry-table ui-responsive'>
<thead>
<tr>
<th>Characteristic</th>
<th>Spec.</th>
<th>Analytical<br>Method</th>
<th>Qualifier</th>
<th>Result</th>
<th>Units</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
{{#results}}
<tr class='section-results'>
<td>
{{^new_attachment}}{{#id}}
<input type="hidden" name="results[{{@index}}][id]" value="{{id}}">
{{/id}}{{/new_attachment}}
<select id='report-results-{{@index}}-type_id' data-xform-type='string' name='results[{{@index}}][type_id]' required data-mini="true" tabindex="-1">
<option value="">Select one...</option>
{{#type_list}}
<option value="{{id}}"{{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{label}}
</option>
{{/type_list}}
<option value="LOOKUP">More options...</option>
</select>
<p class='error report-results-{{@index}}-type_id-errors'></p>
</td>
<td>
<select id='report-results-{{@index}}-speciation_id' data-xform-type='string' name='results[{{@index}}][speciation_id]' data-mini="true" tabindex="-1">
<optgroup label="Recommended"></optgroup>
<optgroup label="Additional Options">
<option value=""></option>
{{#speciation_list}}
<option value="{{id}}" title="{{label}}" {{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{id}}
</option>
{{/speciation_list}}
<option value="LOOKUP">More options...</option>
</optgroup>
</select>
<p class='error report-results-{{@index}}-speciation_id-errors'></p>
</td>
<td>
<select id='report-results-{{@index}}-method_id' data-xform-type='string' name='results[{{@index}}][method_id]' required data-mini="true" tabindex="-1">
<optgroup label="Recommended"></optgroup>
<optgroup label="Additional Options">
<option value=""></option>
{{#method_list}}
<option value="{{id}}" title="{{label}}" {{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{id}}
</option>
{{/method_list}}
<option value="LOOKUP">More options...</option>
</optgroup>
</select>
<p class='error report-results-{{@index}}-method_id-errors'></p>
</td>
<td>
<select id='report-results-{{@index}}-qualifier' data-xform-type='select one' name='results[{{@index}}][qualifier]' data-mini="true" tabindex="-1">
<option value=""></option>
{{#qualifier_choices}}
<option value="{{name}}" title="{{label}}" {{#selected}} selected{{/selected}}>
{{name}}
</option>
{{/qualifier_choices}}
</select>
<p class='error report-results-{{@index}}-qualifier-errors'></p>
</td>
<td style='width:5em;'>
<input id='report-results-{{@index}}-value' type='text' data-xform-type='string' name='results[{{@index}}][value]' value="{{value}}">
<p class='error report-results-{{@index}}-value-errors'></p>
</td>
<td>
<select id='report-results-{{@index}}-unit_id' data-xform-type='string' name='results[{{@index}}][unit_id]' data-mini="true" tabindex="-1">
<optgroup label="Recommended"></optgroup>
<optgroup label="Additional Options">
<option value=""></option>
{{#unit_list}}
<option value="{{id}}" title="{{label}}" {{#selected}} selected{{/selected}}>
{{#outbox}}*{{/outbox}} {{id}}
</option>
{{/unit_list}}
<option value="LOOKUP">More options...</option>
</optgroup>
</select>
<p class='error report-results-{{@index}}-unit_id-errors'></p>
</td>
<td>
<input id='report-results-{{@index}}-comment' name='results[{{@index}}][comment]' data-xform-type="text" value="{{comment}}">
<p class='error report-results-{{@index}}-comment-errors'></p>
</td>
<td class="result-divider">
<hr>
</td>
</tr>
{{/results}}
<tr>
<td colspan=7>
<button type="button" data-wq-action="addattachment" data-wq-section="results" data-icon="plus">
Add Result
</button>
</td>
</tr>
</tbody>
</table>
</li>
<li>
<div class="ui-grid-a">
<div class="ui-block-a">
<a href="{{rt}}/reports/{{id}}" data-role="button" data-icon="back" data-direction="reverse">
Back
</a>
</div>
<div class="ui-block-b">
<button type="submit" data-icon="check" data-theme="b">
Submit
</button>
</div>
</div>
<p class="error report-errors"></p>
</li>
</ul>
</form>
</div>
</div>
</body>
</html>