Chocobozzz/PeerTube

View on GitHub
client/src/app/shared/shared-main/buttons/help.component.html

Summary

Maintainability
Test Coverage
<ng-template #tooltipTemplate>
  <p *ngIf="preHtmlTemplate">
    <ng-template *ngTemplateOutlet="preHtmlTemplate"></ng-template>
  </p>

  <div *ngIf="preHtmlTemplate && (customHtmlTemplate || mainHtml || postHtmlTemplate)" class="mb-2"></div>

  <p *ngIf="customHtmlTemplate">
    <ng-template *ngTemplateOutlet="customHtmlTemplate"></ng-template>
  </p>

  <p *ngIf="mainHtml" [innerHTML]="mainHtml"></p>

  <div *ngIf="(customHtmlTemplate || mainHtml) && postHtmlTemplate" class="mb-2"></div>

  <p *ngIf="postHtmlTemplate">
    <ng-template *ngTemplateOutlet="postHtmlTemplate"></ng-template>
  </p>
</ng-template>

<button
  class="help-tooltip-button p-0 border-0 mx-1"
  [title]="title"
  popoverClass="help-popover"
  [attr.aria-pressed]="isPopoverOpened"
  [ngbPopover]="tooltipTemplate"
  [placement]="tooltipPlacement"
  [autoClose]="autoClose"
  (onHidden)="onPopoverHidden()"
  (onShown)="onPopoverShown()"
  type="button"
>
  <my-global-icon [iconName]="iconName"></my-global-icon>
</button>