diff --git a/src/app/components/noosfero/blocks/block.directive.js b/src/app/components/noosfero/blocks/block.directive.js
new file mode 100644
index 0000000..4487a53
--- /dev/null
+++ b/src/app/components/noosfero/blocks/block.directive.js
@@ -0,0 +1,23 @@
+(function() {
+ 'use strict';
+
+ angular
+ .module('angular')
+ .directive('noosferoBlock', noosferoBlock);
+
+ /** @ngInject */
+ function noosferoBlock($compile) {
+ var directive = {
+ restrict: 'E',
+ scope: {
+ block: '='
+ },
+ link: function(scope, element, attrs) {
+ var blockName = scope.block.type.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
+ element.replaceWith($compile('')(scope));
+ }
+ };
+ return directive;
+ }
+
+})();
diff --git a/src/app/components/noosfero/blocks/link-list.directive.js b/src/app/components/noosfero/blocks/link-list.directive.js
new file mode 100644
index 0000000..ef18ed6
--- /dev/null
+++ b/src/app/components/noosfero/blocks/link-list.directive.js
@@ -0,0 +1,30 @@
+(function() {
+ 'use strict';
+
+ angular
+ .module('angular')
+ .directive('noosferoLinkListBlock', noosferoLinkListBlock);
+
+ /** @ngInject */
+ function noosferoLinkListBlock() {
+ var directive = {
+ restrict: 'E',
+ templateUrl: 'app/components/noosfero/blocks/link-list.html',
+ scope: {
+ block: '='
+ },
+ controller: LinkListBlockController,
+ controllerAs: 'vm',
+ bindToController: true
+ };
+
+ return directive;
+
+ /** @ngInject */
+ function LinkListBlockController(moment) {
+ var vm = this;
+ vm.links = vm.block.settings.links;
+ }
+ }
+
+})();
diff --git a/src/app/components/noosfero/blocks/link-list.html b/src/app/components/noosfero/blocks/link-list.html
new file mode 100644
index 0000000..2bc871f
--- /dev/null
+++ b/src/app/components/noosfero/blocks/link-list.html
@@ -0,0 +1,3 @@
+
diff --git a/src/app/components/noosfero/blocks/profile-image.directive.js b/src/app/components/noosfero/blocks/profile-image.directive.js
new file mode 100644
index 0000000..75d49f6
--- /dev/null
+++ b/src/app/components/noosfero/blocks/profile-image.directive.js
@@ -0,0 +1,30 @@
+(function() {
+ 'use strict';
+
+ angular
+ .module('angular')
+ .directive('noosferoProfileImageBlock', noosferoProfileImageBlock);
+
+ /** @ngInject */
+ function noosferoProfileImageBlock() {
+ var directive = {
+ restrict: 'E',
+ templateUrl: 'app/components/noosfero/blocks/profile-image.html',
+ scope: {
+ block: '='
+ },
+ controller: ProfileImageBlockController,
+ controllerAs: 'vm',
+ bindToController: true
+ };
+
+ return directive;
+
+ /** @ngInject */
+ function ProfileImageBlockController(moment) {
+ var vm = this;
+ vm.links = vm.block.settings.links;
+ }
+ }
+
+})();
diff --git a/src/app/components/noosfero/blocks/profile-image.html b/src/app/components/noosfero/blocks/profile-image.html
new file mode 100644
index 0000000..773b222
--- /dev/null
+++ b/src/app/components/noosfero/blocks/profile-image.html
@@ -0,0 +1 @@
+image
diff --git a/src/app/components/noosfero/noosfero.service.js b/src/app/components/noosfero/noosfero.service.js
index 683224a..93cbb6d 100644
--- a/src/app/components/noosfero/noosfero.service.js
+++ b/src/app/components/noosfero/noosfero.service.js
@@ -8,10 +8,5 @@
function communities() {
return $resource('/api/v1/communities/:id');
}
- // this.getBoxes = getBoxes;
- // function getBoxes() {
- // return [{id: 1, blocks: [{id: 1, type: 'test'}]},
- // {id: 2, blocks: [{id: 2, type: 'test2'}]}];
- // }
}
})();
diff --git a/src/app/main/main.controller.js b/src/app/main/main.controller.js
index da1714b..aaae5a5 100644
--- a/src/app/main/main.controller.js
+++ b/src/app/main/main.controller.js
@@ -6,16 +6,16 @@
.controller('MainController', MainController);
/** @ngInject */
- function MainController($timeout, noosfero, toastr) {
+ function MainController($timeout, noosfero, $log) {
var vm = this;
vm.boxes = [];
activate();
function activate() {
- var profile = noosfero.communities().get({id: 67, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}, function () {
- console.log(profile);
+ noosfero.communities().get({id: 67, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (profile) {
+ $log.log(profile);
+ vm.boxes = profile.community.boxes;
});
- // vm.boxes = noosfero.getBoxes();
}
}
})();
diff --git a/src/app/main/main.html b/src/app/main/main.html
index c0e8c4b..60e509e 100644
--- a/src/app/main/main.html
+++ b/src/app/main/main.html
@@ -5,9 +5,7 @@
diff --git a/src/app/pages/profile/box.html b/src/app/pages/profile/box.html
new file mode 100644
index 0000000..ab63d44
--- /dev/null
+++ b/src/app/pages/profile/box.html
@@ -0,0 +1,4 @@
+
+ Box {{box.id}}->{{box.position}}
+
+
diff --git a/src/app/views/profile/block.html b/src/app/views/profile/block.html
new file mode 100644
index 0000000..c265158
--- /dev/null
+++ b/src/app/views/profile/block.html
@@ -0,0 +1,9 @@
+
+
+
{{block.title}}
+
+
+
diff --git a/src/app/views/profile/box.html b/src/app/views/profile/box.html
new file mode 100644
index 0000000..1cd37ba
--- /dev/null
+++ b/src/app/views/profile/box.html
@@ -0,0 +1,4 @@
+
+ Box {{box.id}}->{{box.position}}
+
+
--
libgit2 0.21.2