diff options
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
8 files changed, 30 insertions, 37 deletions
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.scss b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss index 467ca1d2c..d9cf7a14f 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.scss +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss | |||
@@ -3,7 +3,7 @@ | |||
3 | @import '_mixins'; | 3 | @import '_mixins'; |
4 | @import '_miniature'; | 4 | @import '_miniature'; |
5 | 5 | ||
6 | $iconSize: 16px; | 6 | $icon-size: 16px; |
7 | 7 | ||
8 | ::ng-deep my-video-list-header { | 8 | ::ng-deep my-video-list-header { |
9 | display: flex; | 9 | display: flex; |
@@ -17,20 +17,19 @@ $iconSize: 16px; | |||
17 | 17 | ||
18 | my-feed { | 18 | my-feed { |
19 | display: inline-block; | 19 | display: inline-block; |
20 | width: calc(#{$iconSize} - 2px); | 20 | width: calc(#{$icon-size} - 2px); |
21 | } | 21 | } |
22 | 22 | ||
23 | .moderation-block { | 23 | .moderation-block { |
24 | |||
25 | my-global-icon { | ||
26 | position: relative; | ||
27 | width: $iconSize; | ||
28 | } | ||
29 | |||
30 | margin-left: .4rem; | 24 | margin-left: .4rem; |
31 | display: flex; | 25 | display: flex; |
32 | justify-content: flex-end; | 26 | justify-content: flex-end; |
33 | align-items: center; | 27 | align-items: center; |
28 | |||
29 | my-global-icon { | ||
30 | position: relative; | ||
31 | width: $icon-size; | ||
32 | } | ||
34 | } | 33 | } |
35 | } | 34 | } |
36 | 35 | ||
@@ -72,7 +71,7 @@ $iconSize: 16px; | |||
72 | 71 | ||
73 | .title-page { | 72 | .title-page { |
74 | margin-bottom: 10px; | 73 | margin-bottom: 10px; |
75 | margin-right: 0px; | 74 | margin-right: 0; |
76 | } | 75 | } |
77 | } | 76 | } |
78 | } | 77 | } |
diff --git a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts index 32cfdfd68..03be6d2ff 100644 --- a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts +++ b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts | |||
@@ -13,7 +13,7 @@ import { VideoDownloadComponent } from './video-download.component' | |||
13 | import { VideoMiniatureComponent } from './video-miniature.component' | 13 | import { VideoMiniatureComponent } from './video-miniature.component' |
14 | import { VideosSelectionComponent } from './videos-selection.component' | 14 | import { VideosSelectionComponent } from './videos-selection.component' |
15 | import { VideoListHeaderComponent } from './video-list-header.component' | 15 | import { VideoListHeaderComponent } from './video-list-header.component' |
16 | import { SharedAccountAvatarModule } from '../shared-account-avatar/shared-account-avatar.module' | 16 | import { SharedActorImageModule } from '../shared-actor-image/shared-actor-image.module' |
17 | 17 | ||
18 | @NgModule({ | 18 | @NgModule({ |
19 | imports: [ | 19 | imports: [ |
@@ -25,7 +25,7 @@ import { SharedAccountAvatarModule } from '../shared-account-avatar/shared-accou | |||
25 | SharedGlobalIconModule, | 25 | SharedGlobalIconModule, |
26 | SharedVideoLiveModule, | 26 | SharedVideoLiveModule, |
27 | SharedVideoModule, | 27 | SharedVideoModule, |
28 | SharedAccountAvatarModule | 28 | SharedActorImageModule |
29 | ], | 29 | ], |
30 | 30 | ||
31 | declarations: [ | 31 | declarations: [ |
diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.scss b/client/src/app/shared/shared-video-miniature/video-download.component.scss index 7f6e03c87..b689b1046 100644 --- a/client/src/app/shared/shared-video-miniature/video-download.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-download.component.scss | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | border-top-right-radius: 0; | 29 | border-top-right-radius: 0; |
30 | border-bottom-right-radius: 0; | 30 | border-bottom-right-radius: 0; |
31 | border-right: none; | 31 | border-right: 0; |
32 | 32 | ||
33 | select { | 33 | select { |
34 | height: inherit; | 34 | height: inherit; |
@@ -85,7 +85,7 @@ | |||
85 | &.metadata-attribute-tags { | 85 | &.metadata-attribute-tags { |
86 | .metadata-attribute-value:not(:nth-child(2)) { | 86 | .metadata-attribute-value:not(:nth-child(2)) { |
87 | &::before { | 87 | &::before { |
88 | content: ', ' | 88 | content: ', '; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | } | 91 | } |
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html index bc19127aa..645be92bd 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html | |||
@@ -10,14 +10,15 @@ | |||
10 | <div class="video-bottom"> | 10 | <div class="video-bottom"> |
11 | <div class="video-miniature-information"> | 11 | <div class="video-miniature-information"> |
12 | <div class="d-flex video-miniature-meta"> | 12 | <div class="d-flex video-miniature-meta"> |
13 | <a *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" class="channel-avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"> | 13 | <my-actor-avatar |
14 | <img [src]="getAvatarUrl()" alt="" /> | 14 | *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" [title]="channelLinkTitle" |
15 | </a> | 15 | [channel]="video.channel" [size]="actorImageSize" [internalHref]="[ '/video-channels', video.byVideoChannel ]" |
16 | ></my-actor-avatar> | ||
16 | 17 | ||
17 | <my-account-avatar | 18 | <my-actor-avatar |
18 | *ngIf="displayOptions.avatar && displayOwnerAccount()" [title]="channelLinkTitle" | 19 | *ngIf="displayOptions.avatar && displayOwnerAccount()" [title]="channelLinkTitle" |
19 | [account]="video.account" size="40" [internalHref]="'/video-channels/' + video.byVideoChannel" | 20 | [account]="video.account" [size]="actorImageSize" [internalHref]="[ '/video-channels', video.byVideoChannel ]" |
20 | ></my-account-avatar> | 21 | ></my-actor-avatar> |
21 | 22 | ||
22 | <div class="w-100 d-flex flex-column"> | 23 | <div class="w-100 d-flex flex-column"> |
23 | <a *ngIf="!videoHref" tabindex="-1" class="video-miniature-name" | 24 | <a *ngIf="!videoHref" tabindex="-1" class="video-miniature-name" |
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss index f6f2925f0..5df89d019 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss | |||
@@ -12,15 +12,10 @@ $more-button-width: 40px; | |||
12 | width: calc(100% - #{$more-button-width}); | 12 | width: calc(100% - #{$more-button-width}); |
13 | } | 13 | } |
14 | 14 | ||
15 | my-account-avatar, | 15 | my-actor-avatar { |
16 | .channel-avatar { | ||
17 | margin: 10px 10px 0 0; | 16 | margin: 10px 10px 0 0; |
18 | } | 17 | } |
19 | 18 | ||
20 | .channel-avatar img{ | ||
21 | @include channel-avatar(40px); | ||
22 | } | ||
23 | |||
24 | .video-miniature-created-at-views { | 19 | .video-miniature-created-at-views { |
25 | font-size: 13px; | 20 | font-size: 13px; |
26 | } | 21 | } |
@@ -46,7 +41,7 @@ my-account-avatar, | |||
46 | } | 41 | } |
47 | 42 | ||
48 | .video-info-blocked { | 43 | .video-info-blocked { |
49 | color: red; | 44 | color: #ff0000; |
50 | 45 | ||
51 | .blocked-reason::before { | 46 | .blocked-reason::before { |
52 | content: ' - '; | 47 | content: ' - '; |
@@ -54,7 +49,7 @@ my-account-avatar, | |||
54 | } | 49 | } |
55 | 50 | ||
56 | .video-info-nsfw { | 51 | .video-info-nsfw { |
57 | color: red; | 52 | color: #ff0000; |
58 | } | 53 | } |
59 | 54 | ||
60 | .video-actions { | 55 | .video-actions { |
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index 8d66aaee2..b58c118be 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts | |||
@@ -12,6 +12,7 @@ import { | |||
12 | } from '@angular/core' | 12 | } from '@angular/core' |
13 | import { AuthService, ScreenService, ServerService, User } from '@app/core' | 13 | import { AuthService, ScreenService, ServerService, User } from '@app/core' |
14 | import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models' | 14 | import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models' |
15 | import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component' | ||
15 | import { Video } from '../shared-main' | 16 | import { Video } from '../shared-main' |
16 | import { VideoPlaylistService } from '../shared-video-playlist' | 17 | import { VideoPlaylistService } from '../shared-video-playlist' |
17 | import { VideoActionsDisplayType } from './video-actions-dropdown.component' | 18 | import { VideoActionsDisplayType } from './video-actions-dropdown.component' |
@@ -51,6 +52,8 @@ export class VideoMiniatureComponent implements OnInit { | |||
51 | } | 52 | } |
52 | @Input() displayVideoActions = true | 53 | @Input() displayVideoActions = true |
53 | 54 | ||
55 | @Input() actorImageSize: ActorAvatarSize = '40' | ||
56 | |||
54 | @Input() displayAsRow = false | 57 | @Input() displayAsRow = false |
55 | 58 | ||
56 | @Input() videoLinkType: VideoLinkType = 'internal' | 59 | @Input() videoLinkType: VideoLinkType = 'internal' |
@@ -180,14 +183,6 @@ export class VideoMiniatureComponent implements OnInit { | |||
180 | return '' | 183 | return '' |
181 | } | 184 | } |
182 | 185 | ||
183 | getAvatarUrl () { | ||
184 | if (this.displayOwnerAccount()) { | ||
185 | return this.video.account.avatar?.url | ||
186 | } | ||
187 | |||
188 | return this.video.videoChannelAvatarUrl | ||
189 | } | ||
190 | |||
191 | loadActions () { | 186 | loadActions () { |
192 | if (this.displayVideoActions) this.showActions = true | 187 | if (this.displayVideoActions) this.showActions = true |
193 | 188 | ||
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html index dec9e99f3..4ee90ce7f 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.html +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html | |||
@@ -1,9 +1,9 @@ | |||
1 | <div class="no-results" i18n *ngIf="hasDoneFirstQuery && videos.length === 0">No results.</div> | 1 | <div class="no-results" i18n *ngIf="hasDoneFirstQuery && videos.length === 0">{{ noResultMessage }}</div> |
2 | 2 | ||
3 | <div myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()" class="videos"> | 3 | <div myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()" class="videos"> |
4 | <div class="video" *ngFor="let video of videos; let i = index; trackBy: videoById"> | 4 | <div class="video" *ngFor="let video of videos; let i = index; trackBy: videoById"> |
5 | 5 | ||
6 | <div class="checkbox-container"> | 6 | <div class="checkbox-container" *ngIf="enableSelection"> |
7 | <my-peertube-checkbox [inputName]="'video-check-' + video.id" [(ngModel)]="_selection[video.id]"></my-peertube-checkbox> | 7 | <my-peertube-checkbox [inputName]="'video-check-' + video.id" [(ngModel)]="_selection[video.id]"></my-peertube-checkbox> |
8 | </div> | 8 | </div> |
9 | 9 | ||
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts index f8c3800d7..d64ee9b98 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts | |||
@@ -31,6 +31,9 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni | |||
31 | @Input() pagination: ComponentPagination | 31 | @Input() pagination: ComponentPagination |
32 | @Input() titlePage: string | 32 | @Input() titlePage: string |
33 | @Input() miniatureDisplayOptions: MiniatureDisplayOptions | 33 | @Input() miniatureDisplayOptions: MiniatureDisplayOptions |
34 | @Input() noResultMessage = $localize`No results.` | ||
35 | @Input() enableSelection = true | ||
36 | @Input() loadOnInit = true | ||
34 | 37 | ||
35 | @Input() getVideosObservableFunction: (page: number, sort?: VideoSortField) => Observable<ResultList<Video>> | 38 | @Input() getVideosObservableFunction: (page: number, sort?: VideoSortField) => Observable<ResultList<Video>> |
36 | 39 | ||