Explorar o código

Record the source project display name, to render with the file

Shane Kilkelly %!s(int64=8) %!d(string=hai) anos
pai
achega
9624e2a290

+ 3 - 3
services/web/app/views/project/editor/binary-file.pug

@@ -52,9 +52,9 @@ div.binary-file.full-size(
 				i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
 				| Imported from
 				|
-				a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}')
-					| {{ displayUrl(openFile.linkedFileData.source_project_id) }}
-				|  / {{ openFile.linkedFileData.source_entity_path.slice(1) }},
+				a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}' target="_blank")
+					| {{ openFile.linkedFileData.source_project_display_name }}
+				|  {{ openFile.linkedFileData.source_entity_path.slice(1) }},
 				|
 				| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}
 

+ 6 - 4
services/web/public/coffee/ide/file-tree/controllers/FileTreeController.coffee

@@ -302,17 +302,19 @@ define [
 			$timeout($scope.init, 100)
 
 			$scope.create = () ->
-				project = $scope.data.selectedProjectId
+				projectId = $scope.data.selectedProjectId
+				projectDisplayName = _.find($scope.data.projects, (p) -> p._id == projectId).name
 				path = $scope.data.selectedProjectEntity
 				name = $scope.data.name
-				if !name || !path || !project
+				if !name || !path || !projectId || !projectDisplayName
 					$scope._reset(err: true)
 					return
 				$scope._setInFlight('create')
 				ide.fileTreeManager
 					.createLinkedFile(name, parent_folder, 'project_file', {
-						source_project_id: project,
-						source_entity_path: path
+						source_project_id: projectId,
+						source_entity_path: path,
+						source_project_display_name: projectDisplayName
 					})
 					.then () ->
 						$scope._reset(err: false)