Only display availability hint in watch page

pull/6272/head
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"> <td class="action-cell">
<my-video-actions-dropdown <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()" (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
></my-video-actions-dropdown> ></my-video-actions-dropdown>
</td> </td>

View File

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

View File

@ -49,7 +49,8 @@
<ng-container *ngIf="isUserLoggedIn"> <ng-container *ngIf="isUserLoggedIn">
<my-video-actions-dropdown <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()" [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
></my-video-actions-dropdown> ></my-video-actions-dropdown>
</ng-container> </ng-container>

View File

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