<commit_before>{%  macro link(url, icon, title, full=1, badge='') -%}
<a href="{{ url }}" {% if not full %} data-toggle="tooltip" rel="tooltip" data-placement="left" data-original-title="{{ title }}"{% endif %} ><i class="{{ icon }}"></i> {% if full %}{{ title }} <span class="badge badge-important">{{ badge }}</span>{% endif %} </a>
{% endmacro -%}

{% macro nav(active, full=1) -%}
<div class="tabs-right pull-left">
  <ul class="nav nav-tabs">
    <li {% if active == 'upstream' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id), "icon-road", "Repository", full) }}</li>
    <li {% if active == 'build' %}class="active" {% endif %}>{{ link(url_for('project.history', project_id=project.id), "icon-building", "Build History", full) }}</li>
    {% set badge = "" if project.config['local'].get('setup') else "!" %}
    <li {% if active == 'setup' %}class="active" {% endif %}>{{ link(url_for('project.setup', project_id=project.id), "icon-cog", "Setup", full, badge=badge) }}</li>

{#    <li class="dropdown {% if active == 'setup' %}active{% endif %} ">#}
{#      <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-cog"></i> {% if full %}Settings{% endif %} <i class="caret"></i></a>#}
{#      <ul class="dropdown-menu">#}
        {# <li {% if active == 'utests' %}class="active" {% endif %}><a href="{{ url_for('project.utests', project_id=project.id) }}">Upstream Tests</a></li> #}
{#        <li {% if active == 'setup'  %}class="active" {% endif %}><a href="{{ url_for('project.setup',  project_id=project.id) }}">Setup</a></li>#}
{#        {% if project.config['local'].get('setup') %}#}
{#        <li {% if active == 'metadatajson' %}class="active" {% endif %}><a href="{{ url_for('project.metadatajson', project_id=project.id) }}" >METADATA.json</a></li>#}
{#        <li {% if active == 'description' %}class="active"  {% endif %}><a href="{{ url_for('project.description',  project_id=project.id) }}" >DESCRIPTION.en_us.html</a></li>#}
{#        {% endif %}#}
{#      </ul>#}
{#    </li>#}
    {% if full %}
    <li class="form-actions">
      <p>
        <small> Clone string: <br /></small>
        <input class="input-small" class="clone_url" type="text" value="{{ project.clone }}" readonly="readonly" onclick="this.select()">
      </p>
      <p><a class="btn btn-mini btn-primary" href="{{ url_for('project.pull', project_id = project.id )}}">Pull updates</a></p>
    </li>
    <li style="padding: 9px;">
      <small><a class="muted" href="{{ url_for('settings.delclone', project_id = project.id )}}" data-confirm="{{ _('Do you really want to remove this repository?') }}">Delete project</a></small>
    </li>

    {% endif %}
  </ul>
</div>
{%- endmacro %}

{% macro subnav_git(active, revision) %}
 <ul class="nav nav-tabs">
  <li {% if active == 'ufiles' and revision == 'HEAD' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id), "", "Upstream Files", true) }}</li>
  <li {% if active == 'gitlog' %}class="active" {% endif %}>{{ link(url_for('project.git', project_id=project.id), "", "Git History", true) }}</li>
  {% if revision and revision != 'HEAD' %}
    <li {% if active == 'ufiles' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id, revision=revision), "", "Files: %s" % revision, true) }}</li>
    <li {% if active == 'utests' %}class="active" {% endif %}>{{ link(url_for('project.utests', project_id=project.id, revision=revision), "", "Tests", true) }}</li>
  {% endif %}
  {% if active == 'diff' %}
  <li class="active"><a href="{{ url_for('project.diff', project_id=project.id, left=left, right=right) }}">Diff</a></li>
 {%  endif %}
</ul>
{% endmacro %}

{% macro subnav_build(active, revision) %}
 <ul class="nav nav-tabs">
  <li {% if active == 'history' %}class="active" {% endif %}>{{ link(url_for('project.history', project_id=project.id), "", "Build History", true) }}</li>
  <li {% if active == 'rfiles' %}class="active" {% endif %}>{{ link(url_for('project.rfiles', project_id=project.id, build_id=build.id), "", "Results Files", true) }}</li>
  <li {% if active == 'rtests' %}class="active" {% endif %}>{{ link(url_for('project.rtests', project_id=project.id, build_id=build.id), "", "Results Tests", true) }}</li>
  {#  <li {% if active == 'utests' %}class="active" {% endif %}>{{ link(url_for('project.utests', project_id=project.id, build_id=build.id), "", "Upstream Tests (rev %s)" % build.revision, true) }}</li> #}
  <li {% if active == 'log' %}class="active" {% endif %}>{{ link(url_for('project.log', project_id=project.id, build_id=build.id), "", "Build Log", true) }}</li>
  {% set badge = "!" if build.modified else "" %}
  <li {% if active == 'metadatajson' %}class="active" {% endif %}><a href="{{ url_for('project.metadatajson', project_id=project.id, build_id=build.id) }}" >METADATA.json</a></li>
  <li {% if active == 'description' %}class="active"  {% endif %}><a href="{{ url_for('project.description',  project_id=project.id, build_id=build.id) }}" >DESCRIPTION.en_us.html</a></li>

 </ul>
{% endmacro %}

{% macro subnav_setup(active) %}
<ul class="nav nav-tabs">
  <li {% if active == 'setup'  %}class="active" {% endif %}><a href="{{ url_for('project.setup',  project_id=project.id) }}">Setup</a></li>
  {% if project.config['local'].get('setup') %}
    {# Additional setup views here, only will be awailable if primary setup is done #}
  {% endif %}
</ul>
{% endmacro %}

{%- macro highlight(name) -%}
{% set highlight_files = ['license.txt', 'ofl.txt', 'fontlog.txt', 'readme.txt', 'readme.md' ] %}
{%- if name.lower() in highlight_files or name.lower().endswith('.ufo') %}class="highlight"{%- endif %}
{%- endmacro -%}

{%- macro filestree(tree, revision) %}
  <div class="tree">
    <ul>
      <li><a><i class="icon-folder-open"></i></a></li>
      <ul>
      {% set path = [] %}
      {% for key, value in tree.items() recursive %}
        <li {{ highlight(key) }} class="{%- if key == 'glyphs' and value -%}mother_of_glyphs{%- elif key.lower().endswith('.ufo') -%}mothership{%- endif -%}">
        {%- if revision %}
          <a href="{{ url_for('project.ufile', project_id=project.id, revision=revision, name="/".join(path+[key])) }}">
        {%- else %}
          <a {%- if key in project.config['local']['txt_files'] %} href="#{{ key }}" id="tree-{{ key }}"{%- endif %}>
        {%- endif %}
          {%- if key == '' %}
            &nbsp;
          {%- else %}
            {%-   if key.lower().endswith('.ufo') and value %}<i class="icon-font text-info"></i>
            {%- elif key.lower().endswith('.otf') %}<i class="icon-file"></i>
            {%- elif key.lower().endswith('.ttf') %}<i class="icon-file"></i>
            {%- elif key.lower().split('.')[-1] in ['txt', 'md', 'mdown', 'markdown'] %}<i class="icon-book"></i>
            {%- elif key.lower().split('.')[-1] in ['plist'] %}<i class="icon-list"></i>
            {%- elif key in ['glyphs', 'ttf', 'otf', 'src', 'sources'] %}<i class="icon-folder-close"></i>
            {%- elif key == 'bakery.yaml' %}<i class="icon-rocket text-error"></i>
            {%- else %}<i class="icon-file-alt muted"></i>
            {%- endif %}
             {{ key }}
          {%- endif %}
          </a>
        {%- if value %}<ul class="{% if key == 'glyphs' %}glyphs{% elif key.lower().endswith('.ufo') %}ufo-files{% endif %}">{%- do path.append(key) %}{{ loop(value.items()) }}{%- do path.pop() %}</ul>
        {% endif %}
        </li>
      {% endfor %}
      </ul>
    </ul>
  </div>
{%- endmacro %}

{%- macro showTests() %}
 <div class="">
    <ul class="inline muted">
        <li><i class="icon-circle text-warning"></i> means the test didn't work: fix the test</li>
        <li><i class="icon-circle text-error"></i> means the test failed: fix the font</li>
        <li><i class="icon-circle text-success"></i> means the test passed: fix yourself some cake</li>
    </ul>
    {# Tests per font file #}
    {%- for font in tests.keys() %}
        <h4 id="{{font.split('/')[-1].lower()|replace(' ', '')}}" class="toggle toggleCollapseFirst">{{ font }} <i class="icon"></i></h4>
        <div>
        <table class="table table-striped table-bordered table-condensed tablesorter testsByFont">
        <thead style="text-align:left">
            <th style="text-align:center">Result </th>
            <th>Test</th>
            <th>Tool</th>
            <th>File</th>
            <th>Method</th>
        </thead>
        {% set testTypes = { 'error': 'warning', 'failure': 'error', 'success': 'success' } %}
        {%- for testType, icon in testTypes.iteritems() | sort %}
          {%- for item in tests[font][testType] %}
            <tr class="{{ icon }}">
                <td style="text-align:center"><i class="icon-circle text-{{icon}}"></i></td>
                <td>{% if item.methodDoc == None %}{{item.methodName}}() <span class="muted">({{ _("add docstring") }})</span>{% else %}{{item.methodDoc}}{% endif %}</td>
                <td>{{ item.tool }}</td>
                <td>{{ item.name|replace('.','/') }}.py</td>
                <td>{{ item.methodName }}()</td>
            </tr>
          {%- endfor %}
        {%- endfor %}
        </table>
        </div>
        {% set  t = tests[font]['sum'] %}
        {% set sl = tests[font]['success']|length|int %}
        {% set el = tests[font]['error']|length|int %}
        {% set fl = tests[font]['failure']|length|int %}
        <div class="progress">
            <div class="bar bar-warning" style="width: {{ 100*el/t }}%;"></div>
            <div class="bar bar-danger" style="width: {{ 100*fl/t }}%;"></div>
            <div class="bar bar-success" style="width: {{ 100*sl/t }}%;"></div>
        </div>
    {%- endfor %}

    {# Tests for all fonts in 1 table #}
    <h3 id="allfonts">{{ _('All Fonts') }}</h3>
    <table class="table table-striped table-bordered table-condensed tablesorter" id="testsByTest">
    <thead style="text-align:left">
        <th style="text-align:center">Result </th>
        <th>Font</th>
        <th>Test</th>
        <th>Tool</th>
        <th>File</th>
        <th>Method</th>
    </thead>

    {%- for testType in ['error', 'failure', 'success'] %}
      {%- for font in tests.keys() %}
        {%- for item in tests[font][testType] %}
          <tr class="{{ testType | replace('error','warning') | replace('failure','error') }}">
            <td style="text-align:center"><i class="icon-circle text-{{ testType | replace('error','warning') | replace('failure','error') }}"></i></td>
            <td>{{ font }}</td>
            <td>{% if item.methodDoc == None %}{{item.methodName}}() <span class="muted">({{ _("add docstring") }})</span>{% else %}{{item.methodDoc}}{% endif %}</td>
            <td>{{ item.tool }}</td>
            <td>{{ item.name|replace('.','/') }}.py</td>
            <td>{{ item.methodName }}()</td>
          </tr>
        {%- endfor %}
      {%- endfor %}
    {%- endfor %}
    </table>

  </div>
{%- endmacro %}<commit_msg>Updated look&feel for tests report page<commit_after>{%  macro link(url, icon, title, full=1, badge='') -%}
<a href="{{ url }}" {% if not full %} data-toggle="tooltip" rel="tooltip" data-placement="left" data-original-title="{{ title }}"{% endif %} ><i class="{{ icon }}"></i> {% if full %}{{ title }} <span class="badge badge-important">{{ badge }}</span>{% endif %} </a>
{% endmacro -%}

{% macro nav(active, full=1) -%}
<div class="tabs-right pull-left">
  <ul class="nav nav-tabs">
    <li {% if active == 'upstream' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id), "icon-road", "Repository", full) }}</li>
    <li {% if active == 'build' %}class="active" {% endif %}>{{ link(url_for('project.history', project_id=project.id), "icon-building", "Build History", full) }}</li>
    {% set badge = "" if project.config['local'].get('setup') else "!" %}
    <li {% if active == 'setup' %}class="active" {% endif %}>{{ link(url_for('project.setup', project_id=project.id), "icon-cog", "Setup", full, badge=badge) }}</li>

{#    <li class="dropdown {% if active == 'setup' %}active{% endif %} ">#}
{#      <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-cog"></i> {% if full %}Settings{% endif %} <i class="caret"></i></a>#}
{#      <ul class="dropdown-menu">#}
        {# <li {% if active == 'utests' %}class="active" {% endif %}><a href="{{ url_for('project.utests', project_id=project.id) }}">Upstream Tests</a></li> #}
{#        <li {% if active == 'setup'  %}class="active" {% endif %}><a href="{{ url_for('project.setup',  project_id=project.id) }}">Setup</a></li>#}
{#        {% if project.config['local'].get('setup') %}#}
{#        <li {% if active == 'metadatajson' %}class="active" {% endif %}><a href="{{ url_for('project.metadatajson', project_id=project.id) }}" >METADATA.json</a></li>#}
{#        <li {% if active == 'description' %}class="active"  {% endif %}><a href="{{ url_for('project.description',  project_id=project.id) }}" >DESCRIPTION.en_us.html</a></li>#}
{#        {% endif %}#}
{#      </ul>#}
{#    </li>#}
    {% if full %}
    <li class="form-actions">
      <p>
        <small> Clone string: <br /></small>
        <input class="input-small" class="clone_url" type="text" value="{{ project.clone }}" readonly="readonly" onclick="this.select()">
      </p>
      <p><a class="btn btn-mini btn-primary" href="{{ url_for('project.pull', project_id = project.id )}}">Pull updates</a></p>
    </li>
    <li style="padding: 9px;">
      <small><a class="muted" href="{{ url_for('settings.delclone', project_id = project.id )}}" data-confirm="{{ _('Do you really want to remove this repository?') }}">Delete project</a></small>
    </li>

    {% endif %}
  </ul>
</div>
{%- endmacro %}

{% macro subnav_git(active, revision) %}
 <ul class="nav nav-tabs">
  <li {% if active == 'ufiles' and revision == 'HEAD' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id), "", "Upstream Files", true) }}</li>
  <li {% if active == 'gitlog' %}class="active" {% endif %}>{{ link(url_for('project.git', project_id=project.id), "", "Git History", true) }}</li>
  {% if revision and revision != 'HEAD' %}
    <li {% if active == 'ufiles' %}class="active" {% endif %}>{{ link(url_for('project.ufiles', project_id=project.id, revision=revision), "", "Files: %s" % revision, true) }}</li>
    <li {% if active == 'utests' %}class="active" {% endif %}>{{ link(url_for('project.utests', project_id=project.id, revision=revision), "", "Tests", true) }}</li>
  {% endif %}
  {% if active == 'diff' %}
  <li class="active"><a href="{{ url_for('project.diff', project_id=project.id, left=left, right=right) }}">Diff</a></li>
 {%  endif %}
</ul>
{% endmacro %}

{% macro subnav_build(active, revision) %}
 <ul class="nav nav-tabs">
  <li {% if active == 'history' %}class="active" {% endif %}>{{ link(url_for('project.history', project_id=project.id), "", "Build History", true) }}</li>
  <li {% if active == 'rfiles' %}class="active" {% endif %}>{{ link(url_for('project.rfiles', project_id=project.id, build_id=build.id), "", "Results Files", true) }}</li>
  <li {% if active == 'rtests' %}class="active" {% endif %}>{{ link(url_for('project.rtests', project_id=project.id, build_id=build.id), "", "Results Tests", true) }}</li>
  {#  <li {% if active == 'utests' %}class="active" {% endif %}>{{ link(url_for('project.utests', project_id=project.id, build_id=build.id), "", "Upstream Tests (rev %s)" % build.revision, true) }}</li> #}
  <li {% if active == 'log' %}class="active" {% endif %}>{{ link(url_for('project.log', project_id=project.id, build_id=build.id), "", "Build Log", true) }}</li>
  {% set badge = "!" if build.modified else "" %}
  <li {% if active == 'metadatajson' %}class="active" {% endif %}><a href="{{ url_for('project.metadatajson', project_id=project.id, build_id=build.id) }}" >METADATA.json</a></li>
  <li {% if active == 'description' %}class="active"  {% endif %}><a href="{{ url_for('project.description',  project_id=project.id, build_id=build.id) }}" >DESCRIPTION.en_us.html</a></li>

 </ul>
{% endmacro %}

{% macro subnav_setup(active) %}
<ul class="nav nav-tabs">
  <li {% if active == 'setup'  %}class="active" {% endif %}><a href="{{ url_for('project.setup',  project_id=project.id) }}">Setup</a></li>
  {% if project.config['local'].get('setup') %}
    {# Additional setup views here, only will be awailable if primary setup is done #}
  {% endif %}
</ul>
{% endmacro %}

{%- macro highlight(name) -%}
{% set highlight_files = ['license.txt', 'ofl.txt', 'fontlog.txt', 'readme.txt', 'readme.md' ] %}
{%- if name.lower() in highlight_files or name.lower().endswith('.ufo') %}class="highlight"{%- endif %}
{%- endmacro -%}

{%- macro filestree(tree, revision) %}
  <div class="tree">
    <ul>
      <li><a><i class="icon-folder-open"></i></a></li>
      <ul>
      {% set path = [] %}
      {% for key, value in tree.items() recursive %}
        <li {{ highlight(key) }} class="{%- if key == 'glyphs' and value -%}mother_of_glyphs{%- elif key.lower().endswith('.ufo') -%}mothership{%- endif -%}">
        {%- if revision %}
          <a href="{{ url_for('project.ufile', project_id=project.id, revision=revision, name="/".join(path+[key])) }}">
        {%- else %}
          <a {%- if key in project.config['local']['txt_files'] %} href="#{{ key }}" id="tree-{{ key }}"{%- endif %}>
        {%- endif %}
          {%- if key == '' %}
            &nbsp;
          {%- else %}
            {%-   if key.lower().endswith('.ufo') and value %}<i class="icon-font text-info"></i>
            {%- elif key.lower().endswith('.otf') %}<i class="icon-file"></i>
            {%- elif key.lower().endswith('.ttf') %}<i class="icon-file"></i>
            {%- elif key.lower().split('.')[-1] in ['txt', 'md', 'mdown', 'markdown'] %}<i class="icon-book"></i>
            {%- elif key.lower().split('.')[-1] in ['plist'] %}<i class="icon-list"></i>
            {%- elif key in ['glyphs', 'ttf', 'otf', 'src', 'sources'] %}<i class="icon-folder-close"></i>
            {%- elif key == 'bakery.yaml' %}<i class="icon-rocket text-error"></i>
            {%- else %}<i class="icon-file-alt muted"></i>
            {%- endif %}
             {{ key }}
          {%- endif %}
          </a>
        {%- if value %}<ul class="{% if key == 'glyphs' %}glyphs{% elif key.lower().endswith('.ufo') %}ufo-files{% endif %}">{%- do path.append(key) %}{{ loop(value.items()) }}{%- do path.pop() %}</ul>
        {% endif %}
        </li>
      {% endfor %}
      </ul>
    </ul>
  </div>
{%- endmacro %}

{%- macro showTests() %}
 <div style="max-width:900px" id="fonts-tests">
    <ul class="inline muted">
        <li><i class="icon-circle text-warning"></i> means the test didn't work: fix the test</li>
        <li><i class="icon-circle text-error"></i> means the test failed: fix the font</li>
        <li><i class="icon-circle text-success"></i> means the test passed: fix yourself some cake</li>
    </ul>
    {# Tests per font file #}
    {%- for font in tests.keys() %}
      <div class="row-fluid">
        <div class="span9"><h4 class="accordion-toggle" data-toggle="collapse" data-target="#fview{{loop.index}}">{{ font }}</h4></div>
        <div class="span3">
        {% set  t = tests[font]['sum'] %}
        {% set sl = tests[font]['success']|length|int %}
        {% set el = tests[font]['error']|length|int %}
        {% set fl = tests[font]['failure']|length|int %}
        <!-- <i class="icon-circle text-warning"></i> {{fl}} <i class="icon-circle text-error"></i> {{el}} <i class="icon-circle text-success"></i> {{sl}} -->
        <div class="progress" style="height:10px; margin-top:15px;">
            <div class="bar bar-warning" style="width: {{ 100*el/t }}%;"></div>
            <div class="bar bar-danger" style="width: {{ 100*fl/t }}%;"></div>
            <div class="bar bar-success" style="width: {{ 100*sl/t }}%;"></div>
        </div>
        </div>
      </div>
        <div id="fview{{loop.index}}" class="collapse">
        <table class="table table-condensed tablesorter">
        <thead style="text-align:left">
            <th style="text-align:center">Result </th>
            <th>Test</th>
        </thead>
        {% set testTypes = { 'error': 'warning', 'failure': 'error', 'success': 'success' } %}
        {%- for testType, icon in testTypes.iteritems() | sort %}
          {%- for item in tests[font][testType] %}
            <tr>
                <td style="text-align:center"><i class="icon-circle text-{{icon}}"></i> <span class="hidden">{{icon}}</span></td>
                <td class="{{ icon }}">{% if item.methodDoc == None %}{{item.methodName}}() <span class="muted">({{ _("add docstring") }})</span>{% else %}{{item.methodDoc}}{% endif %} <br />
                <small class="muted"><strong>{{item.tool}}</strong>: {{ item.methodName }} in {{ item.name|replace('.','/') }}.py</td> 
            </tr>
          {%- endfor %}
        {%- endfor %}
        </table>
        </div>
    {%- endfor %}

    <hr>
    {# Tests for all fonts in 1 table #}
    <h3 id="allfonts">{{ _('All Fonts') }}</h3>
    <table class="table table-condensed tablesorter">
    <thead style="text-align:left">
        <th style="text-align:center">Result </th>
        <th>Font</th>
        <th>Test</th>
    </thead>

    {%- for testType in ['error', 'failure', 'success'] %}
      {%- for font in tests.keys() %}
        {%- for item in tests[font][testType] %}
          <tr class="{{ testType | replace('error','warning') | replace('failure','error') }}">
              <td style="text-align:center"><i class="icon-circle text-{{ testType | replace('error','warning') | replace('failure','error') }}"></i> <span class="hidden">{{icon}}</span></td>
              <td>{{ font }}</td>
              <td class="{{ icon }}">{% if item.methodDoc == None %}{{item.methodName}}() <span class="muted">({{ _("add docstring") }})</span>{% else %}{{item.methodDoc}}{% endif %} <br />
              <small class="muted"><strong>{{item.tool}}</strong>: {{ item.methodName }} in {{ item.name|replace('.','/') }}.py</td> 
          </tr>

        {%- endfor %}
      {%- endfor %}
    {%- endfor %}
    </table>

  </div>
{%- endmacro %}
{'fraction_non_alphanumeric': 0.2512242239094299, 'fraction_numerical': 0.0021564311065187117, 'mean_word_length': 3.2815926139642237, 'pattern_counts': {'":': 0, '<': 465, '<?xml version=': 0, '>': 465, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7132623', 'n_tokens_mistral': 8083, 'n_tokens_neox': 7393, 'n_words': 1675}