aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment-add.component.html4
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts12
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comments.component.html1
3 files changed, 14 insertions, 3 deletions
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 9b43d91da..c9b0a9c63 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 @@
20 <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n> 20 <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n>
21 Cancel 21 Cancel
22 </button> 22 </button>
23 <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }" i18n> 23 <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }">
24 Reply 24 {{ addingCommentButtonValue }}
25 </button> 25 </button>
26 </div> 26 </div>
27</form> 27</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 c1ddc0695..c6e9c73b8 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'
7import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment' 7import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment'
8import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 8import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
9import { VideoCommentCreate } from '@shared/models' 9import { VideoCommentCreate } from '@shared/models'
10import { I18n } from '@ngx-translate/i18n-polyfill'
10 11
11@Component({ 12@Component({
12 selector: 'my-video-comment-add', 13 selector: 'my-video-comment-add',
@@ -20,6 +21,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
20 @Input() parentComments: VideoComment[] 21 @Input() parentComments: VideoComment[]
21 @Input() focusOnInit = false 22 @Input() focusOnInit = false
22 @Input() textValue?: string 23 @Input() textValue?: string
24 @Input() commentThread?: boolean
23 25
24 @Output() commentCreated = new EventEmitter<VideoComment>() 26 @Output() commentCreated = new EventEmitter<VideoComment>()
25 @Output() cancel = new EventEmitter() 27 @Output() cancel = new EventEmitter()
@@ -28,6 +30,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
28 @ViewChild('textarea', { static: true }) textareaElement: ElementRef 30 @ViewChild('textarea', { static: true }) textareaElement: ElementRef
29 31
30 addingComment = false 32 addingComment = false
33 addingCommentButtonValue: string
31 34
32 constructor ( 35 constructor (
33 protected formValidatorService: FormValidatorService, 36 protected formValidatorService: FormValidatorService,
@@ -35,7 +38,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
35 private notifier: Notifier, 38 private notifier: Notifier,
36 private videoCommentService: VideoCommentService, 39 private videoCommentService: VideoCommentService,
37 private modalService: NgbModal, 40 private modalService: NgbModal,
38 private router: Router 41 private router: Router,
42 private i18n: I18n
39 ) { 43 ) {
40 super() 44 super()
41 } 45 }
@@ -46,6 +50,12 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges,
46 }) 50 })
47 51
48 if (this.user) { 52 if (this.user) {
53 if (this.commentThread) {
54 this.addingCommentButtonValue = this.i18n('Comment')
55 } else {
56 this.addingCommentButtonValue = this.i18n('Reply')
57 }
58
49 if (this.textValue) { 59 if (this.textValue) {
50 this.patchTextValue(this.textValue, this.focusOnInit) 60 this.patchTextValue(this.textValue, this.focusOnInit)
51 return 61 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 1bc0885a4..ac69f094b 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 @@
28 [user]="user" 28 [user]="user"
29 (commentCreated)="onCommentThreadCreated($event)" 29 (commentCreated)="onCommentThreadCreated($event)"
30 [textValue]="commentThreadRedraftValue" 30 [textValue]="commentThreadRedraftValue"
31 [commentThread]="true"
31 ></my-video-comment-add> 32 ></my-video-comment-add>
32 33
33 <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div> 34 <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div>