<%def name="is_active_nav(name)">
  %if active_section == name:
      class="active"
  %endif
</%def>

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>${self.title()}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    ${self.style()}
    <script src="js/jquery-1.10.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    ${self.javascript()}
  </head>
  <body>
    <div class="navbar navbar-default" role="navigation">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <span class="navbar-brand">Smiley</span>
      </div>
      <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-left">
          <li ${is_active_nav('index')}><a href="index.html">Details</a></li>
          <li ${is_active_nav('trace')}><a href="trace-1.html">Trace</a></li>
          <li ${is_active_nav('files')}><a href="files.html">Files</a></li>
          <li ${is_active_nav('stats')}><a href="stats.html">Stats</a></li>
          <li ${is_active_nav('call_graph')}><a href="call_graph.html">Call Graph</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li><a href="https://smiley.readthedocs.org" target="_">Help</a></li>
        </ul>
      </div>
    </div>

    <div class="container">

      <%block name="page_header">
      </%block>

      <%block name="page_top">
      </%block>

        ${self.body()}

    </div>
  </body>
</html>

<%def name="title()">Smiley Report: ${subtitle}</%def>

<%def name="style()">
</%def>

<%def name="javascript()">
</%def>

<%def name="display_filename(fn)">
<!-- Render a filename in a shorter form -->
% if fn and fn.startswith(run.cwd):
    ${fn[len(run.cwd):].lstrip('/')}
% else:
    ${fn}
% endif
</%def>
