<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="attachmentsTitle">
  <div class="modal-dialog" role="document">
    <form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
      <div class="modal-body">
        <div class="box" *ngIf="cipher && cipher.hasAttachments">
          <h1 class="box-header" id="attachmentsTitle">
            {{ "attachments" | i18n }}
          </h1>
          <div class="box-content no-hover">
            <div class="box-content-row box-content-row-flex" *ngFor="let a of cipher.attachments">
              <div class="row-main">
                {{ a.fileName }}
              </div>
              <small class="row-sub-label">{{ a.sizeName }}</small>
              <div class="action-buttons no-pad">
                <button
                  class="row-btn btn"
                  type="button"
                  appStopClick
                  appA11yTitle="{{ 'delete' | i18n }}"
                  (click)="delete(a)"
                  #deleteBtn
                  [appApiAction]="deletePromises[a.id]"
                  [disabled]="$any(deleteBtn).loading"
                >
                  <i
                    class="bwi bwi-trash bwi-lg bwi-fw"
                    [hidden]="$any(deleteBtn).loading"
                    aria-hidden="true"
                  ></i>
                  <i
                    class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
                    [hidden]="!$any(deleteBtn).loading"
                    aria-hidden="true"
                  ></i>
                </button>
              </div>
            </div>
          </div>
        </div>
        <div class="box">
          <h2 class="box-header">
            {{ "newAttachment" | i18n }}
          </h2>
          <div class="box-content no-hover">
            <div class="box-content-row">
              <label for="file">{{ "file" | i18n }}</label>
              <input type="file" id="file" name="file" aria-describedby="fileHelp" required />
            </div>
          </div>
          <div id="fileHelp" class="box-footer">
            {{ "maxFileSize" | i18n }}
          </div>
        </div>
      </div>
      <div class="modal-footer">
        <button
          type="submit"
          class="primary"
          appA11yTitle="{{ 'save' | i18n }}"
          [disabled]="form.loading"
        >
          <i
            class="bwi bwi-save-changes bwi-lg bwi-fw"
            [hidden]="form.loading"
            aria-hidden="true"
          ></i>
          <i
            class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
            [hidden]="!form.loading"
            aria-hidden="true"
          ></i>
        </button>
        <button type="button" data-dismiss="modal">{{ "close" | i18n }}</button>
      </div>
    </form>
  </div>
</div>
