<div id="validate-questionaire" ng-controller="validateQuestionnaireCtrl" ng-init="getDocumentsAndQuestionnaireComments()">
    <div class="document-package-layer" ng-repeat="(key, packageDocuments) in customerDocuments">
    <div class="document-layer row" ng-repeat="document in packageDocuments">
        <div class="col-md-6">
            <a href="utils/api/downloadFile?idDocument={{document.idDocument}}&fileName={{document.documentName}}.{{document.extension}}">
                <div class="btn btn-primary">
                    {{document.documentName}}.{{document.extension}}
                </div>
            </a>

            <div class="document-status">
                <span class="not-validated" ng-if="getValidationStatus('not-validated', document.validation)">
                    <span class="glyphicon glyphicon-time"></span>
                    {{'orders.tables.extra.NOT_VALIDATED' | translate}}
                </span>
                <span class="validated" ng-if="getValidationStatus('validated', document.validation)">
                    <span class="glyphicon glyphicon-ok"></span>
                    {{'orders.tables.extra.VALIDATED' | translate}}
                </span>
                <div class="invalid" ng-if="getValidationStatus('invalid', document.validation)">
                    <span class="glyphicon glyphicon-remove"></span>
                    {{'orders.tables.extra.INVALID' | translate}}
                    <span class="questionnaire-invalid-reason">{{invalidQuestionaireReason}}</span>
                </div>
            </div>
            <div class="order-added-comments" class="col-md-12" ng-if="questionnaireCommentsExist">
                <h4>{{getInvalidReasonsHeader()}}</h4>
                <div class="order-comment-layer reason-comment" ng-repeat="commentObj in invalidQuestionaireComments">
                    <div class="order-comment-date">
                        {{commentObj.user}} - {{commentObj.addDate}}
                    </div>
                    <div class="order-comment-label">
                        {{commentObj.comment}}
                    </div>
                </div>
            </div>
        </div>

        <form ng-if="needsUplaod(document.validation)" name="form" class="col-md-4">
            <div ngf-drop="uploadFile($file, document.idDocument)"
                ng-model="files"
                ngf-drag-over-class="'dragover'"
                ngf-select="uploadFile($file, document.idDocument)"
                ngf-pattern="'.pdf,.docx,.doc,.xlsx,.xls,.odt,.ods'"
                ngf-max-size="20MB"
                class="drop-box">{{'orders.headers.SELECT_QUESTIONAIRE' | translate}}</div>
        </form>
    </div>
    </div>
</div>
