diff --git a/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts b/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts index fff18eb..5ae912a 100644 --- a/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts +++ b/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts @@ -1,26 +1,33 @@ import {Component, Input, Inject} from "ng-forward"; import {SideCommentsComponent} from "../side-comments/side-comments.component"; import {CommentParagraphEventService} from "../events/comment-paragraph-event.service"; +import {CommentParagraphService} from "../http/comment-paragraph.service"; @Component({ selector: "comment-paragraph-plugin-allow-comment", templateUrl: "plugins/comment_paragraph/allow-comment/allow-comment.html", directives: [SideCommentsComponent] }) -@Inject("$scope", CommentParagraphEventService) +@Inject("$scope", CommentParagraphEventService, CommentParagraphService) export class AllowCommentComponent { @Input() content: string; @Input() paragraphUuid: string; @Input() article: noosfero.Article; + commentsCount: number; - constructor(private $scope: ng.IScope, private commentParagraphEventService: CommentParagraphEventService) { } + constructor(private $scope: ng.IScope, + private commentParagraphEventService: CommentParagraphEventService, + private commentParagraphService: CommentParagraphService) { } ngOnInit() { this.commentParagraphEventService.subscribeToggleCommentParagraph((article: noosfero.Article) => { this.article = article; this.$scope.$apply(); }); + this.commentParagraphService.commentParagraphCount(this.article, this.paragraphUuid).then((count: any) => { + this.commentsCount = count; + }); } isActivated() { diff --git a/src/plugins/comment_paragraph/allow-comment/allow-comment.html b/src/plugins/comment_paragraph/allow-comment/allow-comment.html index 6a76794..bc9998c 100644 --- a/src/plugins/comment_paragraph/allow-comment/allow-comment.html +++ b/src/plugins/comment_paragraph/allow-comment/allow-comment.html @@ -1,4 +1,8 @@
diff --git a/src/plugins/comment_paragraph/allow-comment/allow-comment.scss b/src/plugins/comment_paragraph/allow-comment/allow-comment.scss index 555239d..464c08e 100644 --- a/src/plugins/comment_paragraph/allow-comment/allow-comment.scss +++ b/src/plugins/comment_paragraph/allow-comment/allow-comment.scss @@ -10,5 +10,10 @@ comment-paragraph-plugin-allow-comment { .popover { width: 100%; } + .count { + font-size: 14px; + font-weight: bold; + color: rgb(99, 170, 204); + } } } diff --git a/src/plugins/comment_paragraph/hotspot/comment-paragraph-article-button.html b/src/plugins/comment_paragraph/hotspot/comment-paragraph-article-button.html index b0896f1..474d143 100644 --- a/src/plugins/comment_paragraph/hotspot/comment-paragraph-article-button.html +++ b/src/plugins/comment_paragraph/hotspot/comment-paragraph-article-button.html @@ -1,2 +1,4 @@ -Enable -Disable +Enable +Disable diff --git a/src/plugins/comment_paragraph/http/comment-paragraph.service.ts b/src/plugins/comment_paragraph/http/comment-paragraph.service.ts index 14c3dc0..29cbacb 100644 --- a/src/plugins/comment_paragraph/http/comment-paragraph.service.ts +++ b/src/plugins/comment_paragraph/http/comment-paragraph.service.ts @@ -6,6 +6,8 @@ import {ArticleService} from "../../../lib/ng-noosfero-api/http/article.service" @Inject("Restangular", "$q", "$log", ArticleService) export class CommentParagraphService extends RestangularService