<div ng-controller="etiquetasController" ng-init="carregaConfiguracoes(selected.item)">

    <div class="modal-header">
        <h4>Etiquetas - EAN13 (Papel A4)</h4>
        <label ng-show="selected.item.locais==true">Etiquetas deste local</label>
    </div>
    <div class="modal-body">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-4">

                    <label>Altura da Etiqueta + Espaçamento Vertical (mm)</label>
                    <input type="text"
                           class="form-control"
                           ng-model="altura"
                           ng-change="actualizarPagina()"
                           numbers-only maxlength="2" />
                    <br />
                    <label>Nº Colunas</label>
                    <input type="text"
                           class="form-control"
                           ng-model="nc"
                           ng-change="actualizarPagina()"
                           numbers-only maxlength="1" />
                    <br />
                    <label>Margens (mm)</label>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-arrow-left"></span>
                        </span>
                        <input class="form-control" ng-model="margl" numbers-only maxlength="2" ng-change="actualizarPagina()">
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-arrow-right"></span>
                        </span>
                        <input class="form-control" ng-model="margr" numbers-only maxlength="2" ng-change="actualizarPagina()">
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-arrow-up"></span>
                        </span>
                        <input class="form-control" ng-model="margt" numbers-only maxlength="2" ng-change="actualizarPagina()">
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-arrow-down"></span>
                        </span>
                        <input class="form-control" ng-model="margb" numbers-only maxlength="2" ng-change="actualizarPagina()">
                    </div>
                    <br />
                    <div ng-hide="selected.item.locais==true">
                        <label class="checkbox">
                            <input type="checkbox"
                                   ng-model="todos" ng-change="atualizaIntervalo()" /> Imprimir Todos
                        </label>
                        <div class="input-group">
                            <span class="input-group-addon">
                                De
                            </span>
                            <input class="form-control" ng-model="inicial" ng-disabled="todos==true" numbers-only maxlength="6">
                        </div>


                        <div class="input-group">
                            <span class="input-group-addon">
                                Até
                            </span>
                            <input class="form-control" ng-model="final" ng-disabled="todos==true" numbers-only maxlength="6">
                        </div>
                    </div>
                    
                    <br />
                    <label>Gerar etiquetas a partir de ficheiro Excel (Código - Designação)</label>
                    <div class="input-group">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-upload"></span>
                        </span>
                        <input id="btUpload" class="form-control" ng-file-select="onFileSelect($files)" type="file" accept=".xlsx, .xls">
                    </div>

                </div>
                <br />
                <div class="col-md-4">
                    <div style="background-color:#888; padding:10px; height:317px;">
                        <div id="prever" class="prever">

                        </div>
                    </div>
                    <br />
                    <label>Máx. Linhas/Pág : {{nl}}</label>
                    <br/>
                    <label>Logotipo</label>
                    <br/>
                    <img ng-src="{{logotipoSelFile}}"
                        ng-file-select="onLogotipoFileSelect($files)" accept=".jpg, .png"
                         popover-placement="bottom"
                         popover-trigger="mouseenter"
                         data-popover="Alterar"
                         width="200"
                         class="apontar"
                         style="border:1px solid #DDD; width:100px" />
                    
                    <button popover-placement="bottom"
                            popover-trigger="mouseenter"
                            data-popover="Remover logotipo"
                            ng-click="removeLogotipo()"
                            type="button"
                            class="btn btn-warning">
                        <span class="glyphicon glyphicon-remove"></span>
                    </button>
                </div>
                <div class="col-md-4">
                    <label>Largura da página (mm)</label>
                    <input type="text"
                           class="form-control"
                           ng-model="larguraPagina_mm"
                           numbers-only maxlength="3" />
                    <br />
                    <label>Espaçamento Vertical (mm)</label>
                    <input type="text"
                           class="form-control"
                           ng-model="espacamento_vertical_mm"
                           numbers-only maxlength="2" />
                    <br />
                    <label>Espaçamento Horizontal (mm)</label>
                    <input type="text"
                           class="form-control"
                           ng-model="espacamentoHorizontal"
                           numbers-only maxlength="2" />
                    <br />
                    <label class="checkbox">
                        <input type="checkbox"
                               ng-model="esticar" /> Esticar
                    </label>
                    <label class="checkbox">
                        <input type="checkbox"
                               ng-model="rollPaper" /> Rolo de Papel
                    </label>
                    <label class="checkbox">
                        <input type="checkbox"
                               ng-model="legenda" /> Imprimir com legenda
                    </label>
                    <label class="checkbox">
                        <input type="checkbox"
                               ng-model="MostrarLocal" /> Incluir localização na legenda
                    </label>
                    <label class="checkbox">
                        <input type="checkbox"
                               ng-model="umaEtiquetaPorPagina" /> Imprimir uma etiqueta por pagina
                    </label>
                    <br/>
                    <label>Tamanho de letra da legenda (3 a 25 pt)</label>
                    <input type="text"
                           class="form-control"
                           ng-model="tamanhoTexto_pt"
                           number-input maxlength="5" />
                    <br />
                </div>
            </div>

        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" ng-hide="selected.item.locais==true" ng-click="getEtiquetas(); ok();">Imprimir</button>
        <button class="btn btn-primary" ng-show="selected.item.locais==true" ng-click="getEtiquetasLocal(selected.item.idEdificio,selected.item.idPiso,selected.item.idSala); ok();">Imprimir</button>
        <button class="btn btn-warning" ng-click="ok()">Fechar</button>
    </div>

</div>


