]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: All machines Update layer notifications
authorMichael Wood <michael.g.wood@intel.com>
Tue, 3 Feb 2015 16:05:15 +0000 (16:05 +0000)
committerAlexandru DAMIAN <alexandru.damian@intel.com>
Mon, 9 Feb 2015 17:54:34 +0000 (17:54 +0000)
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

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
lib/toaster/toastergui/static/js/machines.js
lib/toaster/toastergui/templates/machines.html

index a3ea43baed188fa15811ec8bc8640e4c1bcc5162..1b7ea3689315e0569ce628f4206f15cb7183ff6e 100644 (file)
@@ -24,7 +24,7 @@ function machinesPageInit (ctx) {
 
     /* If we have added layer dependencies */
     if (depsList) {
-      alertMsg.append("You have added <strong>"+(depsList.length+1)+"</strong> layers: <span id=\"layer-affected-name\"></span> and its dependencies ");
+      alertMsg.append("You have added <strong>"+(depsList.length+1)+"</strong> layers to <a id=\"project-affected-name\"></a>: <span id=\"layer-affected-name\"></span> 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 <strong>1</strong> layer: <span id=\"layer-affected-name\"></span>");
+      alertMsg.append("You have added <strong>1</strong> layer to <a id=\"project-affected-name\"></a>: <strong id=\"layer-affected-name\"></strong>");
     }
 
     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);
index e3329bf238a1c6b95e071a0a2146941af6e60158..487d6b73c129583dcf1cafa23117c59ab9e84afb 100644 (file)
@@ -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 @@
 </div>
 
 <div class="alert alert-info lead" id="alert-area" style="display:none">
-  <button type="button" class="close" id="dismiss-alert" data-dismiss="alert">&times;</button>
+  <button type="button" class="close" id="dismiss-alert">&times;</button>
   <span id="alert-msg"></span>
-  <p style="margin-top:10px;"><a href="{% url 'project' project.id %}">Go to project configuration</a></p>
 </div>
 
 {% include "basetable_top.html" %}