summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2014-12-08 15:29:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-18 10:24:07 +0000
commitc89fd793986878a426ebc96d4df22257252f8934 (patch)
tree7ed799e63af850a5d0df3e8d0125e3024cac4ed3 /bitbake/lib/toaster/toastergui/static
parent8d96256c39f2c31209ec1f8fe06b96d3b59b403c (diff)
downloadpoky-c89fd793986878a426ebc96d4df22257252f8934.tar.gz
bitbake: toaster: projectapp Add links to the imported layers notify
Adds links to layer details for each of the layers that has been added to the project. (Bitbake rev: 07e5c7c82519604501feb7d892db330c610978e9) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/importlayer.js3
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectapp.js29
2 files changed, 22 insertions, 10 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 34dbcd9ed7..5748efd8ce 100644
--- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -152,9 +152,8 @@ function importLayerPageInit (ctx) {
152 show_error_message(data, layerData); 152 show_error_message(data, layerData);
153 console.log(data.error); 153 console.log(data.error);
154 } else { 154 } else {
155 layerData.layersAdded = data.layers_added;
156 /* Success layer import now go to the project page */ 155 /* Success layer import now go to the project page */
157 $.cookie('layer-imported-alert', JSON.stringify(layerData), { path: '/'}); 156 $.cookie('layer-imported-alert', JSON.stringify(data), { path: '/'});
158 window.location.replace(ctx.projectPageUrl+'#/layerimported'); 157 window.location.replace(ctx.projectPageUrl+'#/layerimported');
159 } 158 }
160 }, 159 },
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