<div class="acceptance-due-date col-md-12">
    <div class="alert {{getDueDateClass()}}">
        <label>{{'orders.headers.DUE_DATE_CUSTOMER' | translate}}:</label>
        {{acceptance.acceptanceDueDate}}
    </div>
    <div class="alert alert-{{getAcceptanceClass(acceptance.customerAccepted)}} col-md-12" ng-if="showCustomerAcceptance(acceptance.customerAccepted)">
        <div class="col-md-12">
            <span class="glyphicon glyphicon-{{getStatusIcon(acceptance.customerAccepted)}}"></span>
            {{getCustomerAcceptanceDescription(acceptance.customerAccepted)}}
        </div>
        <div class="customer-installation-decline-reason col-md-12" ng-if="acceptance.customerDeclineReason">
            <span>{{'orders.messages.CUSTOMER_DECLINE_REASON' | translate}}:</span>
            <span>{{acceptance.customerDeclineReason}}</span>
        </div>
    </div>
</div>

<div id="customer-acceptance-files-container" class="col-md-12">
    <form name="form" class="col-md-4">
        <div ngf-drop="uploadFile($file)"
            ng-model="files"
            ngf-drag-over-class="'dragover'"
            ngf-select="uploadFile($file)"
            ngf-pattern="'.pdf,.docx,.doc,.xlsx,.xls,.odt,.ods,.jpg,.png,.jpeg'"
            ngf-max-size="20MB"
            class="drop-box">{{'orders.headers.SELECT_ACCEPT_DOCUMENT' | translate}}</div>
    </form>

    <div class="uploaded-documents col-md-8">
        <div class="document-layer" ng-repeat="document in acceptance.acceptanceDocuments">
            <a href="utils/api/downloadFile?idDocument={{document.idDocument}}&fileName={{document.documentName}}.{{document.extension}}">
                {{document.documentName}}.{{document.extension}}
            </a>
            <div id="remove-document-{{document.idDocument}}" class="remove-document">
                <span class="remove-document-btn glyphicon glyphicon-remove" ng-click="showHideDialog(document.idDocument)">
                    {{'orders.tables.extra.REMOVE' | translate}}
                </span>
                <div id="confirm-remove-document"
                     dialog
                     ng-if="isDialogVisible[document.idDocument]"
                     on-confirmation="removeAcceptanceDocument"
                     on-close="showHideDialog"
                     is-modal="true"
                     has-buttons="true"
                     parameters="document.idDocument"
                     title="{{'orders.headers.REMOVE_DOCUMENT' | translate}}">
                  <p><span class="glyphicon glyphicon-warning-sign"></span>{{'orders.messages.REMOVE_DOCUMENT_CONFIRMATION' | translate}} <b>{{document.documentName}}.{{document.extension}}</b>?</p>
              </div>
            </div>
        </div>
    </div>
</div>


<div class="acceptance-button-layer col-md-12">
    <div class="document-layer row" ng-if="acceptance.idDocument">
        <a href="utils/api/downloadFile?idDocument={{acceptance.idDocument}}&fileName={{acceptance.documentName}}.{{acceptance.extension}}">
            {{acceptance.documentName}}.{{acceptance.extension}}
        </a>
    </div>
    <div class='row'>
        <div class="install-btn btn btn-success col-md-5"
            ng-disabled="isAcceptInstallationDisabled"
            ng-click="showHideDialog('accept')">
            {{'orders.buttons.ACCEPT_INSTALLATION' | translate}}
        </div>
        <div id="dialog-accept-installation-confirm"
             dialog
             ng-if="isDialogVisible['accept']"
             on-confirmation="acceptDeclineInstallation"
             on-close="showHideDialog"
             is-modal="true"
             has-buttons="true"
             parameters="'accept'"
             title="{{'orders.headers.CUSTOMER_INSTALLATION_ACCEPT' | translate}}">
          <p><span class="glyphicon glyphicon-warning-sign"></span>{{'orders.messages.CUSTOMER_INSTALLATION_ACCEPT' | translate}}?</p>
        </div>
        <div class="install-btn btn btn-danger col-md-offset-1 col-md-5"
            ng-disabled="isDeclineInstallationDisabled"
            ng-click="showDeclineInstallation()">
            {{'orders.buttons.DECLINE_INSTALLATION' | translate}}
        </div>
    </div>
    <div class="decline-installation-container row" ng-if="isInstallationDeclined[acceptance.idPackage]">
        <span class="col-md-12">{{'orders.tables.extra.DECLINED_CUSTOMER_INSTALLATION' | translate}}:</span>
        <textarea id="installation-declined-reason" class="decline-installation-text col-md-12" ng-model="$parent.installationDeclinedReason"></textarea>
        <div>
            <div class="save-decline-install-btn install-btn btn btn-warning col-md-offset-8 col-md-4"
                ng-click="showHideDialog('decline')">{{'orders.tables.extra.SAVE' | translate}}</div>
            <div id="dialog-decline-installation-confirm"
                 dialog
                 ng-if="isDialogVisible['decline']"
                 on-confirmation="acceptDeclineInstallation"
                 on-close="showHideDialog"
                 is-modal="true"
                 has-buttons="true"
                 parameters="'decline'"
                 title="{{'orders.headers.CUSTOMER_INSTALLATION_DECLINE' | translate}}">
              <p><span class="glyphicon glyphicon-warning-sign"></span>{{'orders.messages.CUSTOMER_INSTALLATION_DECLINE' | translate}}?</p>
            </div>
        </div>
    </div>
</div>
