From 3da0228aaaaa0e29cf511fe68c3918fbbbd85d85 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 12 Jan 2015 17:43:36 -0500 Subject: [PATCH] Add repo-list-grid directive --- static/directives/repo-list-grid.html | 59 ++++++++++++++ static/js/app.js | 1 - static/js/controllers/repolist.js | 8 +- static/js/directives/repo-list-grid.js | 14 ++++ static/partials/repo-list.html | 108 +++++-------------------- 5 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 static/directives/repo-list-grid.html create mode 100644 static/js/directives/repo-list-grid.js diff --git a/static/directives/repo-list-grid.html b/static/directives/repo-list-grid.html new file mode 100644 index 000000000..92c9b9b6d --- /dev/null +++ b/static/directives/repo-list-grid.html @@ -0,0 +1,59 @@ +
+
+ +
+ + Starred +
+
+ + {{ namespace.username }} +
+ + + +
+ + + +
+
You haven't starred any repositories yet.
+
Stars allow you to easily access your favorite repositories.
+
+
+
This namespace doesn't have any viewable repositories.
+
Either no repositories exist yet or you may not have permission to view any. If you have permission, try creating a new repository.
+
+ + +
+
+
+
+
+ +
+
diff --git a/static/js/app.js b/static/js/app.js index 63eee0d6e..30eb7be92 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -6663,7 +6663,6 @@ quayApp.directive('tagSpecificImagesView', function () { return directiveDefinitionObject; }); - quayApp.directive('fallbackSrc', function () { return { restrict: 'A', diff --git a/static/js/controllers/repolist.js b/static/js/controllers/repolist.js index 61b3db426..50243603e 100644 --- a/static/js/controllers/repolist.js +++ b/static/js/controllers/repolist.js @@ -47,9 +47,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { }; ApiService.createStar(data).then(function(result) { updateReposAfterStar(repo); - }, function(result) { - // TODO(jzelinskie): have some kind of pop-up for star failure - }); + }, ApiService.errorDisplay('Could not star repository')); }; var unstarRepo = function(repo) { @@ -58,9 +56,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { }; ApiService.deleteStar(null, data).then(function(result) { updateReposAfterUnstar(repo); - }, function(result) { - // TODO(jzelinskie): have some kind of pop-up for star failure - }); + }, ApiService.errorDisplay('Could not unstar repository')); }; // Finds a repository within the list of namespaces attached to $scope. diff --git a/static/js/directives/repo-list-grid.js b/static/js/directives/repo-list-grid.js new file mode 100644 index 000000000..3f936e6f5 --- /dev/null +++ b/static/js/directives/repo-list-grid.js @@ -0,0 +1,14 @@ +quayApp.directive('repoListGrid', function() { + return { + templateUrl: '/static/directives/repo-list-grid.html', + priority: 0, + restrict: 'C', + scope: { + repositories: '=repositories', + starred: '=starred', + user: "=user", + namespace: '=namespace', + toggleStar: '&toggleStar' + }, + }; +}); diff --git a/static/partials/repo-list.html b/static/partials/repo-list.html index 4d53b515a..4671c579d 100644 --- a/static/partials/repo-list.html +++ b/static/partials/repo-list.html @@ -1,14 +1,22 @@ + -
+ +
+ +
+ + +
Users @@ -28,6 +38,8 @@
+ +
Organizations @@ -46,95 +58,15 @@
+
-
-
-
- - Starred -
-
-
- -
-
-
You haven't starred any repositories yet.
-
Stars allow you to easily access your favorite repositories.
-
-
-
-
-
-
-
-
-
+ +
- +
-
-
-
- - {{ namespace.username }} -
- -
- -
-
-
This namespace doesn't have any viewable repositories.
-
Either no repositories exist yet or you may not have permission to view any. If you have permission, try creating a new repository.
-
-
-
-
-
-
-
-
+
+