diff --git a/client/src/app/+search/search-filters.component.html b/client/src/app/+search/search-filters.component.html index ed0632a4d..5b9237379 100644 --- a/client/src/app/+search/search-filters.component.html +++ b/client/src/app/+search/search-filters.component.html @@ -226,7 +226,7 @@
- diff --git a/client/src/app/+search/search-filters.component.scss b/client/src/app/+search/search-filters.component.scss index c55e59310..fd997d33b 100644 --- a/client/src/app/+search/search-filters.component.scss +++ b/client/src/app/+search/search-filters.component.scss @@ -34,27 +34,3 @@ input[type=submit] { .submit-button { text-align: end; } - -.reset-button { - @include peertube-button; - @include margin-right(1rem); - - font-weight: $font-semibold; - display: inline-block; - padding: 0 10px; - white-space: nowrap; - background: transparent; -} - -.reset-button-small { - font-size: 80%; - height: unset; - line-height: unset; - margin: unset; - margin-bottom: 0.5rem; -} - -.label-container { - display: flex; - white-space: nowrap; -} diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html index ea9909612..f3c1f1634 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html @@ -365,14 +365,18 @@
- - - - - This is the date when the content was originally published (e.g. the release date for a film) - - - +
+ + + +
+ +
+ This is the date when the content was originally published (e.g. the release date for a film) +
+ c.action !== 'REMOVE') @@ -312,6 +314,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) } + // --------------------------------------------------------------------------- + isSaveReplayAllowed () { return this.serverConfig.live.allowReplay } @@ -328,6 +332,18 @@ export class VideoEditComponent implements OnInit, OnDestroy { return this.serverConfig.live.latencySetting.enabled } + hasPublicationDate () { + return !!this.form.value['originallyPublishedAt'] + } + + // --------------------------------------------------------------------------- + + resetField (name: string) { + this.form.patchValue({ [name]: null }) + } + + // --------------------------------------------------------------------------- + isPluginFieldHidden (pluginField: PluginField) { if (typeof pluginField.commonOptions.hidden !== 'function') return false diff --git a/client/src/app/shared/shared-forms/reactive-file.component.html b/client/src/app/shared/shared-forms/reactive-file.component.html index 8e38697e4..33bb88f1f 100644 --- a/client/src/app/shared/shared-forms/reactive-file.component.html +++ b/client/src/app/shared/shared-forms/reactive-file.component.html @@ -13,7 +13,7 @@
{{ filename }}
-
diff --git a/client/src/app/shared/shared-forms/reactive-file.component.scss b/client/src/app/shared/shared-forms/reactive-file.component.scss index f9ba5805a..a0afe1eee 100644 --- a/client/src/app/shared/shared-forms/reactive-file.component.scss +++ b/client/src/app/shared/shared-forms/reactive-file.component.scss @@ -19,15 +19,4 @@ font-weight: $font-semibold; } - - .reset-button { - @include peertube-button; - @include grey-button; - - font-size: 80%; - margin-left: 5px; - line-height: initial; - padding: 2px 5px; - height: auto; - } } diff --git a/client/src/sass/class-helpers/_forms.scss b/client/src/sass/class-helpers/_forms.scss index 1e78df947..4e5c98aa8 100644 --- a/client/src/sass/class-helpers/_forms.scss +++ b/client/src/sass/class-helpers/_forms.scss @@ -49,7 +49,32 @@ margin-top: 10px; } -label+.form-group-description { +// Useful with a "reset" button +.label-container { + display: flex; + white-space: nowrap; + align-items: baseline; +} + +label + .form-group-description, +.label-container + .form-group-description { margin-bottom: 10px; margin-top: 0; } + +.reset-button { + @include peertube-button; + @include grey-button; + + height: auto; + + &.reset-button-small { + font-size: 80%; + padding: 2px 5px; + margin: 0 0.25rem; + height: fit-content; + line-height: initial; + } +} + + diff --git a/server/server/controllers/api/videos/update.ts b/server/server/controllers/api/videos/update.ts index 1c8cecba1..491175d74 100644 --- a/server/server/controllers/api/videos/update.ts +++ b/server/server/controllers/api/videos/update.ts @@ -86,8 +86,10 @@ async function updateVideo (req: express.Request, res: express.Response) { if (videoInfoToUpdate[key] !== undefined) video.set(key, videoInfoToUpdate[key]) } - if (videoInfoToUpdate.originallyPublishedAt !== undefined && videoInfoToUpdate.originallyPublishedAt !== null) { - video.originallyPublishedAt = new Date(videoInfoToUpdate.originallyPublishedAt) + if (videoInfoToUpdate.originallyPublishedAt !== undefined) { + video.originallyPublishedAt = videoInfoToUpdate.originallyPublishedAt + ? new Date(videoInfoToUpdate.originallyPublishedAt) + : null } // Privacy update?