Retab files.
This commit is contained in:
parent
2fbd016595
commit
ccc6e3bd2e
4 changed files with 91 additions and 94 deletions
|
@ -1,23 +1,21 @@
|
|||
quayApp = angular.module('quay', ['restangular']).
|
||||
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
|
||||
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
|
||||
$routeProvider.
|
||||
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/: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);
|
||||
when('/repository/', {title: 'Repositories', templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
|
||||
when('/', {title: 'Quay', templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
|
||||
otherwise({redirectTo: '/'});
|
||||
}]).
|
||||
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;
|
||||
}
|
||||
});
|
||||
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
|
||||
if (current.$$route.title) {
|
||||
$rootScope.title = current.$$route.title;
|
||||
}
|
||||
});
|
||||
}]);
|
|
@ -13,15 +13,15 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
|
|||
$rootScope.title = 'Loading...';
|
||||
|
||||
$scope.editDescription = function() {
|
||||
if (!$scope.repo.can_write) { return; }
|
||||
$('#descriptionEdit')[0].value = $scope.repo.description || '';
|
||||
$('#editModal').modal({});
|
||||
if (!$scope.repo.can_write) { return; }
|
||||
$('#descriptionEdit')[0].value = $scope.repo.description || '';
|
||||
$('#editModal').modal({});
|
||||
};
|
||||
|
||||
$scope.saveDescription = function() {
|
||||
$('#editModal').modal('hide');
|
||||
$scope.repo.description = $('#descriptionEdit')[0].value;
|
||||
$scope.repo.put();
|
||||
$('#editModal').modal('hide');
|
||||
$scope.repo.description = $('#descriptionEdit')[0].value;
|
||||
$scope.repo.put();
|
||||
};
|
||||
|
||||
var namespace = $routeParams.namespace;
|
||||
|
@ -30,11 +30,11 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
|
|||
|
||||
var repositoryFetch = Restangular.one('repository/' + namespace + '/' + name);
|
||||
repositoryFetch.get().then(function(repo) {
|
||||
$rootScope.title = namespace + '/' + name;
|
||||
$scope.repo = repo;
|
||||
$scope.currentTag = repo.tags[tag] || repo.tags['latest'];
|
||||
$rootScope.title = namespace + '/' + name;
|
||||
$scope.repo = repo;
|
||||
$scope.currentTag = repo.tags[tag] || repo.tags['latest'];
|
||||
}, function() {
|
||||
$scope.repo = null;
|
||||
$rootScope.title = 'Unknown Repository';
|
||||
$scope.repo = null;
|
||||
$rootScope.title = 'Unknown Repository';
|
||||
});
|
||||
}
|
Reference in a new issue