<!-- Faraday Penetration Test IDE -->
<!-- Copyright (C) 2013  Infobyte LLC (http://www.infobytesec.com/) -->
<!-- See the file 'doc/LICENSE' for the license information -->

<section id="main" class="seccion clearfix">
    <div class="right-main">
        <div id="reports-main" class="fila clearfix">
            <div class="ws-label">
                <h2><span id="ws-name" title="Current workspace">Status report for {{ workspace }} ({{ confirmed === false ? 'all vulns' : 'confirmed' }}) ({{gridOptions.totalItems}} vulns)</span></h2>
                <!-- WS name -->
            </div>
            <!-- .ws-label -->
            <div id="ws-control" class="btn-group btn-small-margin">
                <button file-exporter="csv()" type="button" class="btn btn-success" title="Download CSV for current workspace">
                    <span class="glyphicon glyphicon-download"></span>
                </button>
                <button id="refresh" type="button" class="btn btn-danger" title="Refresh current workspace" onclick="location.reload()">
                    <span class="glyphicon glyphicon-refresh"></span>
                </button>
                <button type="button" class="btn btn-danger" title="{{ confirmed === true ? 'All vulns' : 'Confirmed vulns' }}" ng-click="toggleFilter()">
                    <span class="glyphicon glyphicon-filter" ng-style="{ 'opacity': (confirmed === true) ? '1' : '0.7' }"></span>
                </button>
                <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" title="Change current workspace">
                    Change workspace <span class="caret"></span>
                </button>
                <ul id="nav" class="dropdown-menu dropdown-menu-right" role="menu">
                    <li ng-repeat="ws in workspaces"><a href="#/status/ws/{{ws}}" class="ws">{{ws}}</a></li>
                </ul>
                <!-- WS navigation -->
            </div>
            <!-- #ws-control -->

            <div class="button-control col-md-6 col-sm-6 col-xs-12">
                <button id="delete" type="button" class="btn btn-default" title="Delete selected items" ng-click="delete()">
                    <span class="glyphicon glyphicon-trash"></span>
                    Delete
                </button>
                <div id="merge" class="btn-group btn-small-margin">
                    <button type="button" class="btn btn-default" title="Edit selected vulns" ng-click="edit()" ng-disabled="getCurrentSelection().length != 1">
                        <span class="glyphicon glyphicon-pencil"></span>
                        Edit
                    </button>
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="SingleActions" ng-show="getCurrentSelection().length === 1">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        <li><a class="ws" ng-click="saveAsModel()">Create template</a></li>
                    </ul>
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Actions" ng-hide="getCurrentSelection().length < 2">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right" role="menu" ng-show="getCurrentSelection().length >= 2">
                        <li><a class="ws" ng-click="editString('name')">Edit name</a></li>
                        <li><a class="ws" ng-click="editText('desc', 'description')">Edit description</a></li>
                        <li><a class="ws" ng-click="editText('data')">Edit data</a></li>
                        <li><a class="ws" ng-click="editText('resolution')">Edit resolution</a></li>
                        <li><a class="ws" ng-click="editSeverity()">Edit severity</a></li>
                        <li><a class="ws" ng-click="editEaseofresolution()">Edit ease of resolution</a></li>
                        <li><a class="ws" ng-click="editReferences()">Add references</a></li>
                        <li><a class="ws" ng-click="editImpact()">Edit impact</a></li>
                        <li><a class="ws" ng-click="editStatus()">Edit status</a></li>
                        <li><a class="ws" ng-click="editPolicyviolations()">Edit policy violations</a></li>
                        <li><a class="ws" ng-click="editConfirm()">Confirm/Change to false positive</a></li>
                        <li ng-show="vulnWebSelected" role="separator" class="divider"></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('method')">Edit method</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('pname', 'param name')">Edit param name</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('params', 'parameters')">Edit parameters</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('path')">Edit path</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('query')">Edit query</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editString('website')">Edit website</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editText('request')">Edit request</a></li>
                        <li ng-show="vulnWebSelected"><a class="ws" ng-click="editText('response')">Edit response</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a class="ws" ng-click="editCWE()">From vulnerability template</a></li>
                        <li><a class="ws" ng-click="saveAsModel()">Create vulnerability templates</a></li>
                    </ul>
                </div>
                <div id="group-by" class="btn-group btn-small-margin">
                    <button type="button" ng-if="propertyGroupBy" class="btn btn-danger" title="Clear" ng-click="clearGroupBy()">
                        <i class="fa fa-times"></i>
                    </button>
                    <button type="button" class="btn btn-default" title="{{propertyGroupBy || 'Group By'}}">
                        {{ (propertyGroupBy | uppercase) || "Group By"}}
                    </button>
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Group By">
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        <li ng-repeat="(column, show) in columns">
                            <a class="ws" ng-show="show && (column !== 'evidence' && column !== 'impact' && column !== 'web' && column !== 'easeofresolution' && column !== 'date')" ng-click="groupBy(column)">{{column}}</a>
                        </li>
                    </ul>
                </div>
                <button id="new" type="button" class="btn btn-success" title="New Vulns" ng-click="new()">
                    <span class="glyphicon glyphicon-plus-sign"></span>
                    New
                </button>
            </div>
            <!-- .col-md-6 .col-sm-6 .col-xs-12 -->
            <div class="reports">
                <div class="row">
                    <div class="col-md-6 col-sm-3 col-xs-11">
                        <form role="form" ng-submit="searchFor(true, searchParams)">
                            <div class="form-group">
                                <div class="input-group input-group-sm">
                                    <span class="input-group-addon glyphicon-btn glyphicon glyphicon-remove" ng-click="searchFor(false, '')" ng-if="search && search != 'confirmed=true'"></span>
                                    <input type="text" class="form-control" id="filter-by" placeholder="enter keywords" ng-change="currentPage = 0" ng-model="searchParams" />
                                    <span class="input-group-addon glyphicon-btn" ng-click="searchFor(true, searchParams)">
                                        <i class="fa fa-search" ng-if="gridOptions.data.length > 0 || gridOptions.totalItems >= 0"></i>
                                        <i class="fa fa-refresh fa-spin" ng-if="gridOptions.totalItems === null"></i>
                                    </span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="col-md-12 col-sm-9 col-xs-12">
                        <h4><span class="label label-default" title="Add columns">Add columns</span></h4>
                        <ul class="label-list">
                            <li ng-repeat="(column, show) in columns">
                                <a href="" ng-click="toggleShow(column, show)" ng-show="!show">
                                    <span class="label label-primary ws-name">{{column}}</span>
                                </a>
                            </li>
                            <!-- label-list -->
                        </ul>
                    </div>
                </div>

                <div ui-grid="gridOptions" ui-grid-grouping ui-grid-selection ui-grid-pagination ui-grid-pinning class="grid"></div>

                <div id="counter">
                    <span>Total</span>
                    <span class="counterNum">{{gridOptions.totalItems}}</span>
                    <div ng-if="search">
                        <span>Viewing</span>
                        <span class="counterNum">{{gridOptions.data.length}}</span>
                    </div>
                    <p style="margin:0px" ng-if="!search"></p>
                    <span>Selected</span>
                    <span class="counterNum">{{getCurrentSelection().length}}</span>
                </div>
            </div>
            <!-- .reports -->
        </div>
        <!-- #reports-main -->
    </div>
    <!-- .right-main -->
</section>
<!-- #main -->
