aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image-edit/actor-banner-edit.component.html
blob: d4ddb2deb2bf544a4c8a65b05d9209f535389b86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<div class="actor" *ngIf="actor">
  <div class="actor-img-edit-container">
    <div class="banner-placeholder">
      <img *ngIf="hasBanner()" [src]="preview || actor.bannerUrl" alt="Banner" />
    </div>

    <div *ngIf="!hasBanner()" class="actor-img-edit-button button-focus-within" [ngbTooltip]="bannerFormat" placement="right" container="body">
      <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
    </div>

    <div *ngIf="hasBanner()" ngbDropdown placement="right">
      <button type="button" class="actor-img-edit-button" ngbDropdownToggle>
        <my-global-icon iconName="edit"></my-global-icon>
        <label for="bannerMenu" i18n>Change your banner</label>
      </button>

      <div ngbDropdownMenu>
        <div class="dropdown-item dropdown-file button-focus-within" [ngbTooltip]="bannerFormat">
          <ng-container *ngTemplateOutlet="uploadNewBanner"></ng-container>
        </div>

        <button type="button" class="dropdown-item" (click)="deleteBanner()">
          <my-global-icon iconName="delete"></my-global-icon>
          <span i18n>Remove banner</span>
        </button>
      </div>
    </div>
  </div>
</div>

<ng-template #uploadNewBanner>
  <my-global-icon iconName="upload"></my-global-icon>
  <span for="bannerfile" i18n>Upload a new banner</span>
  <input #bannerfileInput type="file" name="bannerfile" id="bannerfile" [accept]="bannerExtensions" (change)="onBannerChange(bannerfileInput)"/>
</ng-template>