Commit 2e424f9704d9eb8c1074e843f05785e0c86b844c
1 parent
0e9faadc
Exists in
master
and in
35 other branches
Migrate boxes
Showing
7 changed files
with
21 additions
and
33 deletions
Show diff stats
src/app/components/noosfero-boxes/box.html
src/app/components/noosfero-boxes/boxes.component.js
... | ... | @@ -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 @@ |
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 | 49 | require("./components/noosfero-blocks/members-block/members-block.component.js"); |
50 | 50 | require("./components/noosfero-blocks/profile-image/profile-image.component.js"); |
51 | 51 | require("./components/noosfero-blocks/recent-documents/recent-documents.component.js"); |
52 | -require("./components/noosfero-boxes/boxes.component.js"); | |
53 | 52 | require("./components/noosfero/noosfero-template.filter.js"); |
54 | 53 | require("./components/noosfero/noosfero.service.js"); |
55 | 54 | require("./components/noosfero/profile-image/profile-image.component.js"); | ... | ... |
src/app/main/main.component.ts
1 | 1 | import {bundle, Component, StateConfig} from "ng-forward"; |
2 | 2 | import {NoosferoArticleBlog} from "./../components/noosfero-articles/blog/blog.component.ts"; |
3 | - | |
4 | 3 | import {ArticleDirective} from "../components/noosfero-articles/article/article.directive.ts"; |
5 | - | |
6 | 4 | import {Profile} from "../profile/profile.component"; |
5 | +import {Boxes} from "../components/noosfero-boxes/boxes.component"; | |
7 | 6 | |
8 | 7 | @Component({ |
9 | 8 | selector: 'main-content', |
... | ... | @@ -16,7 +15,7 @@ export class MainContent { |
16 | 15 | @Component({ |
17 | 16 | selector: 'main', |
18 | 17 | template: '<div ng-view></div>', |
19 | - directives: [NoosferoArticleBlog, ArticleDirective] | |
18 | + directives: [NoosferoArticleBlog, ArticleDirective, Boxes] | |
20 | 19 | }) |
21 | 20 | @StateConfig([ |
22 | 21 | { | ... | ... |
src/app/profile/profile.html