{% extends "base.html" %}
{% load staticfiles %}
{% load analysis_tags %}
{% block content %}
    <nav class="navbar navbar-default" >
        <ul class="nav nav-pills navbar-nav">
            <li class="active"><a href="#overview" data-toggle="tab">
                <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
                Summary</a>
             </li>
            <li><a href="#static" data-toggle="tab">
                <span class="glyphicon glyphicon-stop" aria-hidden="true"></span>
                Static Analysis</a>
            </li>
            {% if analysis.behavior.processes %}
                <li><a href="#behavior" data-toggle="tab" id="graph_hook">
                    <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                    Behavioral Analysis ({{ analysis.behavior.processes|filter_key_if_has:"track"|length }})</a>
                </li>
            {% endif %}
            {% with suricata=analysis.suricata|custom_length:"alerts tls" snort=analysis.snort|custom_length:"alerts" %}
                {% if analysis.network.http_ex or analysis.network.https_ex %}
                    <li><a href="#network" data-toggle="tab">
                        <span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>
                        Network Analysis ({{ analysis.network|custom_length:"hosts dns tcp udp http_ex https_ex icmp irc"|add:suricata|add:snort }})</a>
                    </li>
                {% else %}
                    <li><a href="#network" data-toggle="tab">
                        <span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>
                        Network Analysis ({{ analysis.network|custom_length:"hosts dns tcp udp http icmp irc"|add:suricata|add:snort }})</a>
                    </li>
                {% endif %}
            {% endwith %}
            {% if analysis.dropped %}
                <li><a href="#dropped" data-toggle="tab">
                   <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
                   Dropped Files ({{ analysis.dropped|length }})</a>
                </li>
            {% endif %}
            {% if analysis.buffer %}
                <li><a href="#buffer" data-toggle="tab">
                    <span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
                    Dropped Buffers ({{ analysis.buffer|length }})</a>
                </li>
            {% endif %}
            {% if analysis.procmemory %}
                <li><a href="#procmemory" data-toggle="tab">Process Memory ({{ analysis.procmemory|length }})</a></li>
            {% endif %}
            {% if analysis.memory %}
                <li><a href="#memory" data-toggle="tab">Memory Analysis</a></li>
            {% endif %}
            {% if analysis.misp %}
                <li><a href="#misp" data-toggle="tab">MISP ({{ analysis.misp|length }})</a></li>
            {% endif %}
            <li><a href="#admin" data-toggle="tab">
                <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
                Admin</a>
            </li>
        </ul>
    </div>
</div>

<div class="tab-content content" style="margin-top: -15px;">
    <div class="tab-pane fade in active" id="overview">
        {% include "analysis/overview/index.html" %}
    </div>
    <div class="tab-pane fade" id="static">
        {% include "analysis/static/index.html" %}
    </div>
    {% if analysis.behavior.processes %}
        <div class="tab-pane fade" id="behavior">
            {% include "analysis/behavior/index.html" %}
        </div>
    {% endif %}
    <div class="tab-pane fade" id="network">
        {% include "analysis/network/index.html" %}
    </div>
    <div class="tab-pane fade" id="dropped">
        {% include "analysis/dropped/index.html" %}
    </div>
    <div class="tab-pane fade" id="buffer">
        {% include "analysis/buffers/index.html" %}
    </div>
    {% if analysis.procmemory %}
        <div class="tab-pane fade" id="procmemory">
            {% include "analysis/procmemory/index.html" %}
        </div>
    {% endif %}
    {% if analysis.memory %}
        <div class="tab-pane fade" id="memory">
            {% include "analysis/memory/index.html" %}
        </div>
    {% endif %}
    {% if analysis.misp %}
        <div class="tab-pane fade" id="misp">
            {% include "analysis/misp/index.html" %}
        </div>
    {% endif %}
    <div class="tab-pane fade" id="admin">
        {% include "analysis/admin/index.html" %}
    </div>
</div>
{% endblock %}
