Commit 4b4877ed90c439c5bf7d645bc7348b9b3ec69109

Authored by Victor Costa
Committed by Michel Felipe
1 parent 2cafe5da

Load components defined in plugins

Also create a skeleton for comment paragraph plugin.
src/app/main/main.component.ts
... ... @@ -33,6 +33,7 @@ import {SidebarComponent} from "../layout/sidebar/sidebar.component";
33 33 import {MainBlockComponent} from "../layout/blocks/main-block/main-block.component";
34 34 import {HtmlEditorComponent} from "../shared/components/html-editor/html-editor.component";
35 35  
  36 +import * as plugins from "../../plugins";
36 37  
37 38 /**
38 39 * @ngdoc controller
... ... @@ -93,7 +94,7 @@ export class EnvironmentContent {
93 94 LinkListBlockComponent, CommunitiesBlockComponent, HtmlEditorComponent,
94 95 MainBlockComponent, RecentDocumentsBlockComponent, Navbar, SidebarComponent, ProfileImageBlockComponent,
95 96 MembersBlockComponent, NoosferoTemplate, DateFormat, RawHTMLBlockComponent
96   - ],
  97 + ].concat(plugins.mainComponents),
97 98 providers: [AuthService, SessionService, NotificationService, BodyStateClassesService]
98 99 })
99 100 @StateConfig([
... ...
src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +import {Component, Input} from "ng-forward";
  2 +
  3 +@Component({
  4 + selector: "comment-paragraph-plugin-allow-comment",
  5 + templateUrl: "plugins/comment_paragraph/allow-comment/allow-comment.html"
  6 +})
  7 +export class AllowComment {
  8 +
  9 + @Input() content: string;
  10 + @Input() paragraphUuid: string;
  11 + @Input() article: noosfero.Article;
  12 +
  13 + constructor() {
  14 + console.log("ALLOW COMMENT");
  15 + }
  16 +}
... ...
src/plugins/comment_paragraph/allow-comment/allow-comment.html 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +<div class="paragraph-content" ng-bind-html="ctrl.content"></div>
  2 +<div class="actions"></div>
... ...
src/plugins/comment_paragraph/index.ts 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +import {AllowComment} from "./allow-comment/allow-comment.component";
  2 +
  3 +export let mainComponents: any = [AllowComment];
... ...
src/plugins/index.ts 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +import * as commentParagraph from "./comment_paragraph";
  2 +
  3 +export let mainComponents: any = [];
  4 +mainComponents = mainComponents.concat(commentParagraph.mainComponents);
... ...