Slightly better repo list screen
This commit is contained in:
parent
6bcb5cfcaa
commit
685479da7b
4 changed files with 32 additions and 4 deletions
|
@ -43,10 +43,13 @@ def create_repo_api():
|
|||
@login_required
|
||||
def list_repos_api():
|
||||
def repo_view(repo_perm):
|
||||
|
||||
|
||||
return {
|
||||
'namespace': repo_perm.repository.namespace,
|
||||
'name': repo_perm.repository.name,
|
||||
'role': repo_perm.role.name,
|
||||
'description': repo_perm.repository.description,
|
||||
}
|
||||
|
||||
repos = [repo_view(repo)
|
||||
|
@ -131,6 +134,7 @@ def list_repo_permissions(namespace, repository):
|
|||
|
||||
abort(403) # Permission denied
|
||||
|
||||
|
||||
@app.route('/api/repository/<path:repository>/permissions/<username>',
|
||||
methods=['PUT'])
|
||||
@login_required
|
||||
|
@ -144,4 +148,4 @@ def change_permissions(namespace, repository, username):
|
|||
'setting_permission_to': [permission_view(repo_perm) for repo_perm in repo_perms]
|
||||
})
|
||||
|
||||
abort(403) # Permission denied
|
||||
abort(403) # Permission denied
|
||||
|
|
|
@ -74,4 +74,27 @@ p.editable:hover i {
|
|||
padding: 4px;
|
||||
border: 1px solid #ddd;
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.repo-listing {
|
||||
display: block;
|
||||
margin-bottom: 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.repo-listing a {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.repo-listing i {
|
||||
font-size: 1.5em;
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.repo-listing .description {
|
||||
margin-top: 6px;
|
||||
padding-left: 36px;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<div class="container">
|
||||
<h3>Repositories</h3>
|
||||
<div ng-repeat="repository in repositories">
|
||||
<div class="repo-listing" ng-repeat="repository in repositories">
|
||||
<i class="icon-hdd icon-large"></i>
|
||||
<a ng-href="#/repository/{{repository.namespace}}/{{ repository.name }}">{{repository.namespace}}/{{repository.name}}</a>
|
||||
<div class="description">{{repository.description}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
|
||||
<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">{{ user.username }} <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Settings</a></li>
|
||||
<li><a href="/signout">Sign out</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
Reference in a new issue