From c75bd732ceb5ecdd742756e3dfa177dd04bfe8c0 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 1 Oct 2013 14:14:30 -0400 Subject: [PATCH] Add deletion UI for repos --- static/css/quay.css | 11 ++++++++++- static/js/controllers.js | 17 ++++++++++++++++ static/partials/landing.html | 2 +- static/partials/repo-admin.html | 35 +++++++++++++++++++++++++++++++-- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/static/css/quay.css b/static/css/quay.css index ac5b48ec8..3a694b173 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -393,6 +393,7 @@ p.editable:hover i { .repo-admin .panel { display: inline-block; + width: 620px; } .repo-admin .user i { @@ -478,6 +479,14 @@ p.editable:hover i { width: 54px; } +.repo-admin .repo-delete { + text-align: center; +} + +.repo-admin .repo-delete button { + font-size: 125%; +} + .repo-admin .repo-access-state .state-icon { text-align: center; margin-bottom: 10px; @@ -494,7 +503,7 @@ p.editable:hover i { .repo-admin .repo-access-state { text-align: center; - width: 520px; + width: 580px; } .repo-admin .repo-access-state .state-icon i.icon-lock { diff --git a/static/js/controllers.js b/static/js/controllers.js index 43e0c57e3..5c75e3370 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -293,6 +293,23 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) { }); }; + $scope.askDelete = function() { + $('#confirmdeleteModal').modal({}); + }; + + $scope.deleteRepo = function() { + $('#confirmdeleteModal').modal('hide'); + + var deleteAction = Restangular.one('repository/' + namespace + '/' + name); + deleteAction.customDELETE().then(function() { + setTimeout(function() { + document.location = '/#/repository'; + }, 1000); + }, function() { + $('#cannotchangeModal').modal({}); + }); + }; + // Fetch the repository information. var repositoryFetch = Restangular.one('repository/' + namespace + '/' + name); repositoryFetch.get().then(function(repo) { diff --git a/static/partials/landing.html b/static/partials/landing.html index a44306651..17d0f6571 100644 --- a/static/partials/landing.html +++ b/static/partials/landing.html @@ -10,7 +10,7 @@
diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index eaad59c9c..fb6daf79e 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -79,6 +79,18 @@
+
+ + +
+
Delete Repository
+
+
+
Deleting a repository cannot be undone. Here be dragons!
+ +
+
+