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 24 /** @ngInject */
25 25 function MainBlockController() {
26 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 17 noosfero.articles().get({path: $stateParams.page, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (article) {
18 18 //FIXME
19 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 6 .config(routeConfig);
7 7  
8 8 function routeConfig($stateProvider, $urlRouterProvider) {
  9 + $urlRouterProvider.when('/profile/:profile', '/:profile');
  10 +
9 11 $stateProvider
10 12 .state('profile', {
11 13 url: '/:profile',
12 14 templateUrl: 'app/profile/profile.html',
13 15 controller: 'ProfileController',
14 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 20 templateUrl: 'app/content-viewer/page.html',
36 21 controller: 'ContentViewerController',
37 22 controllerAs: 'vm'
38   - })
39   - .otherwise({
40   - redirectTo: '/'
41 23 });
42   - */
  24 +
  25 + $urlRouterProvider.otherwise('/');
43 26 }
44 27  
45 28 })();
... ...