Add the namespaces box to the right hand side and make other small UI improvements to the repo list view

This commit is contained in:
Joseph Schorr 2015-03-05 14:21:46 -05:00
parent 785de61c59
commit 08f006a90c
6 changed files with 81 additions and 33 deletions

View file

@ -105,10 +105,8 @@
.new-repo-listing { .new-repo-listing {
display: block; display: block;
border-bottom: 1px solid #eee;
font-size: 14px; font-size: 14px;
line-height: normal; line-height: normal;
padding-bottom: 30px;
} }
.new-repo-listing .description { .new-repo-listing .description {
@ -129,3 +127,7 @@
.repo-list-grid { .repo-list-grid {
padding-top: 10px; padding-top: 10px;
} }
.repo-list-title .avatar {
margin-right: 10px;
}

View file

@ -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;
}

View file

@ -8,8 +8,9 @@
</div> </div>
<div ng-if="!starred" class="repo-list-title"> <div ng-if="!starred" class="repo-list-title">
<span class="avatar" size="24" hash="namespace.avatar"></span> <span class="avatar" size="24" hash="namespace.avatar"></span>
<a ng-if="user.username == namespace.name">{{ namespace.name }}</a> <span ng-if="!isOrganization(namespace.name)">{{ namespace.name }}</span>
<a ng-if="user.username != namespace.name" href="/organization/{{ namespace.name }}">{{ namespace.name }}</a> <a ng-if="isOrganization(namespace.name)"
href="/organization/{{ namespace.name }}">{{ namespace.name }}</a>
</div> </div>
<!-- Repositories --> <!-- Repositories -->

View file

@ -1,11 +1,12 @@
/** /**
* An element that displays a list of repositories in a grid. * An element that displays a list of repositories in a grid.
*
*/ */
angular.module('quay').directive('repoListGrid', function() { angular.module('quay').directive('repoListGrid', function () {
return { var directiveDefinitionObject = {
templateUrl: '/static/directives/repo-list-grid.html',
priority: 0, priority: 0,
templateUrl: '/static/directives/repo-list-grid.html',
replace: false,
transclude: true,
restrict: 'C', restrict: 'C',
scope: { scope: {
repositories: '=repositories', repositories: '=repositories',
@ -14,5 +15,11 @@ angular.module('quay').directive('repoListGrid', function() {
namespace: '=namespace', namespace: '=namespace',
toggleStar: '&toggleStar' toggleStar: '&toggleStar'
}, },
controller: function($scope, $element, UserService) {
$scope.isOrganization = function(namespace) {
return !!UserService.getOrganization(namespace);
}; };
}
};
return directiveDefinitionObject;
}); });

View file

@ -46,6 +46,10 @@
} }
}); });
$scope.isOrganization = function(namespace) {
return !!UserService.getOrganization(namespace);
};
// Star a repository or unstar a repository. // Star a repository or unstar a repository.
$scope.toggleStar = function(repo) { $scope.toggleStar = function(repo) {
if (repo.is_starred) { if (repo.is_starred) {

View file

@ -1,4 +1,4 @@
<div class="page-content"> <div class="repo-list page-content">
<div class="cor-title"> <div class="cor-title">
<span class="cor-title-link"></span> <span class="cor-title-link"></span>
<span class="cor-title-content">Repositories</span> <span class="cor-title-content">Repositories</span>
@ -9,6 +9,8 @@
</a> </a>
</span> </span>
</div> </div>
<!-- Not signed in -->
<div class="co-main-content-panel" ng-if="user.anonymous" > <div class="co-main-content-panel" ng-if="user.anonymous" >
<!-- The user is not logged in --> <!-- The user is not logged in -->
<div class="cor-container signin-container row"> <div class="cor-container signin-container row">
@ -21,20 +23,28 @@
</div> </div>
</div> </div>
<div class="cor-tab-panel" ng-if="!user.anonymous" > <!-- Signed in -->
<div class="cor-tabs"> <div class="row" ng-if="!user.anonymous">
<li class="cor-tab"><i class="fa fa-star starred"></i></li> <div class="col-lg-3 col-lg-push-9 col-md-3 col-md-push-9 col-sm-12">
<li class="cor-tab" ng-repeat="namespace in namespaces"> <div class="co-main-content-panel repo-list-namespaces">
<span class="avatar" size="36" hash="namespace.avatar"></span> <h4>Users and Organizations</h4>
<ul class="namespaces-list">
<li ng-repeat="namespace in namespaces">
<span ng-if="!isOrganization(namespace.name)">
<span class="avatar" size="30" hash="namespace.avatar"></span>
{{ namespace.name }}
</span>
<a href="/organization/{{ namespace.name }}" ng-if="isOrganization(namespace.name)">
<span class="avatar" size="30" hash="namespace.avatar"></span>
{{ namespace.name }}
</a>
</li> </li>
</ul>
</div>
</div>
</div> <!-- /cor-tabs --> <div class="col-lg-9 col-lg-pull-3 col-md-9 col-md-pull-3 col-sm-12">
<div class="repo-list-panel co-main-content-panel">
<div class="cor-tab-content">
<!-- The user is logged in -->
<div ng-if="!user.anonymous">
<!-- Starred Repository Listing --> <!-- Starred Repository Listing -->
<div class="repo-list-grid" repositories="starred_repositories.value" starred="true" toggle-star="toggleStar(repository)"></div> <div class="repo-list-grid" repositories="starred_repositories.value" starred="true" toggle-star="toggleStar(repository)"></div>
@ -42,12 +52,10 @@
<div ng-repeat="namespace in namespaces"> <div ng-repeat="namespace in namespaces">
<div class="repo-list-grid" repositories="namespace.repositories.value" starred="false" user="user" namespace="namespace" toggle-star="toggleStar(repository)"></div> <div class="repo-list-grid" repositories="namespace.repositories.value" starred="false" user="user" namespace="namespace" toggle-star="toggleStar(repository)"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>