<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation

Contributors:
Anthony Verez averez@mozilla.com
Jeff Bryner jeffbryner@gmail.com
Sanchit Kapoor sanchitlucknow@gmail.com
Avijit Gupta 526avijit@gmail.com
Yash Mehrotra yashmehrotra95@gmail.com
-->

<template name="vr">

<style>
    body {
        background: #6495ED;
        overflow: hidden;
    }

    .blockip {
        cursor: pointer;
        margin-bottom: 16px;
    }
    #date {
        font-size: 12px;
    }
</style>
<div id="container"></div>

<nav class="vr-sidenav cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right text-center" id="attack-sidenav">
    <h3>Summary</h3>
    <div id="filter-read-unread" class="filter-radios"> Filter Attacks:
        <label>
            <input type="radio" name="filter-type" class="filter-type" value="all" checked/>
            All
        </label>
        <label>
            <input type="radio" name="filter-type" class="filter-type" value="read"/>
            Read
        </label>
        <label>
            <input type="radio" name="filter-type" class="filter-type" value="unread"/>
            Unread
        </label>
    </div>
    <a id="attacks-host"><em>{{hostAttacks.host}}</em></a>
    <a id="attacks-rank">Priority <em># {{displayIndex hostAttacks.rank}}</em></a>

    <span id="specific-attack-details">
        <i class="glyphicon glyphicon-chevron-left back-button"></i>
        <h5>{{displayIndex index}}. {{attackDetails.category}}</h5>
        <h5>Severity: {{attackDetails.severity}}</h5>
        <h5>IP: {{attackDetails.details.sourceipv4address}}</h5>
        <h5>Seen: <span id="date">{{displayDate attackDetails.timestamp}}</span></h5>
        <h5 class="blockip btn" data-ipaddress={{attackDetails.details.sourceipv4address}}>BLOCK IP</h5><br/>
        {{#if attackDetails.read}}
        <input type="checkbox" class="cbox" name="attack-isread" checked/> Mark as Read
        {{else}}
        <input type="checkbox" class="cbox" name="attack-isread" /> Mark as Read
        {{/if}}
    </span>
    <ul class="text-center" id="attacks-list">
        {{#each hostAttacks.attacks}}
        <li class="text-center attacks-list-item" data-index="{{index}}">{{displayIndex index}}. {{category}}</li>
        {{/each}}
    </ul>

</nav>
{{>blockIPModal}}
</template>
