diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 722d0b73b4..359d0ddeb4 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -395,19 +395,27 @@ module.exports = ProjectController = return model _buildV1ProjectViewModel: (project) -> - { + projectViewModel = { id: project.id name: project.title lastUpdated: new Date(project.updated_at * 1000) # Convert from epoch - accessLevel: if project.owner?.user_is_owner then "owner" else "readOnly" archived: project.removed || project.archived - owner: { - # Unlisted V1 projects don't have an owner, so just show N/A - first_name: if project.owner then project.owner.name else 'N/A' - last_name: '' - } isV1Project: true } + if (project.owner? and project.owner.user_is_owner) or (project.creator? and project.creator.user_is_creator) + projectViewModel.accessLevel = "owner" + else + projectViewModel.accessLevel = "readOnly" + if project.owner? + projectViewModel.owner = { + first_name: project.owner.name + } + else if project.creator? + projectViewModel.owner = { + first_name: project.creator.name + } + return projectViewModel + _injectProjectOwners: (projects, callback = (error, projects) ->) -> users = {} diff --git a/services/web/public/coffee/main/project-list/project-list.coffee b/services/web/public/coffee/main/project-list/project-list.coffee index 75d4767ec0..5880129294 100644 --- a/services/web/public/coffee/main/project-list/project-list.coffee +++ b/services/web/public/coffee/main/project-list/project-list.coffee @@ -480,9 +480,9 @@ define [ if $scope.project.accessLevel == "owner" return "You" else if $scope.project.owner? - return "#{$scope.project.owner.first_name} #{$scope.project.owner.last_name}" + return [$scope.project.owner.first_name, $scope.project.owner.last_name].filter((n) -> n?).join(" ") else - return "?" + return "None" $scope.$watch "project.selected", (value) -> if value?