Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 60B51E00874; Thu, 22 Sep 2016 09:56:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [209.85.192.182 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4162BE00CB5 for ; Thu, 22 Sep 2016 09:56:26 -0700 (PDT) Received: by mail-pf0-f182.google.com with SMTP id p64so32459375pfb.1 for ; Thu, 22 Sep 2016 09:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xu7+Jx7gzXS6hUW+jfVITmYgFHUDQKl4YIZGYlhZLy4=; b=cxcBnitTBYLB+ur+Mmq3j5HCkTYsOQbCP/KfIXooMcJrhqz2a/DIA6aH24hFp9ytFC 9T8gx/HBcUNsULN5pMAr2WD7WY66DxY3mAjtkk1yhbuLAIvTuPnjorLtZVdh9OgiljV2 RiROsLDQkd+sBWsdLQvpq7o4wAQbMSOjgi20CIwGwWjRWUlAI/v9YU32+JBKwr6q9zQT RFEkYn9OAQwws/ixSTeUBnRD/ERPKLIuBWk1nJ5OEyNms2Qk8zWUzRMKGfIhREW9C1nV IE4loansIkiGIlBmvl5c2x3LdghmUrm7wpt0OytvWEWo11gGHKXVSErl0Gs6QuS9nba5 BRBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xu7+Jx7gzXS6hUW+jfVITmYgFHUDQKl4YIZGYlhZLy4=; b=PLkFkIEurLeIATvZl0zyul0qwxBNP+GdMwPjAASJtRwh8v+0fM/5+tnBFyOy/4//5p Bw9g/KEVN8tqpgDP6lgxThUwm/rRK2pLY66bw68ateLnkhx4cbc+3SgdeEVqiqKywasl hJAXezklf9uAAnPgxhqG07Doc32sMmdSv2kKBVHSguFCNtwBVzSIdZQN5etRrutx7IXD 8Xwo3jOHliOLu8ojWKmUYl2a9lBnFHC3fJo+v+ieWmlaeMOrnC7+R3c+c7jPtIiGCD53 IcaPViBcowwp01ZRuWJSm4zsiQ4VKQRxQQXaOyaZV2A3RQZZ4t1tJfclUQbEQGKnqsmA iHwQ== X-Gm-Message-State: AE9vXwO1tyAaGF/XlGUu8HhCwa23tE1oFEe9fKdgNIV9bqM7Z2JQW74BQyj8N9OBHuRMksb9 X-Received: by 10.98.38.4 with SMTP id m4mr4926892pfm.47.1474563385762; Thu, 22 Sep 2016 09:56:25 -0700 (PDT) Received: from orion.ger.corp.intel.com ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id uj8sm5458889pab.5.2016.09.22.09.56.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 09:56:24 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 22 Sep 2016 17:55:54 +0100 Message-Id: <1474563354-11878-11-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474563354-11878-1-git-send-email-michael.g.wood@intel.com> References: <1474563354-11878-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 10/10] toaster: layerdetails Update implementation of delete imported layer X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 16:56:44 -0000 Update the implementation of delete an imported layer so that it is consistent with the other delete messages and wording. Also use the new libtoaster way of setting a notification that the delete was successful. Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/api.py | 2 +- bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 7 +++++-- bitbake/lib/toaster/toastergui/templates/layerdetails.html | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py index 149abf7..3a05d66 100644 --- a/bitbake/lib/toaster/toastergui/api.py +++ b/bitbake/lib/toaster/toastergui/api.py @@ -221,7 +221,7 @@ class XhrLayer(View): return JsonResponse({ "error": "ok", - "redirect": reverse('project', args=(kwargs['pid'],)) + "gotoUrl": reverse('project', args=(kwargs['pid'],)) }) diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index 8165bad..4c0d042 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -391,7 +391,9 @@ function layerDetailsPageInit (ctx) { }); $("#layer-delete-confirmed").click(function(){ - $.cookie("layer-deleted", ctx.layerVersion.name, { path: '/'}); + + var message = $('You have deleted 1 layer from your project: '); + message.find("#deleted-layer-name").text(ctx.layerVersion.name); $.ajax({ type: "DELETE", @@ -401,7 +403,8 @@ function layerDetailsPageInit (ctx) { if (data.error != "ok") { console.warn(data.error); } else { - window.location = data.redirect + "?notify=layer-deleted"; + libtoaster.setNotification("layer-deleted", message.html()); + window.location.replace(data.gotoUrl); } }, error: function(data) { diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/bitbake/lib/toaster/toastergui/templates/layerdetails.html index 0594b55..f1569bd 100644 --- a/bitbake/lib/toaster/toastergui/templates/layerdetails.html +++ b/bitbake/lib/toaster/toastergui/templates/layerdetails.html @@ -6,14 +6,16 @@ {% block title %} {{layerversion.layer.name}} - {{project.name}} - Toaster {% endblock %} {% block pagecontent %} -