ActivityPub-federated video streaming platform using P2P directly in your web browser
Sticky video manage header
Chocobozzze498a8063805
diff --git a/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.html b/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.htmlindex 44602bbb89..b1acf10d3e 100644--- a/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.html+++ b/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.html@@ -47,9 +47,7 @@<my-video-manage-container[canUpdate]="hasUploadedFile()" [canWatch]="hasUploadedFile()"(videoUpdated)="onVideoUpdated()" [cancelLink]="getCancelLink()"+ i18n-uploadedLabel uploadedLabel="File uploaded! Your video is now available in your private library.">- @if (hasUploadedFile() && !getUploadError()) {- <my-alert type="primary" i18n>Congratulations! Your video is now available in your private library.</my-alert>- }</my-video-manage-container>}diff --git a/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.ts b/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.tsindex 846bc5dfe8..01d5959fa9 100644--- a/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.ts+++ b/client/src/app/+videos-publish-manage/+video-publish/upload/video-upload.component.ts@@ -39,7 +39,6 @@ const debugLogger = debug('peertube:video-publish')PreviewUploadComponent,ButtonComponent,ReactiveFormsModule,- AlertComponent,VideoManageContainerComponent]})@@ -186,10 +185,6 @@ export class VideoUploadComponent implements OnInit, OnDestroy, AfterViewInit, Cthis.notifier.success($localize`Changes saved.`)}- getUploadError () {- return this.manageController.getUploadError()- }-hasUploadedFile () {if (!this.videoEdit) return falsediff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.htmlindex d418aa216d..59688afb82 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html@@ -5,54 +5,58 @@<div class="w-100 min-width-0">- <div class="mb-3">- <div class="video-header mb-2">- <div class="video-actions video-header-block mb-2">- <my-button class="cancel-button" icon="arrow-left" theme="secondary" i18n [ptRouterLink]="cancelLink()">Cancel</my-button>-- <h2>{{ getVideo().name }}</h2>-- <div class="watch-save">- <my-button *ngIf="canWatch()" class="watch-button" icon="external-link" theme="secondary" class="me-3" [href]="getWatchUrl()">- <span i18n class="watch-button-label">Watch the video</span>- </my-button>-- <my-button- theme="primary" class="save-button"- icon="circle-tick"- [disabled]="!canUpdate() || !hasPendingChanges()" (click)="onWantToUpdate()"- >- @if (hasStudioTasks()) {- <ng-container i18n>Save and run studio tasks</ng-container>- } @else if (hasReplaceFile()) {- <ng-container i18n>Save and replace file</ng-container>- } @else {- <ng-container i18n>Save</ng-container>- }- </my-button>- </div>+ <div class="video-actions-container">+ <div class="video-actions video-header-block">+ <my-button class="cancel-button" icon="arrow-left" theme="secondary" i18n [ptRouterLink]="cancelLink()">Cancel</my-button>++ <h2>{{ getVideo().name }}</h2>++ <div class="watch-save">+ <my-button *ngIf="canWatch()" class="watch-button" icon="external-link" theme="secondary" class="me-3" [href]="getWatchUrl()">+ <span i18n class="watch-button-label">Watch the video</span>+ </my-button>++ <my-button+ theme="primary" class="save-button"+ icon="circle-tick"+ [disabled]="!canUpdate() || !hasPendingChanges()" (click)="onWantToUpdate()"+ >+ @if (hasStudioTasks()) {+ <ng-container i18n>Save and run studio tasks</ng-container>+ } @else if (hasReplaceFile()) {+ <ng-container i18n>Save and replace file</ng-container>+ } @else {+ <ng-container i18n>Save</ng-container>+ }+ </my-button></div>+ </div>+ </div>- <div *ngIf="getStateWarning()?.title" class="video-state video-header-block mb-2">- <div class="alert-title">{{ getStateWarning().title }}</div>+ <div *ngIf="getStateWarning()?.title" class="video-state video-header-block mt-2">+ <div class="alert-title">{{ getStateWarning().title }}</div>- <strong class="me-1">{{ getStateWarning().manageMain }}</strong>- <span>{{ getStateWarning().manageSecondary }}</span>- </div>+ <strong class="me-1">{{ getStateWarning().manageMain }}</strong>+ <span>{{ getStateWarning().manageSecondary }}</span>+ </div>- <my-manage-errors *ngIf="displayFormErrorsMsg && hasFormErrors()" class="d-block mb-2"></my-manage-errors>+ <my-manage-errors *ngIf="displayFormErrorsMsg && hasFormErrors()" class="d-block mt-2"></my-manage-errors>- <my-upload-progress- [isUploading]="isUploadingFile()"- [uploadPercents]="getUploadPercents()" [error]="getUploadError()" [uploaded]="hasUploadedFile()"- [enableRetryAfterError]="canRetryUpload" (retry)="retryUpload()"- >- </my-upload-progress>- </div>+ <my-upload-progress+ class="d-block mt-2"+ [isUploading]="isUploadingFile()"+ [uploadPercents]="getUploadPercents()" [error]="getUploadError()" [uploaded]="hasUploadedFile()"+ [enableRetryAfterError]="canRetryUpload" (retry)="retryUpload()"+ [uploadedLabel]="uploadedLabel()"+ >+ </my-upload-progress>+ <div class="mt-2"><ng-content></ng-content></div>- <router-outlet></router-outlet>+ <div class="mt-3">+ <router-outlet></router-outlet>+ </div></div></div>diff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scssindex e9aa188a17..e58b7eb70f 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss@@ -18,43 +18,45 @@background-color: pvar(--bg-secondary-350);}-.video-header {+.video-actions-container {+ position: sticky;+ top: pvar(--header-height);+ background-color: pvar(--bg);+ z-index: 1;+}++.video-actions {display: flex;- flex-direction: column;+ justify-content: space-between;+ gap: 1rem;+ padding: 1.5rem;- .video-actions {+ h2 {+ flex-shrink: 1;+ color: pvar(--fg-350);+ font-weight: $font-bold;+ margin-bottom: 0;+ line-height: normal;++ @include font-size(1.5rem);+ @include ellipsis;+ }++ .watch-save {display: flex;- justify-content: space-between;gap: 1rem;- padding: 1.5rem;+ }- h2 {- font-size: 1.5rem;- flex-shrink: 1;- color: pvar(--fg-350);- font-weight: $font-bold;- margin-bottom: 0;- line-height: normal;+ @media screen and (max-width: 1200px) {+ flex-direction: column;+ text-align: center;- @include ellipsis;+ .cancel-button {+ display: none;}.watch-save {- display: flex;- gap: 1rem;- }-- @media screen and (max-width: 1200px) {- flex-direction: column;- text-align: center;-- .cancel-button {- display: none;- }-- .watch-save {- justify-content: center;- }+ justify-content: center;}}@@ -63,6 +65,11 @@display: none;}}++ @include on-mobile-main-col {+ padding: 0.5rem;+ gap: 0.5rem;+ }}.video-state {diff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.tsindex d6987aed1f..a9eda8be3a 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts@@ -41,6 +41,7 @@ export class VideoManageContainerComponent implements OnInit, OnDestroy {readonly canWatch = input.required<boolean, string | boolean>({ transform: booleanAttribute })readonly canUpdate = input.required<boolean, string | boolean>({ transform: booleanAttribute })+ readonly uploadedLabel = input<string>()readonly cancelLink = input<string>()readonly videoUpdated = output()diff --git a/client/src/app/shared/standalone-upload/upload-progress.component.html b/client/src/app/shared/standalone-upload/upload-progress.component.htmlindex ddd0d9dec0..bfe3bc62ea 100644--- a/client/src/app/shared/standalone-upload/upload-progress.component.html+++ b/client/src/app/shared/standalone-upload/upload-progress.component.html@@ -10,7 +10,7 @@<input type="button" class="peertube-button secondary-button ms-1" i18n-value="Retry failed upload" value="Retry" (click)="retry.emit()" /></div>} @else {- <my-alert type="danger" class="mt-3">+ <my-alert type="danger"><div i18n>Sorry, but something went wrong.</div>{{ error() }}diff --git a/client/src/app/shared/standalone-upload/upload-progress.component.ts b/client/src/app/shared/standalone-upload/upload-progress.component.tsindex 5893739f45..9e6adbd1e2 100644--- a/client/src/app/shared/standalone-upload/upload-progress.component.ts+++ b/client/src/app/shared/standalone-upload/upload-progress.component.ts@@ -15,11 +15,12 @@ export class UploadProgressComponent {readonly error = input<string>(undefined)readonly uploaded = input<boolean>(undefined)readonly enableRetryAfterError = input<boolean>(undefined)+ readonly uploadedLabel = input<string>()readonly retry = output()getUploadingLabel () {- if (this.uploaded()) return $localize`File uploaded!`+ if (this.uploaded()) return this.uploadedLabel() || $localize`File uploaded!`const uploadPercents = this.uploadPercents()if (uploadPercents === 100) return $localize`Processing…`