Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use comment as label for comments-thread add button

kimsiblecb54210c192b
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html
index 9b43d91dad..c9b0a9c63a 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html
+++ b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html
@@ -20,8 +20,8 @@
<button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n>
Cancel
</button>
- <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }" i18n>
- Reply
+ <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }">
+ {{ addingCommentButtonValue }}
</button>
</div>
</form>
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
index c1ddc06953..c6e9c73b8f 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
+++ b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
@@ -7,6 +7,7 @@ import { Video } from '@app/shared/shared-main'
import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { VideoCommentCreate } from '@shared/models'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-video-comment-add',
@@ -20,6 +21,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
@Input() parentComments: VideoComment[]
@Input() focusOnInit = false
@Input() textValue?: string
+ @Input() commentThread?: boolean
@Output() commentCreated = new EventEmitter<VideoComment>()
@Output() cancel = new EventEmitter()
@@ -28,6 +30,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
@ViewChild('textarea', { static: true }) textareaElement: ElementRef
addingComment = false
+ addingCommentButtonValue: string
constructor (
protected formValidatorService: FormValidatorService,
@@ -35,7 +38,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
private notifier: Notifier,
private videoCommentService: VideoCommentService,
private modalService: NgbModal,
- private router: Router
+ private router: Router,
+ private i18n: I18n
) {
super()
}
@@ -46,6 +50,12 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
})
if (this.user) {
+ if (this.commentThread) {
+ this.addingCommentButtonValue = this.i18n('Comment')
+ } else {
+ this.addingCommentButtonValue = this.i18n('Reply')
+ }
+
if (this.textValue) {
this.patchTextValue(this.textValue, this.focusOnInit)
return
diff --git a/client/src/app/+videos/+video-watch/comment/video-comments.component.html b/client/src/app/+videos/+video-watch/comment/video-comments.component.html
index 1bc0885a4d..ac69f094b1 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comments.component.html
+++ b/client/src/app/+videos/+video-watch/comment/video-comments.component.html
@@ -28,6 +28,7 @@
[user]="user"
(commentCreated)="onCommentThreadCreated($event)"
[textValue]="commentThreadRedraftValue"
+ [commentThread]="true"
></my-video-comment-add>
<div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>