<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Malcom {{ g.config['VERSION'] }}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">


    <!-- Le styles -->
    <link href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
    <style>
      body {
        padding-top: 50px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>

    <link rel="stylesheet" href="{{ url_for('static', filename='jquery/jquery-ui.css') }}" />

    <!-- custom scripts -->
    <script type="text/javascript">
      var url_static_prefix = "{{ url_for('index', _external=True) }}";
      var url_websocket_prefix = url_static_prefix.replace('http','ws');
    </script>
    <script src="{{ url_for('static', filename='d3js/d3.v3.min.js') }}"></script>
    <script src="{{ url_for('static', filename='jquery/jquery-1.9.1.js') }}"></script>
    <script src="{{ url_for('static', filename='jquery/jquery-ui.js') }}"></script>
    <script src="{{ url_for('static', filename='bootstrap/js/bootstrap.min.js') }}"></script>
    <link href="{{ url_for('static', filename='custom_css/style.css') }}" rel='stylesheet'>
    <link href="{{ url_for('static', filename='custom_css/d3_graph.css') }}" rel='stylesheet'>

    {% block custom_head %}
    {% endblock %}
    <script type="text/javascript" src="{{ url_for('static', filename='custom_js/misc.js') }}" charset="utf-8"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='custom_js/analytics_websockets.js') }}" charset="utf-8"></script>
    <script>
      initAnalyticsWebSocket()
      ws_analytics.onopen = analyticsInterfaceInit
    </script>

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="{{ url_for('static', filename='js/html5shiv.js') }}"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ url_for('static', filename='bootstrap/ico/apple-touch-icon-144-precomposed.png') }}">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ url_for('static', filename='bootstrap/ico/apple-touch-icon-114-precomposed.png') }}">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ url_for('static', filename='bootstrap/ico/apple-touch-icon-72-precomposed.png') }}">
                    <link rel="apple-touch-icon-precomposed" href="{{ url_for('static', filename='bootstrap/ico/apple-touch-icon-57-precomposed.png') }}">
                                   <link rel="shortcut icon" href="{{ url_for('static', filename='bootstrap/ico/favicon.png') }}">
  </head>

  <body>

  <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <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="{{ url_for('index')}}">Malcom</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">

          <ul class="nav navbar-nav">
            <li id='search-nav'><a href="{{url_for('search')}}">Search</a></li>
            <li id='populate-nav'><a href="{{url_for('populate')}}">Populate</a></li>
            <li id='sniffer-nav'><a href="{{url_for('sniffer')}}">Network captures</a></li>
            <li id='feeds-nav'><a href="{{url_for('feeds')}}">Feeds</a></li>
            <li id='dataset-nav'><a href="{{url_for('dataset')}}">Browse dataset</a></li>
          </ul>

          <ul class="nav navbar-nav navbar-right">
            <li class='dropdown'>
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
              {{ current_user.username }} <span class="caret"></span>
              </a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="{{url_for('account_sessions')}}"> <span class='glyphicon glyphicon-facetime-video'></span> Network captures</a></li>
                <li class="divider"></li>
                <li><a href="{{url_for('account_settings')}}"> <span class='glyphicon glyphicon-wrench'></span> Account settings</a></li>
                <li><a href="{{url_for('logout')}}"> <span class='glyphicon glyphicon-off'></span> Logout</a></li>
              </ul>
            </li>
            <li id='iface-nav'>
                  <div class='interfaces' id='interfaces-tooltip'>
                    <table style='float:left'>
                      {% for i in g.config['IFACES'] %}
                        <tr><th>{{i}}</th><td>{{ g.config['IFACES'][i] }}</td></tr>
                        {% if loop.index %2 == 0 %}
                        </table>
                        <table style='float:left'>
                        {% endif %}
                      {% endfor %}
                    </table>
                  </div>
            </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container main">

      <div class='row'>
          {% block main %}
          {% endblock %}

          {% block sidebar %}
          {% endblock %}
      </div>

    </div> <!-- /container -->

    <footer class="footer">
      <div class="container">
        <p class="text-muted "><small><a href='https://github.com/tomchop/malcom/wiki' target="_blank" rel="noreferrer">Wiki</a> | <a href='https://github.com/tomchop/malcom/issues' target="_blank" rel="noreferrer">Report a bug</a></small></p>
      </div>
    </footer>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
  </body>
</html>

