]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add autoplay tooltip, use of flex-wrap in video-info and other-videos
authorRigel Kent <sendmemail@rigelk.eu>
Sat, 21 Dec 2019 08:25:02 +0000 (09:25 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Sat, 21 Dec 2019 08:25:02 +0000 (09:25 +0100)
client/src/app/shared/user-subscription/subscribe-button.component.ts
client/src/app/videos/+video-watch/video-watch.component.html
client/src/app/videos/+video-watch/video-watch.component.scss
client/src/app/videos/recommendations/recommended-videos.component.html
client/src/app/videos/recommendations/recommended-videos.component.scss
client/src/app/videos/recommendations/recommended-videos.component.ts

index b04e230f0b3173ec25eb101b5347b9d48f180287..7180400b55f78af4e7e6b238e6a11b0ab9902a73 100644 (file)
@@ -70,7 +70,11 @@ export class SubscribeButtonComponent implements OnInit {
           this.subscribed = true
 
           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')
           )
         },
index e87f59c983ea20f15f02c7f496eafd6e40a1f9c6..25029623eee5b6b6b9b6018a2a278b5926ab3b95 100644 (file)
                   </div>
 
                   <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()"
                   ></my-video-actions-dropdown>
                 </div>
index f9ff83c3422c49d931e1673a8b2f0523db6e1be6..5da5a60dd31b61c2be965f6e9ae09010e4cd8cbe 100644 (file)
@@ -147,14 +147,13 @@ $video-info-margin-left: 44px;
       }
 
       .video-info-first-row-bottom {
-        display: grid;
-        grid-template-columns: 1fr auto;
+        display: flex;
+        flex-wrap: wrap;
         align-items: center;
         width: 100%;
       }
 
       .video-info-date-views {
-        flex-grow: 1;
         align-self: start;
         margin-bottom: 10px;
         margin-right: 10px;
@@ -210,8 +209,8 @@ $video-info-margin-left: 44px;
       .video-actions-rates {
         margin: 0 0 10px 0;
         align-items: start;
-        align-self: end;
         width: max-content;
+        margin-left: auto;
 
         .video-actions {
           height: 40px; // Align with the title
@@ -397,6 +396,10 @@ $video-info-margin-left: 44px;
     padding-left: 15px;
     min-width: $video-miniature-width;
 
+    @media screen and (min-width: 1800px - (3* $video-miniature-width)) {
+      width: min-content;
+    }
+
     .title-page {
       margin: 0 !important;
     }
index c82642c1c9d4d7e4294ad503ab2e3a9f8d793d34..476eca0710e6eaff26313697f10d120f04eab930 100644 (file)
@@ -1,10 +1,12 @@
 <div class="other-videos">
   <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">
         Other videos
       </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>
         <p-inputSwitch [(ngModel)]="autoPlayNextVideo" (ngModelChange)="switchAutoPlayNextVideo()"></p-inputSwitch>
       </div>
index c337979d8d771beb0a3346e54a6fd34ef1aa6c8c..1ab0c47ff54073ae9bca17bfaab3f1aef7b93487 100644 (file)
@@ -1,17 +1,22 @@
 .title-page-container {
+  display: flex;
   justify-content: space-between;
-  align-items: center;
+  align-items: baseline;
   margin-bottom: 25px;
+  flex-wrap: wrap-reverse;
 
   .title-page.active, .title-page.title-page-single {
     margin-bottom: unset;
+    margin-right: .5rem !important;
   }
 }
 
 .title-page-autoplay {
+  display: flex;
   width: max-content;
   height: max-content;
   align-items: center;
+  margin-left: auto;
 
   span {
     margin-right: 0.3rem;
index 116b0e8f75f99663ab94433d5a6bc7430826506a..ada6d3433023fff2bd10fec7fed64ec52a685b31 100644 (file)
@@ -8,6 +8,7 @@ import { User } from '@app/shared'
 import { AuthService, Notifier } from '@app/core'
 import { UserService } from '@app/shared/users/user.service'
 import { peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage'
+import { I18n } from '@ngx-translate/i18n-polyfill'
 
 @Component({
   selector: 'my-recommended-videos',
@@ -23,6 +24,7 @@ export class RecommendedVideosComponent implements OnChanges {
   @Output() gotRecommendations = new EventEmitter<Video[]>()
 
   autoPlayNextVideo: boolean
+  autoPlayNextVideoTooltip: string
 
   readonly hasVideos$: Observable<boolean>
   readonly videos$: Observable<Video[]>
@@ -31,6 +33,7 @@ export class RecommendedVideosComponent implements OnChanges {
     private userService: UserService,
     private authService: AuthService,
     private notifier: Notifier,
+    private i18n: I18n,
     private store: RecommendedVideosStore
   ) {
     this.videos$ = this.store.recommendations$
@@ -40,6 +43,8 @@ export class RecommendedVideosComponent implements OnChanges {
     this.autoPlayNextVideo = this.authService.isLoggedIn()
       ? this.authService.getUser().autoPlayNextVideo
       : 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 {