[% META title = 'Admin » Screening Terms' -%]
[% # PROCESS dumper.tt dump = app_url %]
[% PROCESS admin/system_nav.tt page = 'screen_term' %]
[% screening_terms_dfv_js %]
<h2 align="center">Screen Terms</h2>
[% IF dfv_errors %]
<p class="error">[% c.config('msg').dfv_errors %]</p>
[% END %]
<p class="title">
[% div_name = 'new'; INCLUDE site/snippets/toggleview.tt %]
Add new entry
</p>
<div class="[% dfv_errors ? 'visible' : 'itemhidden' %]" id="[% div_name %]">
<form method="post" action="[% app_url %]/admin/screen_term/update"
[% screening_terms_onsubmit %] name="screening_term" id="screening_term">
<div class="indent">
<table>
<tr>
<td class="label">Description:</td>
<td class="content">
[% PROCESS site/ajax_input.tt field = 'description'
id = 'screen_description' %]
[% error_description %]
</td>
</tr>
<tr>
<td class="label">Tissue type:</td>
<td class="content">
<select name="sample_type" [% site.html.onfocus %]>
<option value=""> </option>
[% FOREACH type IN ['fresh', 'fixed'] %]
<option value="[% type %]">[% type %]</option>
[% END %]
</select>
[% error_sample_type %]
</td>
</tr>
<tr>
<td class="label">Active:</td>
<td class="content">
<select name="active" [% site.html.onfocus %]>
[% FOREACH option IN ['yes', 'no'] %]
<option value="[% option %]">[% option %]</option>
[% END %]
</select>
[% error_active %]
</td>
</tr>
</table>
<p class="indent">[% site.html.submit %]</p>
</div>
</form>
</div>
<p class="spacer"> </p>
[% IF screening_list.size %]
<div class="[% dfv_errors ? 'itemhidden' : 'visible' %]">
[% PROCESS site/page_count.tt %]
<table>
<tr>
<th></th>
<th>
<a href="[% app_url %]/admin/screen_term">Description</a>
</th>
<th>
<a href="[% url_with_path %]?sort_by=sample_type">Type</a>
</th>
<th>Active</th>
</tr>
[% FOREACH item IN screening_list %]
<tr>
<td>
[% IF cgi_pager; cgi_pager.first_pos_displayed + loop.count - 1; ELSE; loop.count; END %]
</td>
<td>
<input type="text" size="50" name="description" value="[% item.description | html %]"
[% site.html.disabled %] />
</td>
<td>
<select name="sample_type" [% site.html.disabled %]>
[% FOREACH type IN ['fresh', 'fixed'] %]
<option value="[% type %]" [% 'selected' IF type == item.sample_type %]>
[% type %]
</option>
[% END %]
</select>
</td>
<td>
<select name="active" [% site.html.disabled %]>
[% FOREACH option IN ['yes', 'no'] %]
<option value="[% option %]" [% 'selected' IF option == item.active %]>
[% option %]
</option>
[% END %]
</select>
</td>
<td align="center">
<a href="[% app_url %]/admin/screen_term/edit/[% item.id %]">Edit</a>
</td>
</tr>
[% END %]
</table>
</div>
[% PROCESS site/cgi_pager.tt %]
[% END %]