show user role on the project list page

This commit is contained in:
xiahaoshawn 2016-05-26 12:31:03 +08:00
parent 55d1b075f3
commit f6e9827ed4
2 changed files with 12 additions and 2 deletions

View File

@ -11,6 +11,13 @@
function ProjectController($scope, ListProjectService, $timeout, currentUser) {
var vm = this;
vm.MAP = {
0: 'NA',
1: 'Project Admin',
2: 'Developer',
3: 'Guest'
};
vm.isOpen = false;
vm.projectName = '';
vm.publicity = 0;
@ -35,6 +42,9 @@
}
function listProjectSuccess(data, status) {
data.forEach(function(data){
data.role = vm.MAP[data.role_id];
});
vm.projects = data;
}

View File

@ -32,8 +32,8 @@
<tbody>
<tr ng-repeat="p in vm.projects">
<td><a href="/ng/repository#/repositories?project_id=//p.ProjectId//&is_public=//p.Public//">//p.Name//</a></td>
<td>N/A</td>
<td>N/A</td>
<td>//p.count//</td>
<td>//p.role//</td>
<td>//p.CreationTime | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
<td><publicity-button is-public="p.Public" owned="p.OwnerId == vm.user.UserId" project-id="p.ProjectId"></publicity-button></td>
</tr>