aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
diff options
context:
space:
mode:
authorkimsible <kimsible@users.noreply.github.com>2020-08-07 18:41:05 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-14 15:03:38 +0200
commitcb54210c192bdbedab5d3333cc2602df8e23a38a (patch)
tree28e33247f432821f9b4f11e31fd73ab7fc659aae /client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts
parentc311596094d6e2bad4f6215250dfc0c819d30b15 (diff)
downloadPeerTube-cb54210c192bdbedab5d3333cc2602df8e23a38a.tar.gz
PeerTube-cb54210c192bdbedab5d3333cc2602df8e23a38a.tar.zst
PeerTube-cb54210c192bdbedab5d3333cc2602df8e23a38a.zip
Use comment as label for comments-thread add button
Diffstat (limited to 'client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts12
1 files changed, 11 insertions, 1 deletions
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