.dbsettings(ng-controller="DbSettingsCtrl")
    .row
        .col-sm-4
            h4 Next compacting
                button(tooltip="Compact database now", tooltip-placement="left", type="button",ng-click="compactDb()").btn.btn-xs.btn-success.pull-right
                    span.glyphicon.glyphicon-compressed
            hr
            span(ng-class="{collapse:!(compacting.autoCompacting)}")
                | Next database compacting at&nbsp;
                strong  {{compacting.nextCompacting | date:'dd.MM HH:mm'}}
                | &nbsp;if more than&nbsp;
                strong  {{compacting.redPercentage}}&nbsp;%
                | &nbsp;of the packets are redundant.
            span(ng-class="{collapse:!(filter.autoDeleting)}")  Packets older than
                strong &nbsp;{{filter.compactingfilter}}&nbsp;h
                | &nbsp;will be deleted while compacting!
            p(ng-class="{collapse:(compacting.autoCompacting)}") No database compacting scheduled

        .col-sm-4
            h4 Compacting schedule
                button(ng-attr-tooltip="{{compacting.autoCompacting && 'Auto compacting active' || 'Auto compacting inactive' }}", tooltip-placement="left" ,type="button", ng-model="compacting.autoCompacting", btn-checkbox, btn-checkbox-true="true", btn-checkbox-false="false", ng-class="compacting.autoCompacting ? 'btn-info' : 'btn-default'", ng-click="toggleCompacting()").btn.btn-xs.pull-right
                    span.glyphicon.glyphicon-repeat
            div.compactingsettings(ng-class="{disabled:compacting.autoCompacting}")
                hr

                form.form-horizontal
                    .form-group
                        label(for="mins").col-md-7.control-label Compact interval:
                        .col-md-5
                            .input-group
                                input(type="text",id="mins" ng-model="compacting.interval").form-control.input-sm
                                span.input-group-addon min
                    .form-group
                        label(for="percent").col-md-7.control-label Minimum redundance:
                        .col-md-5
                            .input-group
                                input(type="text",id="percent" ng-model="compacting.redPercentage").form-control.input-sm
                                span.input-group-addon %

        .col-sm-4
            h4 Delete old packets on compacting
                button(ng-attr-tooltip="{{filter.autoDeleting && 'Deleting old packets' || 'Keeping old packets' }}", tooltip-placement="left" ,type="button", ng-model="filter.autoDeleting", btn-checkbox, btn-checkbox-true="true", btn-checkbox-false="false", ng-class="filter.autoDeleting ? 'btn-info' : 'btn-default'", ng-click="toggleAutoDeleting()").btn.btn-xs.pull-right
                    span(ng-class="filter.autoDeleting ? 'glyphicon-ok-circle' : 'glyphicon-ban-circle'").glyphicon
            hr
            form(ng-submit="setFilter()").autodeletesettings.form-horizontal
                .form-group
                    label(for="hours").col-md-7.control-label Maximal package age:
                    .col-md-5
                        .input-group
                            input(type="text",id="hours" ng-model="filter.tmpfilter").form-control.input-sm
                            span.input-group-addon h
                .form-group
                    .col-md-offset-7.col-md-5
                        button(type="submit" id="agesubmit").btn.btn-default.btn-sm.pull-right
                            span Save&nbsp;
                            span.glyphicon.glyphicon-ok
    .row
        .col-sm-4
            h4 Package statistics
            hr
            p
                span.label.label-default {{packetCount.redPackets}}
                span &nbsp; redundant Packets
            p
                span.label.label-success {{packetCount.absPackets}}
                span &nbsp; effective Packets
            p
                span.label(ng-class="{'label-success':(redPercentage <= compacting.redPercentage), 'label-warning':(redPercentage > compacting.redPercentage && redPercentage <=compacting.redPercentage*2), 'label-danger':(redPercentage > compacting.redPercentage*2)}") {{redPercentage | number:1}} %
                span &nbsp; redundant


