From 479e23b09d02623e1378b71113e796d169a89195 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 27 Sep 2013 15:48:54 -0400 Subject: [PATCH] Finish up admin permissions --- static/css/quay.css | 12 ++++++++++ static/js/controllers.js | 8 ++++++- static/partials/repo-admin.html | 39 +++++++++++++++++++++++++++++++++ static/partials/view-repo.html | 8 ++++++- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/static/css/quay.css b/static/css/quay.css index 13e149f7e..153351ffe 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -44,6 +44,10 @@ p.editable:hover i { position: relative; } +.repo .header .back { + margin-right: 6px; +} + .repo .description { margin-bottom: 40px; } @@ -76,6 +80,14 @@ p.editable:hover i { width: 300px; } +.repo .settings-cog { + margin-left: 20px; +} + +.repo .settings-cog a { + text-decoration: none !important; +} + .repo-listing { display: block; margin-bottom: 20px; diff --git a/static/js/controllers.js b/static/js/controllers.js index 30f7e5f82..2b6d73aef 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -58,7 +58,13 @@ function RepoAdminCtrl($scope, Restangular, $routeParams, $rootScope) { permission.role = role; var permissionPut = Restangular.one('repository/' + namespace + '/' + name + '/permissions/' + username); - permissionPut.customPUT(permission); + permissionPut.customPUT(permission).then(function() {}, function(result) { + if (result.status == 409) { + $('#onlyAdminModal').modal(); + } else { + $('#cannotchangeModal').modal(); + } + }); }; var permissionsFetch = Restangular.one('repository/' + namespace + '/' + name + '/permissions'); diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index 2cfb65390..e66f9fc60 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -4,6 +4,7 @@
+

{{repo.namespace}} / {{repo.name}}

@@ -38,4 +39,42 @@
+ + + + + + + + diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index a472d4a7f..e9c5c2eb2 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -7,6 +7,12 @@

{{repo.namespace}} / {{repo.name}} + + + + + +

@@ -22,7 +28,7 @@