<!DOCTYPE html>
<html lang="en">
<head>
<title>{% if path is defined %}{{path}} {% endif %}{{suite}}~{{user}}:
{{title}} @ {{host}} - {% block title_name %}{% endblock %}</title>
{% block auto_refresh %}{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="{{script}}/favicon.png" />
<link rel="shortcut icon" href="{{script}}/favicon.png" />
<link type="text/css" href="{{script}}/css/bootstrap.min.css"
rel="stylesheet" media="screen" />
<link type="text/css" href="{{script}}/css/cylc-review.css" rel="stylesheet" media="screen" />
{% if file_content is defined and file_content -%}
<link type="text/css" href="{{script}}/css/prettify.css"
rel="stylesheet" media="screen" />
{% endif -%}
</head>
<body>

<!-- Static navbar -->
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed"
      data-toggle="collapse" data-target="#navbar" aria-expanded="false"
      aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{{script}}/">
        {% if logo -%}
        <img {{logo}} />
        {% endif -%}
        {{title}} <small>@ {{host}}</small>
      </a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">

        <li><a href="{{script}}/suites/{{user}}">{{user}}</a></li>
        <li><a><strong>{{suite}}</strong></a></li>
        {% for method, name, icon in [
            ("cycles", "cycles list", "glyphicon-tasks"),
            ("taskjobs", "task jobs list", "glyphicon-th-list"),
            ("broadcast_states", "broadcasts list", "glyphicon-bullhorn")] %}
        {% if name == self.title_name() %}
        <li class="active">
          <a>
            <i class="glyphicon {{icon}}" title="{{name}}"></i>
            {{name}}
          </a>
        </li>
        {% else %}
        <li>
          <a href="{{script}}/{{method}}/{{user}}?&amp;suite={{suite|replace("/", "%2F")}}">
            <i class="glyphicon {{icon}}" title="{{name}}"></i>
            {{name}}
          </a>
        </li>
        {% endif %}
        {% endfor %}
        {% if files -%}
        {% for scheme, scheme_files in files|dictsort -%}
        {% if scheme_files -%}
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            {{scheme}} files <b class="caret"></b>
          </a>
          <ul class="dropdown-menu">
        {% for key, log in scheme_files|dictsort -%}
        {% if log.paths and log.paths|length > 1 -%}
            <li class="dropdown-submenu">
              <a href="#">{{log.path}}</a>
              <ul class="dropdown-menu">
        {% for log_path in log.paths -%}
                <li>
                  <a href="{{script}}/view/{{user}}?&amp;suite={{suite|replace("/", "%2F")}}&amp;path={{log_path}}&amp;no_fuzzy_time={{no_fuzzy_time}}"
                  title="{{log.size}} bytes">{{log_path}}</a>
                </li>
        {% endfor -%}
              </ul>
            </li>
        {% else -%}
            <li>
              <a href="{{script}}/view/{{user}}?&amp;suite={{suite|replace("/", "%2F")}}&amp;path={{log.path}}&amp;no_fuzzy_time={{no_fuzzy_time}}"
              title="{{log.size}} bytes">{{key}}</a></li>
        {% endif -%}
        {% endfor -%}
          </ul>
        </li>
        {% endif -%}
        {% endfor -%}
        {% endif -%}
      </ul>

{% if path is defined %}
{% include "view-mode.html" %}
{% endif %}
    </div>
  </div>
</nav>


{% block content %}{% endblock %}

<div class="container-fluid">
<div class="row">
<div class="col-md-12 text-right">
<hr/>
<address><small>Cylc {{cylc_version}}</small></address>
</div>
</div>
</div>

<script type="text/javascript" src="{{script}}/js/jquery.min.js"></script>
<script type="text/javascript" src="{{script}}/js/bootstrap.min.js">
</script>
<script type="text/javascript" src="{{script}}/js/moment.min.js">
</script>
<script type="text/javascript" src="{{script}}/js/livestamp.min.js">
</script>
<script type="text/javascript" src="{{script}}/js/cylc-review.js">
</script>
{% if path is defined and path -%}
<script type="text/javascript" src="{{script}}/js/search.js">
</script>
{% endif -%}
{% if file_content is defined and file_content -%}
<script type="text/javascript" src="{{script}}/js/prettify.js">
</script>
<script type="text/javascript" src="{{script}}/js/prettify-{{file_content}}.js">
</script>
<script type="text/javascript">
$(prettyPrint);
</script>
{% endif -%}
</body>
</html>
