Commit 66abb3310e25d6a5055a0a78120018b36c59168f
1 parent
9571bf30
Exists in
master
and in
1 other branch
Fix profile query
Showing
4 changed files
with
8 additions
and
11 deletions
Show diff stats
src/app/index.config.js
@@ -6,16 +6,11 @@ | @@ -6,16 +6,11 @@ | ||
6 | .config(config); | 6 | .config(config); |
7 | 7 | ||
8 | /** @ngInject */ | 8 | /** @ngInject */ |
9 | - function config($logProvider, toastrConfig) { | 9 | + function config($logProvider, $locationProvider) { |
10 | // Enable log | 10 | // Enable log |
11 | $logProvider.debugEnabled(true); | 11 | $logProvider.debugEnabled(true); |
12 | 12 | ||
13 | - // Set options third-party lib | ||
14 | - toastrConfig.allowHtml = true; | ||
15 | - toastrConfig.timeOut = 3000; | ||
16 | - toastrConfig.positionClass = 'toast-top-right'; | ||
17 | - toastrConfig.preventDuplicates = true; | ||
18 | - toastrConfig.progressBar = true; | 13 | + $locationProvider.html5Mode({enabled: true}); |
19 | } | 14 | } |
20 | 15 | ||
21 | })(); | 16 | })(); |
src/app/index.route.js
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | 7 | ||
8 | function routeConfig($routeProvider) { | 8 | function routeConfig($routeProvider) { |
9 | $routeProvider | 9 | $routeProvider |
10 | - .when('/', { | 10 | + .when('/:profile', { |
11 | templateUrl: 'app/main/main.html', | 11 | templateUrl: 'app/main/main.html', |
12 | controller: 'MainController', | 12 | controller: 'MainController', |
13 | controllerAs: 'main' | 13 | controllerAs: 'main' |
src/app/main/main.controller.js
@@ -5,16 +5,17 @@ | @@ -5,16 +5,17 @@ | ||
5 | .module('angular') | 5 | .module('angular') |
6 | .controller('MainController', MainController); | 6 | .controller('MainController', MainController); |
7 | 7 | ||
8 | + | ||
8 | /** @ngInject */ | 9 | /** @ngInject */ |
9 | - function MainController($timeout, noosfero, $log) { | 10 | + function MainController($timeout, noosfero, $log, $routeParams) { |
10 | var vm = this; | 11 | var vm = this; |
11 | vm.boxes = []; | 12 | vm.boxes = []; |
12 | activate(); | 13 | activate(); |
13 | 14 | ||
14 | function activate() { | 15 | function activate() { |
15 | - noosfero.communities().get({id: 67, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (profile) { | 16 | + noosfero.communities().get({identifier: $routeParams.profile, private_token: '1b00325e5f769a0c38550bd35b3f1d64'}).$promise.then(function (profile) { |
16 | $log.log(profile); | 17 | $log.log(profile); |
17 | - vm.owner = profile.community; | 18 | + vm.owner = profile.communities[0]; |
18 | }); | 19 | }); |
19 | } | 20 | } |
20 | 21 |
src/index.html
1 | <!doctype html> | 1 | <!doctype html> |
2 | <html ng-app="angular"> | 2 | <html ng-app="angular"> |
3 | <head> | 3 | <head> |
4 | + <base href="/test"> | ||
4 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
5 | <title>angular</title> | 6 | <title>angular</title> |
6 | <meta name="description" content=""> | 7 | <meta name="description" content=""> |