Commit f338d0b4b713baf3e1bb818cf0d35cecd9632c79

Authored by Victor Costa
1 parent f06fa207

Fix content viewer

src/app/components/noosfero-blocks/main-block/main-block.directive.js
@@ -24,12 +24,6 @@ @@ -24,12 +24,6 @@
24 /** @ngInject */ 24 /** @ngInject */
25 function MainBlockController() { 25 function MainBlockController() {
26 var vm = this; 26 var vm = this;
27 - $log.log($stateParams.page);  
28 - noosfero.articles().get({path: $stateParams.page, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (article) {  
29 - //FIXME  
30 - vm.article = article.articles[0];  
31 - $log.log(vm.article);  
32 - });  
33 } 27 }
34 } 28 }
35 29
src/app/components/noosfero-blocks/main-block/main-block.html
1 -<pre>{{vm.article}}</pre> 1 +<div ui-view></div>
src/app/content-viewer/content-viewer.controller.js
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 noosfero.articles().get({path: $stateParams.page, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (article) { 17 noosfero.articles().get({path: $stateParams.page, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (article) {
18 //FIXME 18 //FIXME
19 vm.content = article.articles[0]; 19 vm.content = article.articles[0];
  20 + console.log(vm.content);
20 }); 21 });
21 } 22 }
22 } 23 }
src/app/content-viewer/page.html
1 -<div class="container">  
2 -  
3 - <div>  
4 - <acme-navbar></acme-navbar>  
5 - </div>  
6 -  
7 - <div class="row">  
8 - <ng-include ng-repeat="box in vm.owner.boxes | orderBy: vm.boxesOrder" src="'app/views/profile/box.html'"></ng-include>  
9 - </div>  
10 -  
11 -</div>  
12 -  
13 -{{vm.article}} 1 +<pre>{{vm.content}}</pre>
src/app/index.route.js
@@ -6,40 +6,23 @@ @@ -6,40 +6,23 @@
6 .config(routeConfig); 6 .config(routeConfig);
7 7
8 function routeConfig($stateProvider, $urlRouterProvider) { 8 function routeConfig($stateProvider, $urlRouterProvider) {
  9 + $urlRouterProvider.when('/profile/:profile', '/:profile');
  10 +
9 $stateProvider 11 $stateProvider
10 .state('profile', { 12 .state('profile', {
11 url: '/:profile', 13 url: '/:profile',
12 templateUrl: 'app/profile/profile.html', 14 templateUrl: 'app/profile/profile.html',
13 controller: 'ProfileController', 15 controller: 'ProfileController',
14 controllerAs: 'vm' 16 controllerAs: 'vm'
15 - });  
16 -  
17 - $urlRouterProvider.otherwise('/');  
18 -  
19 - /*  
20 - var profileController = {  
21 - templateUrl: 'app/profile/profile.html',  
22 - controller: 'ProfileController',  
23 - controllerAs: 'vm'  
24 - };  
25 - $routeProvider  
26 - .when('/profile/:profile', {  
27 - redirectTo: '/:profile'  
28 - })  
29 - .when('/:profile', {  
30 - templateUrl: 'app/profile/profile.html',  
31 - controller: 'ProfileController',  
32 - controllerAs: 'vm'  
33 }) 17 })
34 - .when('/:profile/:page*', { 18 + .state('profile.page', {
  19 + url: '/{page:.*}',
35 templateUrl: 'app/content-viewer/page.html', 20 templateUrl: 'app/content-viewer/page.html',
36 controller: 'ContentViewerController', 21 controller: 'ContentViewerController',
37 controllerAs: 'vm' 22 controllerAs: 'vm'
38 - })  
39 - .otherwise({  
40 - redirectTo: '/'  
41 }); 23 });
42 - */ 24 +
  25 + $urlRouterProvider.otherwise('/');
43 } 26 }
44 27
45 })(); 28 })();