Redo the landing page to:
- Show the user's top repos if they have any - Show a link to the guide and the repos list if they do not - Add a getting starting guide - Redo the repos list to show the user's repos and the top 10 public repos separately
This commit is contained in:
parent
f12ed9859c
commit
927b280f1a
9 changed files with 220 additions and 23 deletions
|
@ -125,10 +125,25 @@ def list_repos_api():
|
|||
'name': repo_obj.name,
|
||||
'description': repo_obj.description,
|
||||
}
|
||||
|
||||
limit = request.args.get('limit', None)
|
||||
include_public = request.args.get('public', 'true')
|
||||
include_private = request.args.get('private', 'true')
|
||||
sort = request.args.get('sort', 'false')
|
||||
|
||||
username = current_user.db_user.username if current_user.is_authenticated() else None
|
||||
try:
|
||||
limit = int(limit) if limit else None
|
||||
except:
|
||||
limit = None
|
||||
|
||||
include_public = include_public == 'true'
|
||||
include_private = include_private == 'true'
|
||||
sort = sort == 'true'
|
||||
|
||||
username = current_user.db_user.username if current_user.is_authenticated() and include_private else None
|
||||
repos = [repo_view(repo)
|
||||
for repo in model.get_visible_repositories(username)]
|
||||
for repo in model.get_visible_repositories(
|
||||
username, limit = limit, include_public = include_public, sort = sort)]
|
||||
response = {
|
||||
'repositories': repos
|
||||
}
|
||||
|
|
Reference in a new issue