<div class="documents-view-layer row">
    <div class="document-categ col-md-12" ng-repeat="(category, categDocuments) in documents">
        <h3>{{category}}</h3>
        <div class="document-layer row" ng-repeat="document in categDocuments">
            <div class="document-icon-layer col-md-1 col-sm-1">
                <span class="{{document.extension}} document-icon glyphicon glyphicon-file"></span>
                <div class="document-icon-text">{{document.extension}}</div>
            </div>

            <div class="document-name col-md-3 col-sm-3">
                {{document.documentName}}.{{document.extension}}
            </div>

            <div class="packages-link col-md-6 col-sm-4">
                <div ng-if="document.packages.length">
                    {{ 'documents.headers.LINKED_PACKAGES' | translate }} <span ng-repeat="package in document.packages">{{package.packageName}}, </span>
                </div>
            </div>

            <div class="document-download col-md-1 col-sm-2">
                <a href="utils/api/downloadFile?idDocument={{document.idDocument}}&fileName={{document.documentName}}.{{document.extension}}">
                    <div class="btn btn-primary">
                        <span class="glyphicon glyphicon-download"></span> {{ 'documents.buttons.DOWNLOAD' | translate }}
                    </div>
                </a>
            </div>
            <div class="document-delete col-md-1 col-sm-2">
                <div class="btn btn-danger" ng-click="showHideRemoveDialog(document)">
                    <span class="glyphicon glyphicon-remove"></span> {{ 'documents.buttons.REMOVE' | translate }}
                </div>
            </div>
        </div>
    </div>
</div>

<div id="dialog-confirm-remove"
     dialog
     ng-if="isRemoveDialogVisible"
     on-confirmation="removeDocument"
     on-close="showHideRemoveDialog"
     is-modal="true"
     has-buttons="true"
     parameters="selectedDocument"
     title="{{'documents.headers.REMOVE_DOCUMENT' | translate}}">
  <p><span class="glyphicon glyphicon-warning-sign"></span>{{'documents.messages.REMOVE_DOCUMENT' | translate}} {{selectedDocument.documentName}}.{{selectedDocument.extension}}?</p>
</div>
