From a1347a150af1964a7063d9577497ef5ad11227b8 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 3 Feb 2015 16:05:15 +0000 Subject: bitbake: toaster: All machines Update layer notifications Update layer notifications to the new wording for layer add remove notifications. Fix bug where the the alert area is being removed from the dom on dismiss instead of re-hidden (Bitbake rev: 2a571a4523dbbe9b6afcf2e6b41edf2cb059729d) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/machines.js | 8 ++++++-- bitbake/lib/toaster/toastergui/templates/machines.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/machines.js b/bitbake/lib/toaster/toastergui/static/js/machines.js index a3ea43b..1b7ea36 100644 --- a/bitbake/lib/toaster/toastergui/static/js/machines.js +++ b/bitbake/lib/toaster/toastergui/static/js/machines.js @@ -24,7 +24,7 @@ function machinesPageInit (ctx) { /* If we have added layer dependencies */ if (depsList) { - alertMsg.append("You have added "+(depsList.length+1)+" layers: and its dependencies "); + alertMsg.append("You have added "+(depsList.length+1)+" layers to : and its dependencies "); /* Build the layer deps list */ depsList.map(function(layer, i){ @@ -40,14 +40,18 @@ function machinesPageInit (ctx) { alertMsg.append(link); }); } else { - alertMsg.append("You have added 1 layer: "); + alertMsg.append("You have added 1 layer to : "); } var layerName = addLayerBtn.data('layer-name'); alertMsg.children("#layer-affected-name").text(layerName); + alertMsg.children("#project-affected-name").text(ctx.projectName).attr('href', ctx.projectPageUrl); + $("#alert-area").show(); } + $("#dismiss-alert").click(function(){ $(this).parent().hide() }); + /* Add or remove this layer from the project */ $(".add-layer").click(function() { var btn = $(this); diff --git a/bitbake/lib/toaster/toastergui/templates/machines.html b/bitbake/lib/toaster/toastergui/templates/machines.html index e3329bf..487d6b7 100644 --- a/bitbake/lib/toaster/toastergui/templates/machines.html +++ b/bitbake/lib/toaster/toastergui/templates/machines.html @@ -13,6 +13,7 @@ $(document).ready(function (){ var ctx = { projectPageUrl : "{% url 'project' project.id %}", + projectName : "{{project.name}}", xhrEditProjectUrl : "{% url 'xhr_projectedit' project.id %}", projectId : {{project.id}}, xhrDataTypeaheadUrl : "{% url 'xhr_datatypeahead' %}", @@ -35,9 +36,8 @@ {% include "basetable_top.html" %} -- cgit v1.1