<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}Base template{% endblock %} - Sous-chef</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap-3.1.1.min.css')}}">
    <!-- <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap-theme-3.1.1.min.css')}}"> -->
    <link rel="stylesheet" href="{{ url_for('static', filename='sous-chef.css')}}">
    <script src="{{ url_for('static', filename='jquery-1.11.0.min.js')}}"></script>
    <script src="{{ url_for('static', filename='bootstrap-3.1.1.min.js')}}"></script>
  </head>
  <body>
      <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#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="/">Sous-chef</a>
          </div>

          <div class="collapse navbar-collapse" id="navbar">
            <ul class="nav navbar-nav navbar-left">
              <li><a href="{{ url_for('ui.environments') }}">Environments</a></li>
              <li><a href="{{ url_for('ui.roles') }}">Roles</a></li>
              <li><a href="{{ url_for('ui.nodes') }}">Nodes</a></li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
              <li class="dropdown">
                <a href="{{ url_for('.environments') }}" class="dropdown-toggle" data-toggle="dropdown">
                {% if g.chef_environment == '*' %}
                  Showing nodes from all environments
                {% else %}
                  Showing nodes from <strong>{{ g.chef_environment }}</strong>
                {% endif %} <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  <li><a id="environment_all" href="{{ url_for(request.endpoint, environment='*', **request.view_args) }}">All environments</a></li>
                {% for environment in g.chef_environments | sort -%}
                  <li><a id="environment_{{ environment }}" href="{{ url_for(request.endpoint, environment=environment, **request.view_args) }}">{{ environment }}</a></li>
                {% endfor %}
                </ul>
              </li>
            </ul>
          </div>
        </div>
      </nav>

    <div class="container">
      <header class="row">
        <div class="col-sm-12">
          <div class="page-header">
            <h1>{% block header %}{{ self.title() }}{% endblock header %}</h1>
          </div>
        </div>
      </header>

      {% block body %}
      <div class="row">
        <div class="col-md-12">{% block content %}{% endblock %}</div>
      </div>
      {% endblock %}

      <footer class="row">
        <div class="col-sm-12">
          <p class="text-muted">
            <a href="https://github.com/datasift/sous-chef">Sous-chef</a> by <a href="https://github.com/borntyping">Sam Clements</a> and <a href="https://github.com/datasift">DataSift</a>. Built with <a href="http://flask.pocoo.org/">Flask</a> and <a href="https://github.com/coderanger/pychef">PyChef</a>. Source distributed under the MIT licence.
          </p>
        </div>
      </footer>
    </div>
  </body>
</html>

