<div ng-controller="importarFotosController">
    <div class="modal-header">
        <h4>Associe Imagens ao Inventário</h4>
        <p align="right">
            Total <span class="badge" style="margin-right:20px">{{files.length}}</span>
            <button type="button"
                    popover-placement="left"
                    popover-trigger="mousedown"
                    data-popover="Para associar a imagem ao BEM deve usar o nome da imagem com o número de Inventário. Ex: Imagem 123.jpg vai associar ao Nº Inventario 123"
                    class="btn btn-info btn-sm">
                <span class="glyphicon glyphicon-question-sign"></span>
            </button>
        </p>

    </div>
    <div class="modal-body">

        <input type="hidden" ng-model="mySelFile">
        <input id="btUpload" type="file" ng-file-select="onFileSelect($files)" multiple
               accept="image/bmp,image/jpg,image/png,image/gif"
               style="display:none">


        <div ng-file-drop="" ng-file-select="" ng-model="files"
             class="drop-box"
             drag-over-class="{accept:'dragover', reject:'dragover-err', delay:100}"
             ng-multiple="true" allow-dir="true" accept="image/*"
             ng-show="dropSupported"
             style="width:300px; height:40px; padding:10px; border:1px solid #DDD; font-size:9pt; text-align:center">
            <b>Arraste a Pasta/Imagem para esta caixa</b>
        </div>
        <div class="table-responsive margem" 
             style="border-top:1px solid #EEE; overflow:auto; height:auto; max-height:150px; margin-top:10px"
             ng-show="files.length>0">
            <table class="table table-striped">
                <tr ng-repeat="f in files">
                    <td>{{f.name}}</td>
                    
                </tr>
            </table>
        </div>
        <div class="table-responsive margem"
             style="border-top:1px solid #EEE; overflow:auto; height:auto; max-height:150px; margin-top:10px"
             ng-show="files.length==0">
            <table class="table table-striped">
                <tr ng-repeat="r in resultados">
                    <td>{{r}}</td>

                </tr>
            </table>
        </div>

        
        <div ng-file-drop-available="dropSupported=true"
             ng-show="!dropSupported">HTML5 Drop File is not supported!</div>


        <br />

        <div ng-show="emExecucao==true">
            <label style="font-size:8pt">Por Favor Aguarde... </label><img src="images/preloader.gif" width="32" style="margin-left:30px; margin-right:30px" />
        </div>

        <!--<div ng-show="uploadprogress>0 && uploadprogress<100">
            <progressbar class="progress-striped active" max="100" value=uploadprogress><i>{{uploadprogress}}</i></progressbar>
            <p align="right"><button class="btn btn-primary btn-xs" ng-click="upload.abort()">Cancelar</button></p>
        </div>-->
        <div ng-show="processoConcluido" class="col-md-12">
            <label>Concluído</label>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary"
                ng-show="files.length>0"
                ng-disabled="emExecucao==true"
                ng-click="processar()">
            Guardar
        </button>
        <button class="btn btn-primary"
                ng-show="emExecucao==false"
                onclick="document.getElementById('btUpload').click()">
            Procurar
        </button>
        <button class="btn btn-warning" ng-click="ok()" ng-disabled="emExecucao==true">Fechar</button>
    </div>
</div>