unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at angular21 70 lines 2.6 kB view raw
1@let post = this.post(); 2<mat-card [id]="'post-element-' + uniquePost().id" class="wafrn-container post-card" [class.active]="active()" 3 [ngClass]="{ 'top-bar': post.length > 1, 'post-card-ios': iOSSafari }" appearance="outlined"> 4 @if (post.length > 1) { 5 <app-post-ribbon [user]="post[post.length - 1].user" [icon]="headerText() === 'replied' ? replyIcon : reblogIcon" 6 [card]="false" [time]="post[post.length - 1].createdAt"> 7 <a class="user-link user-name" [blogLink]="uniquePost().user" [innerHTML]="uniquePost().user.name"></a> 8 <span class="text-sm post-action"> {{ headerText() }}</span> 9 </app-post-ribbon> 10 } 11 <div [ngClass]="{ 12 'shortened-post': postCanExpand() && !expanded() 13 }"> 14 @for (content of postSliced; track $index; let index = $index) { 15 @if ( 16 post.length > 1 && 17 (content.content !== '' || 18 (content.medias && content.medias.length > 0) || 19 index === 0 || 20 content.tags.length > 0 || 21 content.quotes.length > 0 || 22 content.questionPoll) 23 ) { 24 <hr /> 25 } 26 @if ( 27 content.content !== '' || 28 (content.medias && content.medias.length > 0) || 29 index === 0 || 30 content.tags.length > 0 || 31 content.quotes.length > 0 || 32 content.questionPoll 33 ) { 34 <app-post-header class="w-full" [fragment]="content" [simplified]="false"></app-post-header> 35 <app-post-fragment (forceExpand)="expandPost()" [fragment]="content"></app-post-fragment> 36 } 37 } 38 </div> 39 <hr /> 40 41 @if (postCanExpand()) { 42 <button color="accent" class="w-full mb-3 mt-2 w-full" mat-flat-button (click)="expandPost()"> 43 Expand woot 44 @if (post.length - postsExpanded > 4) { 45 <span>({{ post.length - postsExpanded }} posts)</span> 46 } 47 </button> 48 } 49 @if (post.length - postsExpanded > 50 && finalPosts()) { 50 <!--We show the 2 final posts if the post is VERY long and there are A LOT of posts to still see--> 51 <marquee>Thread collapsed because it's very long but we show you the end of the thread</marquee> 52 <hr style="margin-top: 10vh" /> 53 @for (content of finalPosts(); track $index; let index = $index) { 54 @if ( 55 content.content !== '' || 56 (content.medias && content.medias.length > 0) || 57 index === 0 || 58 content.tags.length > 0 || 59 content.quotes.length > 0 || 60 content.questionPoll 61 ) { 62 <hr /> 63 <app-post-header class="w-full" [fragment]="content" [simplified]="false"></app-post-header> 64 <app-post-fragment [fragment]="content"></app-post-fragment> 65 } 66 } 67 } 68 69 <app-bottom-reply-bar [fragment]="finalPost()" [notes]="notes()"></app-bottom-reply-bar> 70</mat-card>