<!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><%= title %></title>
    <style type="text/css">
      /* Sticky footer styles
      /* See:
      /*   http://getbootstrap.com/examples/sticky-footer/
      -------------------------------------------------- */
      html {
        position: relative;
        min-height: 100%;
      }
      body {
        /* Margin bottom by footer height */
        margin-bottom: 60px;
        padding-bottom: 60px;
      }
      #footer {
        position: absolute;
        bottom: 0;
        width: 100%;
        /* Set the fixed height of the footer here */
        height: 60px;
        background-color: #f5f5f5;
      }


      /* Custom page CSS
      -------------------------------------------------- */
      /* Not required for template or sticky footer method. */

      .container {
        padding: 0 15px;
      }
      .container .text-muted {
        margin: 20px 0;
      }
      #footer2{border-top: 1px solid #ccc;text-align: right;padding-right: 69px;min-height: 64px;height: auto !important;height: 64px;background: url('/assets/logopro_tiny.png') 100% 50% no-repeat;}
    </style>

    <!-- Latest compiled and minified CSS -->
    <!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
    <link rel="stylesheet" href="/assets//bootstrap.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <noscript>
      <div class="alert alert-danger">
      <p><strong>Warning</strong>: this report template loads jQuery and Bootstrap JS files from their CDNs, but JavaScript seems to be disabled.</p>
      </div>
    </noscript>

    <div class="container">

      <h1><%= title %></h1>

      <h2>Project notes</h2>
      <p class="lead">In this section you'll find any notes assigned to the <strong>HTMLExport ready</strong> category.</p>
      <% notes.each do |note| %>
      <div class="panel panel-default">
        <div class="panel-body">
          <%= markup(note.text) %>
        </div>
      </div>
      <% end %>


      <h2>Project issues</h2>
      <p class="lead">In this section you'll find your project's Issues.</p>
      <% issues.each do |issue| %>
      <div class="panel panel-default">
        <div class="panel-body">
          <%= markup(issue.text) %>

          <h3>Assets affected by this issue</h3>
          <% if issue.affected.empty? %>
            <p class="well">None so far.</p>
          <% else %>
            <div class="row">
              <div class="col-md-3 evidence-sidebar">
                <ul class="nav nav-list evidence-sidenav">
                <% issue.evidence_by_node.each do |node, instances| %>
                  <li><a href="#evidence_for_<%= node.id %>"><i class="glyphicon glyphicon-<%= ['folder-close','hdd'][node.type_id] %>"></i> <%= node.label %> (<%= pluralize instances.count, 'instance' %>)</a></li>
                <% end %>
                </ul>
              </div>

              <div class="col-md-9">
                <% issue.evidence_by_node.each do |node, instances| %>
                  <section id="evidence_for_#{node.id}">
                    <% if instances.count == 1 %>
                      <div class="content-textile" id="node_<%= node.id %>_instance_0">
                        <%= markup(instances.first.content) %>
                      </div>
                    <% else %>
                      <ul class="nav nav-tabs">
                        <% instances.each_with_index do |evidence, i| %>
                        <li class="<%= 'active' if i==0 %>"><a href="#node_<%= node.id %>_instance_<%= i %>" data-toggle="tab">Instance <%= i %></a></li>
                        <% end %>
                      </ul>

                      <div class="tab-content">
                        <% instances.each_with_index do |evidence, i| %>
                        <div class="content-textile tab-pane<%= ' active' if i==0 %>" id="node_<%= node.id %>_instance_<%= i %>">
                          <%= markup(evidence.content) %>
                        </div>
                        <% end %>
                      </div>
                    <% end %>

                  </section>
                <% end %>
              </div>
            </div>
          <% end %>
        </div>
      </div>
      <% end %>

    </div>

    <div id="footer">
      <div class="container">
        <p class="text-muted text-center"><%= title%> - <a href="http://dradisframework.org">http://dradisframework.org</a></p>
      </div>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> -->
    <script src="/assets/jquery.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <!-- <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> -->
    <script src="/assets/bootstrap.js"></script>
  </body>
</html>
