{% extends "suite-base.html" %}
{% block title_name %}file view{% endblock %}

{% block content %}
<div class="page-header">
{% include "search-form.html" -%}

{% if path_in_tar -%}
  <h1>{{path_in_tar}}
    <small>&lt; {{path}}</small>
  </h1>
  <div class="pull-right">
    <a id="toggle-fuzzy-time" data-no-fuzzy-time="{{no_fuzzy_time}}" href="#">
      <small>toggle &Delta;t</small>
    </a>
  </div>
  <div>
    <small>
      <a href="{{script}}/view/{{user}}/?&amp;suite={{suite|replace("/", "%2F")}}&amp;path={{path}}">{{f_name}}</a>
      <span class="label label-default">Content loaded
      <abbr class="livestamp" title="{{time}}">{{time}}</abbr></span>
    </small>
  </div>
{% else -%}
  <h1>{{path}}</h1>
  <div class="pull-right">
    <a id="toggle-fuzzy-time" data-no-fuzzy-time="{{no_fuzzy_time}}" href="#">
      <small>toggle &Delta;t</small>
    </a>
  </div>
  <div>
    <small>
      {{f_name}}
      <span class="label label-default">Content loaded
      <abbr class="livestamp" title="{{time}}">{{time}}</abbr></span>
    </small>
  </div>
{% endif -%}

{% if entry -%}
  <hr />
  <table summary="task job entry"
  class="table table-bordered table-condensed table-striped">
  {% include "job-entry-head.html" %}
    <tbody>
  {% include "job-entry.html" %}
    </tbody>
  </table>
{% endif -%}
</div>

<div class="container-fluid">
<div class="row">
<div id="file-container">
<div class="col-md-1 text-right">
<pre class="prettyprint">
{% for i in range(1, lines|length + 1) -%}
<span><a id="{{i}}" class="line-number" href="#{{i}}">{{i}}</a></span>
{% endfor -%}
</pre>
</div>
<div class="col-md-11">
<pre id="filecode"{% if file_content %} class="prettyprint lang-{{file_content}}"{% endif %}>
{% for line in lines -%}
{% if not file_content -%}
{% set line = line | replace(
    'DEBUG', '<span class="nocode text-muted">DEBUG</span>') | replace(
    'INFO', '<span class="nocode text-info">INFO</span>') | replace(
    'ERROR', '<span class="nocode text-dander">ERROR</span>') | replace(
    'CRITICAL', '<span class="nocode text-dander">CRITICAL</span>') | replace(
    'WARNING', '<span class="nocode text-warning">WARNING</span>') -%}
{% endif -%}
{% if mode == "tags" -%}
{{line}}
{% else -%}
{{line|urlise}}
{% endif -%}
{% endfor -%}
</pre>
</div>
</div>
</div>
</div>
{% endblock %}
