<ds-alert [content]="'submission.sections.upload.info'"
          [dismissible]="true"
          [type]="AlertTypeEnum.Info"></ds-alert>

<ng-container *ngIf="fileList.length == 0">
  <div class="row">
    <div class="col-md-12">
      <h3 class="text-center"><span class="text-muted">{{'submission.sections.upload.no-file-uploaded' | translate}}</span></h3>
    </div>
  </div>
</ng-container>

<ng-container *ngIf="fileList.length > 0">

  <div *ngIf="collectionDefaultAccessConditions.length > 0" class="row">
    <div class="col-sm-12" >
      <ds-alert [type]="AlertTypeEnum.Warning">
        <ng-container *ngIf="collectionPolicyType === 1">
          {{ 'submission.sections.upload.header.policy.default.nolist' | translate:{ "collectionName": collectionName } }}
        </ng-container>
        <ng-container *ngIf="collectionPolicyType === 2">
          {{ 'submission.sections.upload.header.policy.default.withlist' | translate:{ "collectionName": collectionName } }}
        </ng-container>
        <span class="clearfix"></span>
        <ds-submission-section-upload-access-conditions [accessConditions]="collectionDefaultAccessConditions"></ds-submission-section-upload-access-conditions>
      </ds-alert>
    </div>
  </div>

  <ng-container *ngFor="let fileEntry of fileList">
    <ds-submission-upload-section-file [availableAccessConditionGroups]="availableGroups"
                                       [availableAccessConditionOptions]="availableAccessConditionOptions"
                                       [collectionId]="collectionId"
                                       [collectionPolicyType]="collectionPolicyType"
                                       [configMetadataForm]="(configMetadataForm$ | async)"
                                       [fileId]="fileIndexes[fileList.indexOf(fileEntry)]"
                                       [fileIndex]="fileList.indexOf(fileEntry)"
                                       [fileName]="fileNames[fileList.indexOf(fileEntry)]"
                                       [sectionId]="'upload'"
                                       [submissionId]="submissionId"></ds-submission-upload-section-file>
    <div class="row">
      <div class="col-md-12">
        <hr/>
      </div>
    </div>
  </ng-container>
</ng-container>
