{% macro menu_item(name, endpoint=None) -%}
<li{% if request.endpoint == endpoint %} class="active"{% endif %}><a href="{{ url_for(endpoint) if endpoint else "#" }}">{{ name }}</a></li>
{%- endmacro %}
<!doctype html>
<html lang="fr">
  <head>
    {% block head -%}
    <meta charset="utf-8">
    <title>FFDN ISP Database</title>
    <!-- meta -->
    <link type="text/plain" rel="author" href="/humans.txt" />
    <!-- icon
    <link rel="shortcut icon" href="favicon.ico"> -->
    <!-- css -->
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/bootstrap.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/bootstrap-responsive.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/jquery.ui.all.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/bootstrap-select.min.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/leaflet.css') }}">
    <link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/style.css') }}">
    {%- endblock %}
  </head>
<body>

<div class="navbar navbar-static-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
      <a class="brand" href="/"><span id="ffdn-header"><span>F</span><span>F</span><span>D</span><span>N</span></span> Database</a>
      <div class="nav-collapse collapse">
        <form method="get" action="/search" class="navbar-search pull-right">
          <input type="text" id="search-input" class="search-query input-medium" name="q" placeholder="{{ _("Search") }}" />
        </form>
        <ul class="nav pull-right">
          {{ menu_item(_("Home"), 'home') }}
          {{ menu_item(_("Project List"), 'project_list') }}
          {{ menu_item(_("Format"), 'format') }}
          {{ menu_item(_("API")) }}
          <li class="divider-vertical"></li>
        </ul>
      </div>
    </div>
  </div>
</div>

<div id="main-container" class="container">
{% with messages = get_flashed_messages(with_categories="true") %}
  {% if messages %}
    {% for category, message in messages %}
    <div class="alert alert-{{ category }} fade in">
      <button class="close" data-dismiss="alert">×</button>
      {{ message }}
    </div>
    {% endfor %}
  {% endif %}
{% endwith %}
{%- block container %}
<div class="page-header">
  {% block page_header -%}
  <h2>{% block page_title %}{% endblock %}</h2>
  {%- endblock %}
</div>
<div class="container">
{% block body %}{% endblock %}
</div>

{% endblock container %}
</div>

{% block script -%}
<script type="text/javascript" src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/bootstrap-select.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/leaflet.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/site.js') }}"></script>
{%- endblock %}
</body>

</html>
