diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/projectapp.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js index 94c24f4a56..741038df27 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js +++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js | |||
@@ -578,18 +578,31 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc | |||
578 | if (!imported) | 578 | if (!imported) |
579 | return; | 579 | return; |
580 | 580 | ||
581 | if (imported.layersAdded.length == 0) { | 581 | if (imported.deps_added.length == 0) { |
582 | text = "You have imported <strong>"+imported.name+ | 582 | text = "You have imported <strong><a href=\""+$scope.urls.layer+ |
583 | "</strong> and added it to your project."; | 583 | imported.imported_layer.id+"\">"+imported.imported_layer.name+ |
584 | "</a></strong> and added it to your project."; | ||
584 | } else { | 585 | } else { |
585 | text = "You have imported <strong>"+imported.name+ | 586 | var links = "<a href=\""+$scope.urls.layer+ |
586 | "</strong> and added <strong>"+imported.layersAdded.length+ | 587 | imported.imported_layer.id+"\">"+imported.imported_layer.name+ |
587 | "</strong> layers to your project. <strong>"+ | 588 | "</a>, "; |
588 | imported.layersAdded.join(", ")+"</strong>"; | 589 | |
590 | imported.deps_added.map (function(item, index){ | ||
591 | links +="<a href=\""+$scope.urls.layer+item.id+"\" >"+item.name+ | ||
592 | "</a>"; | ||
593 | /*If we're at the last element we don't want the trailing comma */ | ||
594 | if (imported.deps_added[index+1] != undefined) | ||
595 | links += ", "; | ||
596 | }); | ||
597 | |||
598 | /* Length + 1 here to do deps + the imported layer */ | ||
599 | text = "You have imported <strong><a href=\""+$scope.urls.layer+ | ||
600 | imported.imported_layer.id+"\">"+imported.imported_layer.name+ | ||
601 | "</a></strong> and added <strong>"+(imported.deps_added.length+1)+ | ||
602 | "</strong> layers to your project. <strong>"+links+"</strong>"; | ||
589 | } | 603 | } |
590 | 604 | ||
591 | $scope.displayAlert($scope.zone2alerts, text, "alert-info"); | 605 | $scope.displayAlert($scope.zone2alerts, text, "alert-info"); |
592 | |||
593 | // This doesn't work | 606 | // This doesn't work |
594 | $cookieStore.remove("layer-imported-alert"); | 607 | $cookieStore.remove("layer-imported-alert"); |
595 | //use jquery plugin instead | 608 | //use jquery plugin instead |