Start on UI for Quay

This commit is contained in:
Joseph Schorr 2013-09-26 17:59:20 -04:00
parent 9278871381
commit 27ce5c00b2
10 changed files with 258 additions and 17 deletions

View file

@ -1,10 +1,23 @@
angular.module('quay', ['restangular']).
config(['$routeProvider', function($routeProvider) {
quayApp = angular.module('quay', ['restangular']).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.
when('/repository/', {templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
when('/', {templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
when('/repository/:namespace/:name', {templateUrl: '/static/partials/view-repo.html', controller: RepoCtrl}).
when('/repository/:namespace/:name/:tag', {templateUrl: '/static/partials/view-repo.html', controller: RepoCtrl}).
when('/repository/', {title: 'Repositories', templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
when('/', {title: 'Quay', templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
otherwise({redirectTo: '/'});
//$locationProvider.html5Mode(true);
}]).
config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api/');
});
});
quayApp.run(['$location', '$rootScope', function($location, $rootScope) {
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
if (current.$$route.title) {
$rootScope.title = current.$$route.title;
}
});
}]);