RSS Git Download  Clone
Raw Blame History
<!-- BEGIN [% component.name %] -->
    [% # PROCESS site/js/jquery.tt # already loaded in html_wrapper %]
	<script type="text/javascript" src="/js/jquery.textarea-expander.js"></script>

	<form method="post" action="[% app_url %]/admin/screen_test/update/[% c.query.param('id') %]"
    name="update_screen_tests" id="update_screen_tests">

  [% # site.html.expand %]

  [% total_tests = 0 %]

	[% FOREACH section IN lab_tests.keys.sort;
      # PROCESS dumper.tt dump = lab_tests.item(section) %]
    [% # slurp active tests:
      active_tests = [ ]; # reset array
      FOREACH test IN lab_tests.item(section); # PROCESS dumper.tt dump = test;
        NEXT IF test.is_active.match('no');
        active_tests.push(test.field_label) IF test.selected;
      END;
      NEXT UNLESS active_tests.size;
    %]

    <p class="indent">
      <strong>[% section %] [[% active_tests.size %]]</strong>:
      [% FOREACH test IN active_tests; # INCLUDE dumper.tt dump = lab_tests.${test}.as_tree; %]
        <span class="red">[% test %]</span>[% UNLESS loop.last %],[% END %]
      [% END %]
    </p>

    [% total_tests = total_tests + active_tests.size %]
  [% END %]

  [% UNLESS total_tests %]
    <p class="indent"><strong>[ no tests allocated ]</strong></p>
  [% END %]

  <div class="menubody">
	[% FOREACH section IN lab_tests.keys.sort; # PROCESS dumper.tt dump = section %]
		[%
			panels = [ ]; # reset
			tests  = [ ];
			FOREACH entry IN lab_tests.item(section); # PROCESS dumper.tt dump = entry;
				 tests.push(entry.label) IF entry.test_type == 'test';
				panels.push(entry.label) IF entry.test_type == 'panel';
      END;
        # PROCESS dumper.tt dump = tests;
        # PROCESS dumper.tt dump = panels;
		%]

    <div class="linkwithicon">
	  [% div_name = section.replace(' ', '_');
		INCLUDE site/snippets/toggleview.tt type = 'folder' %]
      <div class="aftericon">
        <span class="title">[% section %]</span>
      </div>
    </div>
		  [% site.html.ie_span_fix %]
    <div class="itemhidden" id="[% div_name %]">
      [% IF panels.size %]
        [% PROCESS admin/screen/test/row.tt test_type = 'panel' %]
      [% END %]

      [% IF tests.size %]
        [% PROCESS admin/screen/test/row.tt test_type = 'test' %]
      [% END %]

      [%
        IF lab_sections_map.item(section).has_section_notes.match('yes');
          section_id = lab_sections_map.item(section).id;
          section_details = section_details_map.item(section_id);
      %]
        <p class="indent">
          <span class="title">Section notes:</span>
        </p>
        <blockquote>
					<textarea name="lab_section_id_[% section_id %]" rows="2" cols="60"
            class="expand20-200">[% section_details # DO NOT WRAP THIS %]</textarea>
        </blockquote>
      [% END %]
    </div>
	[% END %]
  </div>

  [% IF csrf_token; PROCESS site/csrf.tt; END %]

  <p class="center">
    [% site.html.submit %]
    [% site.html.reset %]
	</p>
	</form>
<!-- END [% component.name %] -->