1
0
Fork 0

Only display availability hint in watch page

This commit is contained in:
Chocobozzz 2024-03-12 08:48:37 +01:00
parent 4e29a6f7ba
commit 3eba4fca2a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 8 additions and 5 deletions

View file

@ -60,7 +60,7 @@
<td class="action-cell">
<my-video-actions-dropdown
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [displayOptions]="videoActionsOptions"
placement="bottom auto" buttonDirection="horizontal" buttonStyled="true" [video]="video" [displayOptions]="videoActionsOptions"
(videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
></my-video-actions-dropdown>
</td>

View file

@ -58,7 +58,7 @@
<my-video-actions-dropdown
[video]="video" [displayOptions]="videoDropdownDisplayOptions" [moreActions]="moreVideoActions"
[buttonStyled]="true" buttonDirection="horizontal" (videoRemoved)="onVideoRemoved(video)"
buttonStyled="true" buttonDirection="horizontal" (videoRemoved)="onVideoRemoved(video)"
></my-video-actions-dropdown>
</div>
</ng-template>

View file

@ -49,7 +49,8 @@
<ng-container *ngIf="isUserLoggedIn">
<my-video-actions-dropdown
placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [videoCaptions]="videoCaptions"
placement="bottom auto" buttonDirection="horizontal" buttonStyled="true" [video]="video" [videoCaptions]="videoCaptions"
actionAvailabilityHint="true"
[displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
></my-video-actions-dropdown>
</ng-container>

View file

@ -1,5 +1,5 @@
import { NgIf } from '@angular/common'
import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
import { Component, EventEmitter, Input, OnChanges, Output, ViewChild, booleanAttribute } from '@angular/core'
import { AuthService, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core'
import { NgbDropdown, NgbDropdownAnchor, NgbDropdownMenu } from '@ng-bootstrap/ng-bootstrap'
import { VideoCaption } from '@peertube/peertube-models'
@ -86,10 +86,11 @@ export class VideoActionsDropdownComponent implements OnChanges {
}
@Input() placement = 'left'
@Input() moreActions: DropdownAction<{ video: Video }>[][] = []
@Input({ transform: booleanAttribute }) actionAvailabilityHint = false
@Input() label: string
@Input() buttonStyled = false
@Input({ transform: booleanAttribute }) buttonStyled = false
@Input() buttonSize: DropdownButtonSize = 'normal'
@Input() buttonDirection: DropdownDirection = 'vertical'
@ -378,6 +379,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
},
iconName: 'download',
ownerOrModeratorPrivilege: () => {
if (!this.actionAvailabilityHint) return undefined
if (this.isVideoDownloadableByAnonymous()) return undefined
return $localize`This option is visible only to you`