Make sure to show public repos on the user and orgs pages
This commit is contained in:
parent
2d8237bd83
commit
4cb7921c3a
6 changed files with 23 additions and 8 deletions
|
@ -832,7 +832,7 @@ def get_visible_repository_count(username=None, include_public=True,
|
||||||
|
|
||||||
|
|
||||||
def get_visible_repositories(username=None, include_public=True, page=None,
|
def get_visible_repositories(username=None, include_public=True, page=None,
|
||||||
limit=None, sort=False, namespace=None):
|
limit=None, sort=False, namespace=None, namespace_only=False):
|
||||||
query = _visible_repository_query(username=username, include_public=include_public, page=page,
|
query = _visible_repository_query(username=username, include_public=include_public, page=page,
|
||||||
limit=limit, namespace=namespace,
|
limit=limit, namespace=namespace,
|
||||||
select_models=[Repository, Namespace, Visibility])
|
select_models=[Repository, Namespace, Visibility])
|
||||||
|
@ -843,6 +843,9 @@ def get_visible_repositories(username=None, include_public=True, page=None,
|
||||||
if limit:
|
if limit:
|
||||||
query = query.limit(limit)
|
query = query.limit(limit)
|
||||||
|
|
||||||
|
if namespace and namespace_only:
|
||||||
|
query = query.where(Namespace.username == namespace)
|
||||||
|
|
||||||
return query
|
return query
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,8 @@ class RepositoryList(ApiResource):
|
||||||
@query_param('sort', 'Whether to sort the results.', type=truthy_bool, default=False)
|
@query_param('sort', 'Whether to sort the results.', type=truthy_bool, default=False)
|
||||||
@query_param('count', 'Whether to include a count of the total number of results available.',
|
@query_param('count', 'Whether to include a count of the total number of results available.',
|
||||||
type=truthy_bool, default=False)
|
type=truthy_bool, default=False)
|
||||||
|
@query_param('namespace_only', 'Whether to limit only to the given namespace.',
|
||||||
|
type=truthy_bool, default=False)
|
||||||
def get(self, args):
|
def get(self, args):
|
||||||
"""Fetch the list of repositories under a variety of situations."""
|
"""Fetch the list of repositories under a variety of situations."""
|
||||||
username = None
|
username = None
|
||||||
|
@ -129,7 +131,8 @@ class RepositoryList(ApiResource):
|
||||||
|
|
||||||
repo_query = model.get_visible_repositories(username, limit=args['limit'], page=args['page'],
|
repo_query = model.get_visible_repositories(username, limit=args['limit'], page=args['page'],
|
||||||
include_public=args['public'], sort=args['sort'],
|
include_public=args['public'], sort=args['sort'],
|
||||||
namespace=args['namespace'])
|
namespace=args['namespace'],
|
||||||
|
namespace_only=args['namespace_only'])
|
||||||
def repo_view(repo_obj):
|
def repo_view(repo_obj):
|
||||||
repo = {
|
repo = {
|
||||||
'namespace': repo_obj.namespace_user.username,
|
'namespace': repo_obj.namespace_user.username,
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-view .user-repo-list {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.user-view h3 {
|
.user-view h3 {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
|
|
|
@ -31,9 +31,7 @@
|
||||||
|
|
||||||
var loadRepositories = function() {
|
var loadRepositories = function() {
|
||||||
var options = {
|
var options = {
|
||||||
'public': false,
|
'namespace_only': true,
|
||||||
'private': true,
|
|
||||||
'sort': true,
|
|
||||||
'namespace': orgname,
|
'namespace': orgname,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,8 @@
|
||||||
|
|
||||||
var loadRepositories = function() {
|
var loadRepositories = function() {
|
||||||
var options = {
|
var options = {
|
||||||
'public': false,
|
|
||||||
'private': true,
|
|
||||||
'sort': true,
|
'sort': true,
|
||||||
|
'namespace_only': true,
|
||||||
'namespace': username,
|
'namespace': username,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,15 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cor-tab-panel">
|
<div class="co-main-content-panel user-repo-list" ng-if="!user.is_me">
|
||||||
|
<div class="repo-list-grid"
|
||||||
|
repositories-resource="repositoriesResource"
|
||||||
|
starred="false"
|
||||||
|
namespace="namespace"
|
||||||
|
hide-title="true"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cor-tab-panel" ng-if="user.is_me">
|
||||||
<div class="cor-tabs" quay-show="user.is_me">
|
<div class="cor-tabs" quay-show="user.is_me">
|
||||||
<span class="cor-tab" tab-active="true" tab-title="Repositories" tab-target="#repos">
|
<span class="cor-tab" tab-active="true" tab-title="Repositories" tab-target="#repos">
|
||||||
<i class="fa fa-hdd-o"></i>
|
<i class="fa fa-hdd-o"></i>
|
||||||
|
|
Reference in a new issue