1
0
Fork 0

Add autoplay tooltip, use of flex-wrap in video-info and other-videos

This commit is contained in:
Rigel Kent 2019-12-21 09:25:02 +01:00
parent 3921166d78
commit 5def76ebba
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
6 changed files with 28 additions and 9 deletions

View File

@ -70,7 +70,11 @@ export class SubscribeButtonComponent implements OnInit {
this.subscribed = true this.subscribed = true
this.notifier.success( this.notifier.success(
this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }), this.i18n(
'Subscribed to {{nameWithHost}}. ' +
'You will be notified of all their new videos.',
{ nameWithHost: this.videoChannel.displayName }
),
this.i18n('Subscribed') this.i18n('Subscribed')
) )
}, },

View File

@ -109,7 +109,7 @@
</div> </div>
<my-video-actions-dropdown <my-video-actions-dropdown
placement="top auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video"
(videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()" (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
></my-video-actions-dropdown> ></my-video-actions-dropdown>
</div> </div>

View File

@ -147,14 +147,13 @@ $video-info-margin-left: 44px;
} }
.video-info-first-row-bottom { .video-info-first-row-bottom {
display: grid; display: flex;
grid-template-columns: 1fr auto; flex-wrap: wrap;
align-items: center; align-items: center;
width: 100%; width: 100%;
} }
.video-info-date-views { .video-info-date-views {
flex-grow: 1;
align-self: start; align-self: start;
margin-bottom: 10px; margin-bottom: 10px;
margin-right: 10px; margin-right: 10px;
@ -210,8 +209,8 @@ $video-info-margin-left: 44px;
.video-actions-rates { .video-actions-rates {
margin: 0 0 10px 0; margin: 0 0 10px 0;
align-items: start; align-items: start;
align-self: end;
width: max-content; width: max-content;
margin-left: auto;
.video-actions { .video-actions {
height: 40px; // Align with the title height: 40px; // Align with the title
@ -397,6 +396,10 @@ $video-info-margin-left: 44px;
padding-left: 15px; padding-left: 15px;
min-width: $video-miniature-width; min-width: $video-miniature-width;
@media screen and (min-width: 1800px - (3* $video-miniature-width)) {
width: min-content;
}
.title-page { .title-page {
margin: 0 !important; margin: 0 !important;
} }

View File

@ -1,10 +1,12 @@
<div class="other-videos"> <div class="other-videos">
<ng-container *ngIf="hasVideos$ | async"> <ng-container *ngIf="hasVideos$ | async">
<div class="d-flex title-page-container"> <div class="title-page-container">
<div i18n class="title-page title-page-single"> <div i18n class="title-page title-page-single">
Other videos Other videos
</div> </div>
<div *ngIf="!playlist" class="d-flex title-page-autoplay"> <div *ngIf="!playlist" class="title-page-autoplay"
[ngbTooltip]="autoPlayNextVideoTooltip" placement="bottom-right auto"
>
<span i18n>Autoplay</span> <span i18n>Autoplay</span>
<p-inputSwitch [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></p-inputSwitch> <p-inputSwitch [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></p-inputSwitch>
</div> </div>

View File

@ -1,17 +1,22 @@
.title-page-container { .title-page-container {
display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: baseline;
margin-bottom: 25px; margin-bottom: 25px;
flex-wrap: wrap-reverse;
.title-page.active, .title-page.title-page-single { .title-page.active, .title-page.title-page-single {
margin-bottom: unset; margin-bottom: unset;
margin-right: .5rem !important;
} }
} }
.title-page-autoplay { .title-page-autoplay {
display: flex;
width: max-content; width: max-content;
height: max-content; height: max-content;
align-items: center; align-items: center;
margin-left: auto;
span { span {
margin-right: 0.3rem; margin-right: 0.3rem;

View File

@ -8,6 +8,7 @@ import { User } from '@app/shared'
import { AuthService, Notifier } from '@app/core' import { AuthService, Notifier } from '@app/core'
import { UserService } from '@app/shared/users/user.service' import { UserService } from '@app/shared/users/user.service'
import { peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage' import { peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage'
import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({ @Component({
selector: 'my-recommended-videos', selector: 'my-recommended-videos',
@ -23,6 +24,7 @@ export class RecommendedVideosComponent implements OnChanges {
@Output() gotRecommendations = new EventEmitter<Video[]>() @Output() gotRecommendations = new EventEmitter<Video[]>()
autoPlayNextVideo: boolean autoPlayNextVideo: boolean
autoPlayNextVideoTooltip: string
readonly hasVideos$: Observable<boolean> readonly hasVideos$: Observable<boolean>
readonly videos$: Observable<Video[]> readonly videos$: Observable<Video[]>
@ -31,6 +33,7 @@ export class RecommendedVideosComponent implements OnChanges {
private userService: UserService, private userService: UserService,
private authService: AuthService, private authService: AuthService,
private notifier: Notifier, private notifier: Notifier,
private i18n: I18n,
private store: RecommendedVideosStore private store: RecommendedVideosStore
) { ) {
this.videos$ = this.store.recommendations$ this.videos$ = this.store.recommendations$
@ -40,6 +43,8 @@ export class RecommendedVideosComponent implements OnChanges {
this.autoPlayNextVideo = this.authService.isLoggedIn() this.autoPlayNextVideo = this.authService.isLoggedIn()
? this.authService.getUser().autoPlayNextVideo ? this.authService.getUser().autoPlayNextVideo
: peertubeSessionStorage.getItem(RecommendedVideosComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' || false : peertubeSessionStorage.getItem(RecommendedVideosComponent.SESSION_STORAGE_AUTO_PLAY_NEXT_VIDEO) === 'true' || false
this.autoPlayNextVideoTooltip = this.i18n('When active, the next video is automatically played after the current one.')
} }
public ngOnChanges (): void { public ngOnChanges (): void {