unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at angular21 123 lines 4.8 kB view raw
1@let post = this.post(); 2@let loggedIn = this.loginService.loggedIn.value; 3@let isBskyPost = !!post.bskyUri; 4@let isExternalPost = post.user.url.startsWith('@') && post.privacy !== 1 && post.privacy !== 10; 5@let isMyPost = myId == post.userId && post.privacy != 2; 6<button aria-label="Post actions" mat-button class="mat-circle-button split-button-right" matTooltip="Post actions" 7 [matMenuTriggerFor]="menu"> 8 <fa-icon [icon]="expandDownIcon"></fa-icon> 9</button> 10<mat-menu #menu="matMenu" xPosition="before" id="post-actions-menu"> 11 <ng-template matMenuContent> 12 @if (loggedIn) { 13 <div class="post-action-buttons" mat-menu-item> 14 <app-post-action-buttons [fragment]="post" settingKey="postActionsButtonBarOrder"></app-post-action-buttons> 15 </div> 16 <hr class="my-0" /> 17 } 18 <button (click)="sharePost()" mat-menu-item> 19 <span class="post-actions-menu-span-content"> 20 {{ 'post-actions.shareUrl' | translate }} 21 <fa-icon [fixedWidth]="true" [icon]="shareIcon"></fa-icon> 22 </span> 23 </button> 24 @if (post.remotePostId && post.user.url.startsWith('@')) { 25 <a (click)="shareOriginalPost()" mat-menu-item> 26 <span class="post-actions-menu-span-content"> 27 {{ 'post-actions.shareExternalUrl' | translate }} 28 <fa-icon [fixedWidth]="true" [icon]="shareExternalIcon"></fa-icon> 29 </span> 30 </a> 31 } 32 @if (isBskyPost) { 33 <a [href]="bskyUrl()" target="_blank" mat-menu-item> 34 <span class="post-actions-menu-span-content"> 35 {{ 'post-actions.viewOnAtproto' | translate }} 36 <fa-icon size="lg" [fixedWidth]="true" [icon]="bskyIcon"></fa-icon> 37 </span> 38 </a> 39 } 40 @if (isExternalPost && (externalUrl() !== bskyUrl())) { 41 <a [href]="externalUrl()" target="_blank" mat-menu-item> 42 <span class="post-actions-menu-span-content"> 43 {{ 'post-actions.viewOriginalPost' | translate }} 44 <fa-icon size="lg" [fixedWidth]="true" [icon]="goExternalPost"></fa-icon> 45 </span> 46 </a> 47 } 48 @if (isMyPost) { 49 <button (click)="forceRefederate()" mat-menu-item> 50 <span class="post-actions-menu-span-content"> 51 {{ 'post-actions.forceRefederate' | translate }} 52 <fa-icon size="lg" [fixedWidth]="true" [icon]="refederateIcon"></fa-icon> 53 </span> 54 </button> 55 } 56 @if (loggedIn) { 57 @if (!postSilenced) { 58 <button (click)="silencePost()" mat-menu-item> 59 <span class="post-actions-menu-span-content"> 60 {{ 'post-actions.silenceInteractions' | translate }} 61 <fa-icon size="lg" [fixedWidth]="true" [icon]="silenceIcon"></fa-icon> 62 </span> 63 </button> 64 } 65 @if (!postSilenced) { 66 <button (click)="silencePost(true)" mat-menu-item> 67 <span class="post-actions-menu-span-content"> 68 {{ 'post-actions.silenceReplyNotifications' | translate }} 69 <fa-icon size="lg" [fixedWidth]="true" [icon]="silenceReplyIcon"></fa-icon> 70 </span> 71 </button> 72 } 73 @if (postSilenced) { 74 <button (click)="unsilencePost()" mat-menu-item> 75 <span class="post-actions-menu-span-content"> 76 {{ 'post-actions.unsilenceReplyNotifications' | translate }} 77 <fa-icon size="lg" [fixedWidth]="true" [icon]="unsilenceIcon"></fa-icon> 78 </span> 79 </button> 80 } 81 @if (!isMyPost) { 82 <a (click)="bitePost()" mat-menu-item> 83 <span class="post-actions-menu-span-content"> 84 {{ 'post-actions.bitePost' | translate }} 85 <fa-icon [fixedWidth]="true" [icon]="biteIcon"></fa-icon> 86 </span> 87 </a> 88 } 89 } 90 @if (!isMyPost) { 91 @if (loggedIn) { 92 <hr class="my-0" /> 93 <button (click)="muteAccount()" mat-menu-item class="dangerous-option"> 94 <span class="post-actions-menu-span-content"> 95 {{ 'post-actions.muteUser' | translate }} 96 <fa-icon size="lg" [fixedWidth]="true" [icon]="muteIcon"></fa-icon> 97 </span> 98 </button> 99 <button (click)="blockAccount()" mat-menu-item class="dangerous-option"> 100 <span class="post-actions-menu-span-content"> 101 {{ 'post-actions.blockUser' | translate }} 102 <fa-icon size="lg" [fixedWidth]="true" [icon]="blockIcon"></fa-icon> 103 </span> 104 </button> 105 } 106 <button (click)="reportPost()" mat-menu-item class="dangerous-option"> 107 <span class="post-actions-menu-span-content"> 108 {{ 'post-actions.reportPost' | translate }} 109 <fa-icon size="lg" [fixedWidth]="true" [icon]="reportIcon"></fa-icon> 110 </span> 111 </button> 112 } 113 @if (rawOutputEnabled && post) { 114 <hr class="my-0" /> 115 <button (click)="getRawJson(post.id)" mat-menu-item> 116 <span class="post-actions-menu-span-content"> 117 {{ 'dialog.common.rawData' | translate }} 118 <fa-icon [fixedWidth]="true" [icon]="rawJsonIcon"></fa-icon> 119 </span> 120 </button> 121 } 122 </ng-template> 123</mat-menu>