<!-- BEGIN [% component.name %] -->
    <div class="row">
        <div class="span2">
          <span class="label label-info">Supporting information:</span>
        </div>
    </div>

    [% BLOCK section_result_summary; # generates composite results + summary:
        results = all_results.item(section_name); # INCLUDE dumper.tt dump = results;

    	test_results = [ ]; # reset array
        p53_data = {}; # for composite p21/p53 result

		FOREACH t IN results.test; # PROCESS dumper.tt dump = t;
		  NEXT UNLESS t.value.result;
		  IF t.value.result.match('\d'); # add % sign:
			t.value.result = t.value.result _ '%';
          END;

          # composite p21/p53 result:
          IF section_name.lower.match('immunohistochemistry');
            IF t.value.test_name == 'p21';
              p53_data.p21 = t.value.result; NEXT; # don't add p21 result to test_results
            ELSIF t.value.test_name == 'p53';
              p53_data.p53 = t.value.result; NEXT; # don't add p53 result to test_results
            END;
          END;

		  result = t.key.html _ '<span class="superscript">' _ t.value.result.html
            _ '</span>';
		  test_results.push(result);
		END;

        IF p53_data.size; # PROCESS dumper.tt dump = p53_data;
            p53_result = 'p53' _ '<span class="superscript">'
                _ composite_p53(p53_data) _ '</span>';
            test_results.push(p53_result);
        END;
		# create composite output - results (if any) + result summary
		composite = [];
		composite.push(test_results.join(' ')) IF test_results.size;
		composite.push(result_summary); # PROCESS dumper.tt dump = composite;
		# result summary author:
		IF entry.value.exists('user');
			result_reporter =
				entry.value.user.first_name.ucfirst _ ' ' _
				entry.value.user.last_name.ucfirst _ ' [' _
				entry.value.time.strftime('%a %d.%b.%Y') _ ' @ ' _
				entry.value.time.strftime('%H:%M') _ ']';
			composite.push(result_reporter);
		END;
		composite.join('<br />'); # rendered inside <pre> block
	  END
	%]

	[% accordion_class = ['accordion-body', 'collapse'];
          # force collapsed section open if print request:
          accordion_class.push('in') IF is_print_request;
    %]
    <div class="accordion" [% UNLESS is_print_request # prevent collapse %]
          id="summaries"[% END %]>
        [% IF report.morphology %]
          <!-- morphology -->
          <div class="accordion-group">
            <div class="accordion-heading">
              <a class="accordion-toggle" data-toggle="collapse"
                  data-parent="#summaries" href="#collapseOne">
                MORPHOLOGY [% UNLESS is_print_request %]
                    <i class="icon-fullscreen"></i>
                [% END %]
              </a>
            </div>
            <div id="collapseOne" class="[% accordion_class.join(' ') %]">
              <div class="accordion-inner">
                <div class="indent">
                  <div class="preformat">[% symbolise(report.morphology)
                    | html_line_break %]
                  </div>
                </div>
              </div>
            </div>
          </div>
        [% END %]

        [% FOREACH entry IN result_summaries; # INCLUDE dumper.tt dump = entry.value;
            section_name = entry.key ; # section_name %]
          <!-- [% section_name %] -->
          <div class="accordion-group no-break">
            <div class="accordion-heading">
              <a class="accordion-toggle" data-toggle="collapse" data-parent="#summaries"
                href="#collapse[% section_name.replace('\W+', '').lower %]">
                 [% label = special_formatting.section_name_map.item(section_name.lower)
                    || section_name; label.upper %]
                [% UNLESS is_print_request %]
                  <i class="icon-fullscreen"></i>
                  <!-- <span style="font-size: x-small">]expand]</span> -->
                [% END %]
              </a>
            </div>

            <div [% UNLESS is_print_request # prevent collapse %]
                id="collapse[% section_name.replace('\W+', '').lower %]"[% END %]
                class="[% accordion_class.join(' ') %]">
              <div class="accordion-inner">
                <div class="indent">
                  [% foreign_id = remote_system_ids.item(section_name).foreign_id;
                    IF foreign_id %]
                    <p class="accordion-heading">Specimen ref: [% foreign_id %]</p>
                  [% END %]
                  <!-- make_chart // will draw chart if required: -->
                  [% PROCESS site/make_chart.tt format_info = special_formatting %]
                  [%
					class = [ 'preformat' ];
                    class.push('text-error', 'rs-highlight') IF entry.value.time
						AND ref_time # fatal if either unset:
                        AND ( entry.value.time.subtract_datetime(ref_time).delta_days > 0 );
                        # ? 'text-error rs-highlight' : 'normal'; # INCLUDE debug_delta_days o = entry.value.time;
                    result_summary = symbolise(entry.value.results_summary); # escapeHTML already done
                    %][% # INCLUDE dumper.tt dump = class %]
                    <div class="[% class.join(' ') %]">[%- INCLUDE section_result_summary -%]</div>
                </div>
              </div>
            </div>
          </div>
        [% END %]
    </div>
<!-- END [% component.name %] -->
