Commit 2e424f9704d9eb8c1074e843f05785e0c86b844c
1 parent
0e9faadc
Exists in
master
and in
1 other branch
Migrate boxes
Showing
7 changed files
with
21 additions
and
33 deletions
Show diff stats
src/app/components/noosfero-boxes/box.html
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <h3 class="panel-title">{{block.title}}</h3> | 4 | <h3 class="panel-title">{{block.title}}</h3> |
| 5 | </div> | 5 | </div> |
| 6 | <div class="panel-body"> | 6 | <div class="panel-body"> |
| 7 | - <noosfero-block block="block" owner="$ctrl.owner"></noosfero-block> | 7 | + <noosfero-block block="block" owner="ctrl.owner"></noosfero-block> |
| 8 | </div> | 8 | </div> |
| 9 | </div> | 9 | </div> |
| 10 | </div> | 10 | </div> |
src/app/components/noosfero-boxes/boxes.component.js
| @@ -1,26 +0,0 @@ | @@ -1,26 +0,0 @@ | ||
| 1 | -(function() { | ||
| 2 | - 'use strict'; | ||
| 3 | - | ||
| 4 | - angular | ||
| 5 | - .module('noosferoApp') | ||
| 6 | - .component('noosferoBoxes', { | ||
| 7 | - restrict: 'E', | ||
| 8 | - bindings: { | ||
| 9 | - boxes: '<', | ||
| 10 | - owner: '<' | ||
| 11 | - }, | ||
| 12 | - templateUrl: 'app/components/noosfero-boxes/boxes.html', | ||
| 13 | - controller: BoxesController | ||
| 14 | - }); | ||
| 15 | - | ||
| 16 | - /** @ngInject */ | ||
| 17 | - function BoxesController() { | ||
| 18 | - var vm = this; | ||
| 19 | - | ||
| 20 | - vm.boxesOrder = function(box) { | ||
| 21 | - if(box.position==2) return 0; | ||
| 22 | - return box.position; | ||
| 23 | - } | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | -})(); |
| @@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
| 1 | +import { Input, Inject, Component } from 'ng-forward'; | ||
| 2 | + | ||
| 3 | +@Component({ | ||
| 4 | + selector: "noosfero-boxes", | ||
| 5 | + templateUrl: "app/components/noosfero-boxes/boxes.html" | ||
| 6 | +}) | ||
| 7 | +export class Boxes { | ||
| 8 | + | ||
| 9 | + @Input() boxes: any | ||
| 10 | + @Input() owner: any | ||
| 11 | + | ||
| 12 | + boxesOrder(box) { | ||
| 13 | + if (box.position == 2) return 0; | ||
| 14 | + return box.position; | ||
| 15 | + } | ||
| 16 | +} |
src/app/components/noosfero-boxes/boxes.html
src/app/index.ts
| @@ -49,7 +49,6 @@ require("./components/noosfero-blocks/main-block/main-block.component.js"); | @@ -49,7 +49,6 @@ require("./components/noosfero-blocks/main-block/main-block.component.js"); | ||
| 49 | require("./components/noosfero-blocks/members-block/members-block.component.js"); | 49 | require("./components/noosfero-blocks/members-block/members-block.component.js"); |
| 50 | require("./components/noosfero-blocks/profile-image/profile-image.component.js"); | 50 | require("./components/noosfero-blocks/profile-image/profile-image.component.js"); |
| 51 | require("./components/noosfero-blocks/recent-documents/recent-documents.component.js"); | 51 | require("./components/noosfero-blocks/recent-documents/recent-documents.component.js"); |
| 52 | -require("./components/noosfero-boxes/boxes.component.js"); | ||
| 53 | require("./components/noosfero/noosfero-template.filter.js"); | 52 | require("./components/noosfero/noosfero-template.filter.js"); |
| 54 | require("./components/noosfero/noosfero.service.js"); | 53 | require("./components/noosfero/noosfero.service.js"); |
| 55 | require("./components/noosfero/profile-image/profile-image.component.js"); | 54 | require("./components/noosfero/profile-image/profile-image.component.js"); |
src/app/main/main.component.ts
| 1 | import {bundle, Component, StateConfig} from "ng-forward"; | 1 | import {bundle, Component, StateConfig} from "ng-forward"; |
| 2 | import {NoosferoArticleBlog} from "./../components/noosfero-articles/blog/blog.component.ts"; | 2 | import {NoosferoArticleBlog} from "./../components/noosfero-articles/blog/blog.component.ts"; |
| 3 | - | ||
| 4 | import {ArticleDirective} from "../components/noosfero-articles/article/article.directive.ts"; | 3 | import {ArticleDirective} from "../components/noosfero-articles/article/article.directive.ts"; |
| 5 | - | ||
| 6 | import {Profile} from "../profile/profile.component"; | 4 | import {Profile} from "../profile/profile.component"; |
| 5 | +import {Boxes} from "../components/noosfero-boxes/boxes.component"; | ||
| 7 | 6 | ||
| 8 | @Component({ | 7 | @Component({ |
| 9 | selector: 'main-content', | 8 | selector: 'main-content', |
| @@ -16,7 +15,7 @@ export class MainContent { | @@ -16,7 +15,7 @@ export class MainContent { | ||
| 16 | @Component({ | 15 | @Component({ |
| 17 | selector: 'main', | 16 | selector: 'main', |
| 18 | template: '<div ng-view></div>', | 17 | template: '<div ng-view></div>', |
| 19 | - directives: [NoosferoArticleBlog, ArticleDirective] | 18 | + directives: [NoosferoArticleBlog, ArticleDirective, Boxes] |
| 20 | }) | 19 | }) |
| 21 | @StateConfig([ | 20 | @StateConfig([ |
| 22 | { | 21 | { |
src/app/profile/profile.html