Prefer "editing" over "edition"
This commit is contained in:
parent
2183c53601
commit
448043fc81
|
@ -48,7 +48,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
|
|||
abuseStateChange: $localize`One of your abuse reports has been accepted or rejected by moderators`,
|
||||
newPeerTubeVersion: $localize`A new PeerTube version is available`,
|
||||
newPluginVersion: $localize`One of your plugin/theme has a new available version`,
|
||||
myVideoStudioEditionFinished: $localize`Video studio edition has finished`,
|
||||
myVideoStudioEditionFinished: $localize`Video studio editing has finished`,
|
||||
myVideoTranscriptionGenerated: $localize`The transcription of your video has been generated`
|
||||
}
|
||||
this.notificationSettingGroups = [
|
||||
|
|
|
@ -67,19 +67,19 @@
|
|||
</div>
|
||||
|
||||
<my-button
|
||||
theme="primary" i18n-label label="Run video edition" icon="circle-tick"
|
||||
(click)="runEdition()" (keydown.enter)="runEdition()"
|
||||
[disabled]="!form.valid || isRunningEdition || noEdition()"
|
||||
theme="primary" i18n-label label="Run video editing" icon="circle-tick"
|
||||
(click)="runEditing()" (keydown.enter)="runEditing()"
|
||||
[disabled]="!form.valid || isRunningEditing || noEditing()"
|
||||
></my-button>
|
||||
</form>
|
||||
|
||||
<div class="embed-container">
|
||||
<div class="mb-1 fw-bold" i18n>Video before edition</div>
|
||||
<div class="mb-1 fw-bold" i18n>Video before editing</div>
|
||||
<my-embed [video]="video"></my-embed>
|
||||
</div>
|
||||
|
||||
<div class="tasks-container" *ngIf="!noEdition()">
|
||||
<div class="mb-1 fw-bold" i18n>Edition tasks:</div>
|
||||
<div class="tasks-container" *ngIf="!noEditing()">
|
||||
<div class="mb-1 fw-bold" i18n>Editing tasks:</div>
|
||||
|
||||
<ol>
|
||||
<li *ngFor="let task of getTasksSummary()">{{ task }}</li>
|
||||
|
|
|
@ -34,7 +34,7 @@ import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.compon
|
|||
]
|
||||
})
|
||||
export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
||||
isRunningEdition = false
|
||||
isRunningEditing = false
|
||||
|
||||
video: VideoDetails
|
||||
|
||||
|
@ -86,10 +86,10 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
|||
return this.serverService.getHTMLConfig().video.image.extensions
|
||||
}
|
||||
|
||||
async runEdition () {
|
||||
if (this.isRunningEdition) return
|
||||
async runEditing () {
|
||||
if (this.isRunningEditing) return
|
||||
if (!this.form.valid) return
|
||||
if (this.noEdition()) return
|
||||
if (this.noEditing()) return
|
||||
|
||||
const title = $localize`Are you sure you want to edit "${this.video.name}"?`
|
||||
const listHTML = this.getTasksSummary().map(t => `<li>${t}</li>`).join('')
|
||||
|
@ -100,7 +100,7 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
|||
|
||||
if (await this.confirmService.confirm(confirmHTML, title) !== true) return
|
||||
|
||||
this.isRunningEdition = true
|
||||
this.isRunningEditing = true
|
||||
|
||||
const tasks = this.buildTasks()
|
||||
|
||||
|
@ -109,7 +109,7 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
|||
return this.videoStudioService.editVideo(this.video.uuid, tasks)
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.notifier.success($localize`Edition tasks created.`)
|
||||
this.notifier.success($localize`Editing tasks created.`)
|
||||
|
||||
// Don't redirect to old video version watch page that could be confusing for users
|
||||
this.router.navigateByUrl('/my-library/videos')
|
||||
|
@ -117,7 +117,7 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
|||
|
||||
error: err => {
|
||||
this.loadingBar.useRef().complete()
|
||||
this.isRunningEdition = false
|
||||
this.isRunningEditing = false
|
||||
this.notifier.error(err.message)
|
||||
logger.error(err)
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
|
|||
return $localize`(extensions: ${this.imageExtensions.join(', ')})`
|
||||
}
|
||||
|
||||
noEdition () {
|
||||
noEditing () {
|
||||
return this.buildTasks().length === 0
|
||||
}
|
||||
|
||||
|
|
|
@ -16,16 +16,16 @@
|
|||
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 ms-2">
|
||||
<my-peertube-checkbox
|
||||
inputName="raw-edition"
|
||||
[(ngModel)]="rawEdition" (ngModelChange)="onRawEditionSwitch()"
|
||||
i18n-labelText labelText="Raw edition"
|
||||
inputName="raw-edit"
|
||||
[(ngModel)]="rawEdit" (ngModelChange)="onRawEditSwitch()"
|
||||
i18n-labelText labelText="Raw edit"
|
||||
></my-peertube-checkbox>
|
||||
|
||||
<my-button *ngIf="!rawEdition && !segmentToUpdate" i18n-label label="Add a new segment" (click)="addSegmentToEdit()">
|
||||
<my-button *ngIf="!rawEdit && !segmentToUpdate" i18n-label label="Add a new segment" (click)="addSegmentToEdit()">
|
||||
</my-button>
|
||||
</div>
|
||||
|
||||
<div [hidden]="!rawEdition" [formGroup]="form">
|
||||
<div [hidden]="!rawEdit" [formGroup]="form">
|
||||
<textarea
|
||||
id="captionFileContent"
|
||||
formControlName="captionFileContent"
|
||||
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-start segments pe-2 ps-2" [hidden]="rawEdition">
|
||||
<div class="text-start segments pe-2 ps-2" [hidden]="rawEdit">
|
||||
@for (segment of segments; track segment.id) {
|
||||
<div class="pt-1 pb-1 mb-3">
|
||||
@if (segmentToUpdate === segment) {
|
||||
|
@ -78,16 +78,16 @@
|
|||
|
||||
<div class="d-flex mt-2">
|
||||
<div class="form-group w-100">
|
||||
<label class="visually-hidden" i18n for="segment-edition">Segment end timestamp</label>
|
||||
<label class="visually-hidden" i18n for="segment-edit">Segment end timestamp</label>
|
||||
|
||||
<textarea id="segment-edition" name="segment-edition" class="form-control fs-7" [(ngModel)]="segment.text"></textarea>
|
||||
<textarea id="segment-edit" name="segment-edit" class="form-control fs-7" [(ngModel)]="segment.text"></textarea>
|
||||
|
||||
<div *ngIf="segmentEditionError" class="form-error" role="alert">{{ segmentEditionError }}</div>
|
||||
<div *ngIf="segmentEditError" class="form-error" role="alert">{{ segmentEditError }}</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column ms-3">
|
||||
<my-button i18n-title title="Save" icon="tick" (click)="onEditionSaved(segment)"></my-button>
|
||||
<my-button class="mt-3" i18n-title title="Revert" icon="undo" (click)="onEditionCanceled(segment)"></my-button>
|
||||
<my-button i18n-title title="Save" icon="tick" (click)="onEditSaved(segment)"></my-button>
|
||||
<my-button class="mt-3" i18n-title title="Revert" icon="undo" (click)="onEditCanceled(segment)"></my-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -127,6 +127,6 @@
|
|||
|
||||
<input
|
||||
type="button" i18n-value value="Edit this caption" class="peertube-button primary-button"
|
||||
[disabled]="rawEdition && !form.valid" (click)="updateCaption()"
|
||||
[disabled]="rawEdit && !form.valid" (click)="updateCaption()"
|
||||
>
|
||||
</div>
|
||||
|
|
|
@ -62,11 +62,11 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
@ViewChild('textarea', { static: true }) textarea: ElementRef
|
||||
@ViewChild('embed') embed: EmbedComponent
|
||||
|
||||
rawEdition = false
|
||||
rawEdit = false
|
||||
segments: Segment[] = []
|
||||
|
||||
segmentToUpdate: Segment
|
||||
segmentEditionError = ''
|
||||
segmentEditError = ''
|
||||
private segmentToUpdateSave: Segment
|
||||
|
||||
activeSegment: Segment
|
||||
|
@ -126,7 +126,7 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
loadCaptionContent () {
|
||||
this.rawEdition = false
|
||||
this.rawEdit = false
|
||||
|
||||
if (this.videoCaption.action === 'CREATE' || this.videoCaption.action === 'UPDATE') {
|
||||
const file = this.videoCaption.captionfile as File
|
||||
|
@ -144,8 +144,8 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
})
|
||||
}
|
||||
|
||||
onRawEditionSwitch () {
|
||||
if (this.rawEdition === true) {
|
||||
onRawEditSwitch () {
|
||||
if (this.rawEdit === true) {
|
||||
this.form.patchValue({ captionFileContent: this.formatSegments() })
|
||||
this.resetTextarea()
|
||||
} else {
|
||||
|
@ -163,16 +163,16 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
this.player.seek(segment.startMs / 1000)
|
||||
}
|
||||
|
||||
onEditionSaved (segment: Segment) {
|
||||
this.segmentEditionError = ''
|
||||
onEditSaved (segment: Segment) {
|
||||
this.segmentEditError = ''
|
||||
|
||||
if (segment.startMs >= segment.endMs) {
|
||||
this.segmentEditionError = $localize`Start segment must be before end segment time`
|
||||
this.segmentEditError = $localize`Start segment must be before end segment time`
|
||||
return
|
||||
}
|
||||
|
||||
if (!segment.text) {
|
||||
this.segmentEditionError = $localize`Segment must have a text content`
|
||||
this.segmentEditError = $localize`Segment must have a text content`
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
this.scrollToSegment(segment)
|
||||
}
|
||||
|
||||
onEditionCanceled (segment: Segment) {
|
||||
onEditCanceled (segment: Segment) {
|
||||
if (!this.segmentToUpdateSave) {
|
||||
this.segments = this.segments.filter(s => s.id !== segment.id)
|
||||
return
|
||||
|
@ -195,11 +195,11 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
segment.endMs = this.segmentToUpdateSave.endMs
|
||||
segment.text = this.segmentToUpdateSave.text
|
||||
|
||||
this.onEditionSaved(segment)
|
||||
this.onEditSaved(segment)
|
||||
}
|
||||
|
||||
updateSegment (segment: Segment) {
|
||||
this.segmentEditionError = ''
|
||||
this.segmentEditError = ''
|
||||
|
||||
this.segmentToUpdateSave = { ...segment }
|
||||
this.segmentToUpdate = segment
|
||||
|
@ -306,14 +306,14 @@ export class VideoCaptionEditModalContentComponent extends FormReactive implemen
|
|||
|
||||
updateCaption () {
|
||||
if (this.segmentToUpdate) {
|
||||
this.notifier.error($localize`A segment is being edited. Save or cancel the edition first.`)
|
||||
this.notifier.error($localize`A segment is being edited. Save or cancel the edit first.`)
|
||||
return
|
||||
}
|
||||
|
||||
const languageId = this.videoCaption.language.id
|
||||
const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
|
||||
|
||||
if (this.rawEdition) {
|
||||
if (this.rawEdit) {
|
||||
this.loadSegments(this.form.value['captionFileContent'])
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@
|
|||
@case ('CREATE') {
|
||||
Cancel creation
|
||||
} @case ('UPDATE') {
|
||||
Cancel edition
|
||||
Cancel edit
|
||||
} @case ('REMOVE') {
|
||||
Cancel deletion
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
|||
beforeDismiss: () => {
|
||||
return this.confirmService.confirm(
|
||||
$localize`Are you sure you want to close this modal without saving your changes?`,
|
||||
$localize`Closing caption edition modal`
|
||||
$localize`Closing caption editing modal`
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
[parentComments]="newParentComments"
|
||||
[focusOnInit]="true"
|
||||
(commentCreated)="onCommentReplyCreated($event)"
|
||||
(cancelEdition)="onResetReply()"
|
||||
(cancelEdit)="onResetReply()"
|
||||
[textValue]="redraftValue"
|
||||
></my-video-comment-add>
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@
|
|||
<my-global-icon iconName="film" aria-hidden="true"></my-global-icon>
|
||||
|
||||
<div class="message" i18n>
|
||||
Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> edition has finished
|
||||
Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> editing tasks have finished
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
|
|
Loading…
Reference in New Issue