diff options
author | Chocobozzz <me@florianbigard.com> | 2023-08-18 11:40:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-08-18 11:40:54 +0200 |
commit | 7ace48819edc63f19f28ba3eedbbfbaa7c6504bd (patch) | |
tree | bc0fcf2fc9e1da9184d7581de2cf063e83ab00d0 /client/src/app/+videos | |
parent | ca589b42f1159d4474d7803c02b0c90579316bd5 (diff) | |
download | PeerTube-7ace48819edc63f19f28ba3eedbbfbaa7c6504bd.tar.gz PeerTube-7ace48819edc63f19f28ba3eedbbfbaa7c6504bd.tar.zst PeerTube-7ace48819edc63f19f28ba3eedbbfbaa7c6504bd.zip |
Add ability to reset originallyPublishedAt
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.html | 20 | ||||
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.ts | 16 |
2 files changed, 28 insertions, 8 deletions
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 @@ | |||
365 | </div> | 365 | </div> |
366 | 366 | ||
367 | <div class="form-group originally-published-at"> | 367 | <div class="form-group originally-published-at"> |
368 | <label i18n for="originallyPublishedAt">Original publication date</label> | 368 | <div class="label-container"> |
369 | <my-help> | 369 | <label i18n for="originallyPublishedAt">Original publication date</label> |
370 | <ng-template ptTemplate="preHtml"> | 370 | |
371 | <ng-container i18n> | 371 | <button i18n class="reset-button reset-button-small" (click)="resetField('originallyPublishedAt')" *ngIf="hasPublicationDate()"> |
372 | This is the date when the content was originally published (e.g. the release date for a film) | 372 | Reset |
373 | </ng-container> | 373 | </button> |
374 | </ng-template> | 374 | </div> |
375 | </my-help> | 375 | |
376 | <div class="form-group-description" i18n> | ||
377 | This is the date when the content was originally published (e.g. the release date for a film) | ||
378 | </div> | ||
379 | |||
376 | <p-calendar | 380 | <p-calendar |
377 | id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0" | 381 | id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0" |
378 | [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange" | 382 | [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange" |
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index b0c1352f3..898d3b0a6 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts | |||
@@ -264,6 +264,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
264 | if (this.schedulerInterval) clearInterval(this.schedulerInterval) | 264 | if (this.schedulerInterval) clearInterval(this.schedulerInterval) |
265 | } | 265 | } |
266 | 266 | ||
267 | // --------------------------------------------------------------------------- | ||
268 | |||
267 | getExistingCaptions () { | 269 | getExistingCaptions () { |
268 | return this.videoCaptions | 270 | return this.videoCaptions |
269 | .filter(c => c.action !== 'REMOVE') | 271 | .filter(c => c.action !== 'REMOVE') |
@@ -312,6 +314,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
312 | modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) | 314 | modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) |
313 | } | 315 | } |
314 | 316 | ||
317 | // --------------------------------------------------------------------------- | ||
318 | |||
315 | isSaveReplayAllowed () { | 319 | isSaveReplayAllowed () { |
316 | return this.serverConfig.live.allowReplay | 320 | return this.serverConfig.live.allowReplay |
317 | } | 321 | } |
@@ -328,6 +332,18 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
328 | return this.serverConfig.live.latencySetting.enabled | 332 | return this.serverConfig.live.latencySetting.enabled |
329 | } | 333 | } |
330 | 334 | ||
335 | hasPublicationDate () { | ||
336 | return !!this.form.value['originallyPublishedAt'] | ||
337 | } | ||
338 | |||
339 | // --------------------------------------------------------------------------- | ||
340 | |||
341 | resetField (name: string) { | ||
342 | this.form.patchValue({ [name]: null }) | ||
343 | } | ||
344 | |||
345 | // --------------------------------------------------------------------------- | ||
346 | |||
331 | isPluginFieldHidden (pluginField: PluginField) { | 347 | isPluginFieldHidden (pluginField: PluginField) { |
332 | if (typeof pluginField.commonOptions.hidden !== 'function') return false | 348 | if (typeof pluginField.commonOptions.hidden !== 'function') return false |
333 | 349 | ||