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

39.9% Statements 83/208
34% Branches 17/50
0% Functions 0/12
53.06% Lines 52/98

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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159  1x   2x 2x         2x   1x 1x     2x 1x                                   2x 1x                         2x                 2x 2x 1x       1x 1x 2x 2x 1x   2x 1x   2x 1x   2x 1x   1x   2x     1x   2x 1x   2x 1x   1x   2x 1x   2x     1x         2x               2x                             1x 1x               2x 2x         2x 2x 1x 2x         2x   1x   2x   1x 1x  
 
<div class="row">
  <div class="stack">
    <h2 class="link blog-title" [class.remote]="!local">
      @if (tagLink) {
        <app-nav [url]="url" [text]="title"></app-nav>
      } @else if (clickableLink) {
        <app-nav [url]="url" [text]="title" [external]="true"></app-nav>
      } @else {
        <span>{{ title }}</span>
      }
    </h2>
    <div class="link-below">
      <div class="stack">
        <div class="info">
          @if (authors.length) {
            <ng-container i18n>
              by
              @if (authorExts$ | async; as xs) {
                @for (x of xs; track x) {
                  <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>
                }
              }
            </ng-container>
          }
          @if (tags.length) {
            <ng-container i18n>
              tagged
              @if (tagExts$ | async; as xs) {
                @for (x of xs; track x) {
                  <a class="tag" [routerLink]="['/tag', x.tag]" [appTitle]="x.tag">{{ x.name || '#' + x.tag }}</a>
                }
              } @else {
                @for (t of tags; track t) {
                  <a class="tag" [routerLink]="['/tag', t]">{{ t }}</a>
                }
              }
            </ng-container>
          }
          @for (icon of icons; track icon) {
            @if (showIcon(icon)) {
              <span class="icon"
                    [class.filter-toggle]="icon.tag"
                    (click)="clickIcon(icon, store.hotkey)"
                    [appTitle]="icon"
                    [ref]="ref">{{ icon.label }}</span>
            }
          }
          <span [title]="ref.published?.toISO()">{{ ref.published?.toRelative() }}</span>
          @if (!authors.length && ref.created && !local) {
            <ng-container i18n>
              on <a class="origin tag" [routerLink]="['/tag', ref.origin]">{{ ref.origin }}</a>
            </ng-container>
          }
        </div>
        <div class="actions">
          <a [routerLink]="['/ref', ref.url]" [queryParams]="{ origin: nonLocalOrigin }" (click)="saveRef()" i18n>permalink</a>
          @if (store.account.user) {
            <a class="fake-link" (click)="replying = !replying" i18n>reply</a>
          }
          @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>
          }
          @if (responses) {
            <a [routerLink]="['/ref', ref.url, 'responses']" [queryParams]="{ origin: nonLocalOrigin }" (click)="saveRef()" i18n>{responses, plural, =1 {1&thinsp;citation} other {{{ responses }}&thinsp;citations}}</a>
          }
          @if (sources === 1) {
            <a [routerLink]="['/ref', ref.sources![0]]" [queryParams]="{ origin: nonLocalOrigin }" i18n>parent</a>
          } @else if (sources > 1) {
            <a [routerLink]="['/ref', ref.url, 'sources']" [queryParams]="{ origin: nonLocalOrigin }" (click)="saveRef()" i18n>{{ sources }}&thinsp;sources</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 (writeAccess) {
            <a class="fake-link" (click)="editing = !editing" i18n>@if (editForm.dirty) {*edit*} @else {edit}</a>
          } @else {
            <a class="fake-link" (click)="viewSource = !viewSource" i18n>source</a>
          }
          @if (canInvoice) {
            <a [routerLink]="['/submit/invoice']" [queryParams]="{url: ref.url}" i18n>invoice</a>
          }
          <app-action-list [ref]="ref"
                           [repostRef]="repostRef"
                           [groupedActions]="groupedActions"></app-action-list>
        </div>
      </div>
    </div>
  </div>
</div>
@if (replying) {
  <app-comment-reply #reply
                     [autofocus]="true"
                     [to]="ref"
                     [showCancel]="true"
                     [tags]="replyTags"
                     (save)="goToComments()"></app-comment-reply>
}
@if (editing) {
  <form class="form" [formGroup]="editForm" (ngSubmit)="save()">
 
    <app-ref-form #refForm [group]="editForm"></app-ref-form>
 
    @for (e of serverError; track e) {
      <span><!-- Unexpected Error --></span>
      <div class="error">{{ e }}</div>
    }
 
    <span><!-- Buttons --></span>
    <span class="buttons right">
      @if (submitting) {
        <app-loading [inline]="true"></app-loading>
      }
      <button type="submit" [disabled]="submitting || submitted && !editForm.valid" i18n>save</button>
      <button type="button" [disabled]="submitting" (click)="editing = false" i18n>cancel</button>
    </span>
  </form>
} @else if (viewSource) {
  <form [formGroup]="editForm">
    <app-ref-form #refForm [group]="editForm"></app-ref-form>
  </form>
} @else {
  <app-viewer class="blog-body" [ref]="ref"></app-viewer>
  @for (e of serverError; track e) {
    <div class="error">{{ e }}</div>
  }
}
 
<h5 [routerLink]="['/ref', ref.url, 'comments']" [queryParams]="{ origin: nonLocalOrigin }" i18n>Comments:</h5>
<div class="summary-box" [class.hidden-without-removing]="!comments">
  <app-thread-summary query="plugin/comment:!plugin/delete"
                      [commentView]="true"
                      [showLoadMore]="false"
                      [source]="ref.url"
                      [depth]="1"
                      [pageSize]="summaryItems"></app-thread-summary>
  <a class="load-more" [routerLink]="['/ref', ref.url, 'comments']" [queryParams]="{ origin: nonLocalOrigin }" i18n>
    more comments
  </a>
</div>
<app-comment-reply [to]="ref"
                   [tags]="replyTags"
                   (save)="goToComments()"></app-comment-reply>
<hr>