Commit 31b34a75ce85c36bba7f192e58614e8f4e328437

Authored by Victor Costa
Committed by Michel Felipe
1 parent 33544a8b

Display paragraph comments besides the article

src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts
1 import {Component, Input} from "ng-forward"; 1 import {Component, Input} from "ng-forward";
  2 +import {SideCommentsComponent} from "../side-comments/side-comments.component";
2 3
3 @Component({ 4 @Component({
4 selector: "comment-paragraph-plugin-allow-comment", 5 selector: "comment-paragraph-plugin-allow-comment",
5 - templateUrl: "plugins/comment_paragraph/allow-comment/allow-comment.html" 6 + templateUrl: "plugins/comment_paragraph/allow-comment/allow-comment.html",
  7 + directives: [SideCommentsComponent]
6 }) 8 })
7 -export class AllowComment { 9 +export class AllowCommentComponent {
8 10
9 @Input() content: string; 11 @Input() content: string;
10 @Input() paragraphUuid: string; 12 @Input() paragraphUuid: string;
11 @Input() article: noosfero.Article; 13 @Input() article: noosfero.Article;
12 -  
13 - constructor() {  
14 - console.log("ALLOW COMMENT");  
15 - }  
16 } 14 }
src/plugins/comment_paragraph/allow-comment/allow-comment.html
1 <div class="paragraph-content" ng-bind-html="ctrl.content"></div> 1 <div class="paragraph-content" ng-bind-html="ctrl.content"></div>
2 -<div class="actions"></div> 2 +<div class="actions">
  3 + <a href="#" popover-placement="right" popover-trigger="outsideClick" uib-popover-template="'plugins/comment_paragraph/allow-comment/popover.html'" ng-click="ctrl.loadComments()"><i class="fa fa-fw fa-comments"></i></a>
  4 +</div>
src/plugins/comment_paragraph/allow-comment/allow-comment.scss 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +comment-paragraph-plugin-allow-comment {
  2 + .paragraph-content {
  3 + width: 94%;
  4 + display: inline-block;
  5 + }
  6 + .actions {
  7 + width: 4%;
  8 + display: inline-block;
  9 + vertical-align: top;
  10 + .popover {
  11 + width: 100%;
  12 + }
  13 + }
  14 +}
src/plugins/comment_paragraph/allow-comment/popover.html 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +<comment-paragraph-side-comments></comment-paragraph-side-comments>
src/plugins/comment_paragraph/index.ts
1 -import {AllowComment} from "./allow-comment/allow-comment.component"; 1 +import {AllowCommentComponent} from "./allow-comment/allow-comment.component";
2 2
3 -export let mainComponents: any = [AllowComment]; 3 +export let mainComponents: any = [AllowCommentComponent];
src/plugins/comment_paragraph/side-comments/side-comments.component.ts 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +import {Component} from "ng-forward";
  2 +
  3 +@Component({
  4 + selector: "comment-paragraph-side-comments",
  5 + templateUrl: "plugins/comment_paragraph/side-comments/side-comments.html"
  6 +})
  7 +export class SideCommentsComponent {
  8 +
  9 +}