Chocobozzz/PeerTube

View on GitHub
client/src/app/+my-library/my-videos/modals/video-change-ownership.component.html

Summary

Maintainability
Test Coverage
<ng-template #modal let-close="close" let-dismiss="dismiss">
  <div class="modal-header">
    <h4 i18n class="modal-title">Change ownership</h4>

    <button class="border-0 p-0" title="Close this modal" i18n-title (click)="dismiss()">
      <my-global-icon iconName="cross"></my-global-icon>
    </button>
  </div>

  <div class="modal-body" [formGroup]="form">
    <div class="form-group">
      <label i18n for="next-ownership-username">Select the next owner</label>

      <p-autoComplete
        formControlName="username" [suggestions]="usernamePropositions"
        (completeMethod)="search($event)" id="next-ownership-username"
      ></p-autoComplete>

      <div *ngIf="formErrors.username" class="form-error" role="alert">
        {{ formErrors.username }}
      </div>
    </div>
  </div>

  <div class="modal-footer">
    <div class="inputs">
      <input
        type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
        (click)="dismiss()" (key.enter)="dismiss()"
      >

      <input
        type="submit" i18n-value value="Submit" class="peertube-button orange-button"
        [disabled]="!form.valid" (click)="close()"
      />
    </div>
  </div>
</ng-template>