From 08f006a90cab43d85437266990cb929da197123f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 5 Mar 2015 14:21:46 -0500 Subject: [PATCH] Add the namespaces box to the right hand side and make other small UI improvements to the repo list view --- static/css/directives/repo-list-grid.css | 6 ++- static/css/pages/repo-list.css | 26 +++++++++++ static/directives/repo-list-grid.html | 5 +- static/js/directives/ui/repo-list-grid.js | 17 +++++-- static/js/pages/repo-list.js | 4 ++ static/partials/repo-list.html | 56 +++++++++++++---------- 6 files changed, 81 insertions(+), 33 deletions(-) create mode 100644 static/css/pages/repo-list.css diff --git a/static/css/directives/repo-list-grid.css b/static/css/directives/repo-list-grid.css index 301905e11..f4cb56e05 100644 --- a/static/css/directives/repo-list-grid.css +++ b/static/css/directives/repo-list-grid.css @@ -105,10 +105,8 @@ .new-repo-listing { display: block; - border-bottom: 1px solid #eee; font-size: 14px; line-height: normal; - padding-bottom: 30px; } .new-repo-listing .description { @@ -129,3 +127,7 @@ .repo-list-grid { padding-top: 10px; } + +.repo-list-title .avatar { + margin-right: 10px; +} diff --git a/static/css/pages/repo-list.css b/static/css/pages/repo-list.css new file mode 100644 index 000000000..c92110fc1 --- /dev/null +++ b/static/css/pages/repo-list.css @@ -0,0 +1,26 @@ +.repo-list .repo-list-panel { + padding: 20px; + padding-top: 0px; +} + +.repo-list .repo-list-namespaces h4 { + margin: 6px; + margin-bottom: 20px; +} + +.repo-list .namespaces-list { + margin: 20px; + padding: 0px; + margin-bottom: 0px; +} + +.repo-list .namespaces-list li { + list-style: none; + margin: 4px; + margin-bottom: 10px; + font-size: 16px; +} + +.repo-list .namespaces-list li .avatar { + margin-right: 10px; +} diff --git a/static/directives/repo-list-grid.html b/static/directives/repo-list-grid.html index 223027c62..0a93c2d56 100644 --- a/static/directives/repo-list-grid.html +++ b/static/directives/repo-list-grid.html @@ -8,8 +8,9 @@
- {{ namespace.name }} - {{ namespace.name }} + {{ namespace.name }} + {{ namespace.name }}
diff --git a/static/js/directives/ui/repo-list-grid.js b/static/js/directives/ui/repo-list-grid.js index ae4d8ab81..7dddc5e1c 100644 --- a/static/js/directives/ui/repo-list-grid.js +++ b/static/js/directives/ui/repo-list-grid.js @@ -1,11 +1,12 @@ /** * An element that displays a list of repositories in a grid. - * */ -angular.module('quay').directive('repoListGrid', function() { - return { - templateUrl: '/static/directives/repo-list-grid.html', +angular.module('quay').directive('repoListGrid', function () { + var directiveDefinitionObject = { priority: 0, + templateUrl: '/static/directives/repo-list-grid.html', + replace: false, + transclude: true, restrict: 'C', scope: { repositories: '=repositories', @@ -14,5 +15,11 @@ angular.module('quay').directive('repoListGrid', function() { namespace: '=namespace', toggleStar: '&toggleStar' }, + controller: function($scope, $element, UserService) { + $scope.isOrganization = function(namespace) { + return !!UserService.getOrganization(namespace); + }; + } }; -}); + return directiveDefinitionObject; +}); \ No newline at end of file diff --git a/static/js/pages/repo-list.js b/static/js/pages/repo-list.js index dae52e501..0a0f9509d 100644 --- a/static/js/pages/repo-list.js +++ b/static/js/pages/repo-list.js @@ -46,6 +46,10 @@ } }); + $scope.isOrganization = function(namespace) { + return !!UserService.getOrganization(namespace); + }; + // Star a repository or unstar a repository. $scope.toggleStar = function(repo) { if (repo.is_starred) { diff --git a/static/partials/repo-list.html b/static/partials/repo-list.html index 73a24b0d9..45473349c 100644 --- a/static/partials/repo-list.html +++ b/static/partials/repo-list.html @@ -1,4 +1,4 @@ -
+
Repositories @@ -9,6 +9,8 @@
+ +
-
-
-
  • -
  • - -
  • - -
    - -
    - - -
    - - -
    - - -
    -
    + +
    +
    +
    +

    Users and Organizations

    +
    -
    -
    -
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +