All files / app/component/chat/chat-entry chat-entry.component.html

28.31% Statements 32/113
20.93% Branches 9/43
0% Functions 0/7
36.06% Lines 22/61

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 932x                                               1x   1x 2x       1x   2x 2x         2x   2x         2x 1x 2x           1x         1x         1x         1x         1x     1x     1x     1x       1x 2x        
@if (ref.created) {
  <span class="gutter"
        [class.deleted]="deleted">
    @if (ref.origin && !authors.length) {
      <a class="origin tag" [routerLink]="['/tag', ref.origin]">{{ ref.origin }}</a>
    }
    @if (authorExts$ | async; as xs) {
      @for (x of xs; track x.tag + x.origin) {
        <a class="user tag"
           [title]="formatAuthor(x.tag + x.origin)"
           [routerLink]="['/tag', x.tag + x.origin]"
           [appTitle]="x">{{ x.name || formatAuthor(x.tag) }}</a>
      }
    } @else {
      @for (t of authors; track t) {
        <a class="user tag"
           [title]="formatAuthor(t)"
           [routerLink]="['/tag', t]">{{ formatAuthor(t) }}</a>
      }
    }
    <span class="timestamp" [title]="ref.modified?.toISO()">{{ ref.modified?.toRelative() }}</span>
    &nbsp;|&nbsp;
  </span>
} @else if (loading) {
  <div class="loading-container"><app-loading></app-loading></div>
}
<span class="message"
      [class.bubble]="focused"
      [class.focused]="focused"
      [class.deleted]="deleted"
      [class.sending]="!ref.created"
      (pointerenter)="allowActions = true"
      (pointerleave)="allowActions = false">
  <div class="content" [class.has-title]="clickableLink || title && !focused">
    @if (tagLink) {
      <app-nav [url]="ref.url" [text]="title"></app-nav>
    } @else if (clickableLink && (title && !focused || !media)) {
      <app-nav [url]="ref.url" [text]="title" [external]="true"></app-nav>
    } @else {
      <span>{{ title }}</span>
    }
    @if (focused && bareRef?.comment) {
      <app-md [origin]="ref.origin!"
              [text]="bareRef!.comment!"
              [plugins]="bareRef!.tags!"></app-md>
    }
    <app-viewer [ref]="noComment"></app-viewer>
  </div>
  @if (ref.created) {
    <div class="actions" [style.pointer-events]="allowActions ? 'auto' : 'none'">
      @if (threads) {
        <a  [routerLink]="['/ref', ref.url, 'thread']"
            [queryParams]="{ origin: nonLocalOrigin }"
            (click)="saveRef()"
            i18n>sidebar</a>
      } @else if (comments) {
        <a  [routerLink]="['/ref', ref.url, 'comments']"
            [queryParams]="{ origin: nonLocalOrigin }"
            (click)="saveRef()"
            i18n>{comments, plural, =1 {1&thinsp;comment} other {{{ comments }}&thinsp;comments}}</a>
      } @else if (chatroom) {
        <a [routerLink]="['/ref', ref.url]"
           [queryParams]="{ origin: nonLocalOrigin }"
           (click)="saveRef()"
           i18n>sidebar</a>
      } @else {
        <a [routerLink]="['/ref', ref.url]"
           [queryParams]="{ origin: nonLocalOrigin }"
           (click)="saveRef()"
           i18n>permalink</a>
      }
      @if (store.account.mod || taggingAccess) {
        <app-confirm-action #action
                            [class.force-delete]="deleteAccess"
                            [action]="store.hotkey ? forceDelete$ : delete$" i18n>delete</app-confirm-action>
      }
      @if (taggingAccess) {
        <app-inline-tag #action [action]="tag$" [tags]="ref.tags" i18n>tag</app-inline-tag>
      }
      @if (!ref.origin && store.account.mod && !approved && !locked) {
        <a class="fake-link" (click)="approve()" i18n>approve</a>
      }
      @if (store.account.mod && approved) {
        <span class="approved icon" i18n-title title="Moderated" i18n>✔️</span>
      }
    </div>
  }
</span>
@for (e of serverError; track e) {
  <span><!-- Unexpected Error --></span>
  <div class="error">{{ e }}</div>
}