Commit 2d01fcfb38f081e86b1ebdc5ab57809726ad6192

Authored by Tallys Martins
1 parent a3199c2c
Exists in users_profile_page

Adds container block component

Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
src/app/layout/blocks/container-block-plugin-container-block/container-block-plugin-container-block.component.ts 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +import { Input, Inject, Component } from 'ng-forward';
  2 +import {BlockService} from "../../../../lib/ng-noosfero-api/http/block.service";
  3 +import {Arrays} from "./../../../../lib/util/arrays";
  4 +
  5 +@Component({
  6 + selector: 'noosfero-container-block-plugin-container-block',
  7 + templateUrl: 'app/layout/blocks/container-block-plugin-container-block/container-block-plugin-container-block.html'
  8 +})
  9 +@Inject(BlockService, "$state")
  10 +export class ContainerBlockPluginContainerBlockComponent {
  11 +
  12 + @Input() block: any;
  13 + @Input() owner: any;
  14 +
  15 + profile: any;
  16 + blocks: any;
  17 +
  18 + constructor(private blockService: BlockService, private $state: any) { }
  19 +
  20 + ngOnInit() {
  21 + this.profile = this.owner;
  22 + this.blocks = [];
  23 + this.blockService.getApiContent(this.block).then((content: any) => {
  24 + this.blocks = content.blocks;
  25 + });
  26 + }
  27 +}
... ...
src/app/layout/blocks/container-block-plugin-container-block/container-block-plugin-container-block.html 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +<div>
  2 + <noosfero-block ng-repeat="block in ctrl.blocks | orderBy: 'position'"
  3 + [block]="block" [owner]="ctrl.owner">
  4 + </noosfero-block>
  5 +</div>
  6 +
... ...
src/app/layout/blocks/container-block-plugin-container-block/container-block-plugin-container-block.scss 0 → 100644
src/app/layout/blocks/container-block-plugin-container-block/index.ts 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +/* Module Index Entry - generated using the script npm run generate-index */
  2 +export * from "./container-block-plugin-container-block.component";
... ...
src/app/main/main.component.ts
... ... @@ -21,6 +21,7 @@ import { PersonTagsPluginInterestsBlockComponent } from &quot;../layout/blocks/person
21 21 import { TagsBlockComponent } from "../layout/blocks/tags/tags-block.component";
22 22 import { CustomContentComponent } from "../profile/custom-content/custom-content.component";
23 23 import { RecentActivitiesPluginActivitiesBlockComponent } from "../layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component";
  24 +import { ContainerBlockPluginContainerBlockComponent } from "../layout/blocks/container-block-plugin-container-block/container-block-plugin-container-block.component";
24 25 import { ProfileImagesPluginProfileImagesBlockComponent } from "../layout/blocks/profile-images-plugin-profile-images/profile-images-plugin-profile-images-block.component";
25 26 import { RegisterComponent } from "../account/register.component";
26 27  
... ... @@ -98,7 +99,7 @@ export class EnvironmentContent {
98 99 * @requires AuthService, Session, Notification, ArticleBlog, ArticleView, Boxes, Block, LinkListBlock,
99 100 * MainBlock, RecentDocumentsBlock, Navbar, ProfileImageBlock, MembersBlock,
100 101 * NoosferoTemplate, DateFormat, RawHTMLBlock, PersonTagsPluginInterestsBlock,
101   - * RecentActivitiesPluginActivitiesBlock, ProfileImagesPluginProfileImages
  102 + * RecentActivitiesPluginActivitiesBlock, ContainerBlockPluginContainerBlockComponent, ProfileImagesPluginProfileImages
102 103 * @description
103 104 * The Main controller for the Noosfero Angular Theme application.
104 105 *
... ... @@ -118,6 +119,7 @@ export class EnvironmentContent {
118 119 MembersBlockComponent, NoosferoTemplate, DateFormat, RawHTMLBlockComponent, StatisticsBlockComponent,
119 120 LoginBlockComponent, CustomContentComponent, PermissionDirective, SearchFormComponent, SearchComponent,
120 121 PersonTagsPluginInterestsBlockComponent, TagsBlockComponent, RecentActivitiesPluginActivitiesBlockComponent,
  122 + ContainerBlockPluginContainerBlockComponent,
121 123 ProfileImagesPluginProfileImagesBlockComponent, BlockComponent, RegisterComponent
122 124 ].concat(plugins.mainComponents).concat(plugins.hotspots),
123 125 providers: [AuthService, SessionService, NotificationService, BodyStateClassesService, RegisterService,
... ...