This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/app.js

21 lines
1,023 B
JavaScript
Raw Normal View History

2013-09-26 21:59:20 +00:00
quayApp = angular.module('quay', ['restangular']).
2013-09-26 23:07:25 +00:00
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
2013-09-24 22:21:14 +00:00
$routeProvider.
2013-09-26 23:07:25 +00:00
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}).
2013-09-26 21:59:20 +00:00
2013-09-26 23:07:25 +00:00
when('/repository/', {title: 'Repositories', templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
when('/', {title: 'Quay', templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
otherwise({redirectTo: '/'});
2013-09-24 22:21:14 +00:00
}]).
config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api/');
2013-09-26 21:59:20 +00:00
});
quayApp.run(['$location', '$rootScope', function($location, $rootScope) {
2013-09-26 23:07:25 +00:00
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
if (current.$$route.title) {
$rootScope.title = current.$$route.title;
}
});
2013-09-26 21:59:20 +00:00
}]);