{# -*- engine: jinja -*- #}
<div class="Box m-3 functionslist">
  <div class="Box-header py-2 d-flex sticky">
    {% set class_sortable = " sortable" if not info.static_report and function_list | length > 1 else "" %}
    <div role="rowheader" class="color-fg-muted flex-auto min-width-0 col-md-2{{class_sortable}}{% if class_sortable %} sorted-ascending{% endif %}">Function (File:Line)</div>
    <div role="rowheader" class="color-fg-muted flex-auto min-width-0 d-flex flex-justify-end flex-wrap flex-items-baseline{{class_sortable}}">Calls</div>
    <div role="rowheader" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2{{class_sortable}}">Lines</div>
    <div role="rowheader" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2{{class_sortable}}">Branches</div>
    {% if SHOW_CONDITION_COVERAGE %}
    <div role="rowheader" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2{{class_sortable}}">Conditions</div>
    {% endif %}
    <div role="rowheader" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2{{class_sortable}}">Blocks</div>
  </div>
  {% for entry in function_list %}
  <div class="Box-row Box-row--focus-gray py-2 d-flex">
    <div role="gridcell" class="color-fg-muted flex-auto min-width-0 col-md-2">
      {#- #}<a href="{%- if info.single_page %}#{{ entry['html_filename'] }}|
                     {%- elif (html_filename != entry['html_filename']) %}{{ entry['html_filename'] }}#
                     {%- else %}#
                     {%- endif %}l{{ entry['line'] }}">{{ entry["name"] }} ({{ entry["filename"] }}:{{ entry["line"] }})</a>
      {#- #}
    </div>
    <div role="gridcell" class="color-fg-muted flex-auto min-width-0 d-flex flex-justify-end flex-wrap flex-items-baseline" data-sort="{{'-' if entry['excluded'] else entry['count']}}">
      {%- if entry["excluded"] %}excluded
      {%- else %}
      {%-  if entry["count"] == 0 %}not called
      {%-  else %}called {{ entry["count"] }} time{% if entry["count"] > 1 %}s{% endif %}
      {%-  endif -%}
      {%- endif -%}
    </div>
    <div role="gridcell" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2">{{ entry["line_coverage"] }}%</div>
    <div role="gridcell" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2">{{ entry["branch_coverage"] }}%</div>
    {% if SHOW_CONDITION_COVERAGE %}
    <div role="gridcell" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2" >{{ entry["condition_coverage"] }}%</div>
    {% endif %}
    <div role="gridcell" class="color-fg-muted d-flex flex-justify-end flex-wrap col-2">{{ '-' if entry["blocks"] is none else entry["blocks"] }}%</div>
  </div>
  {% endfor %}
</div>
