From 6d9f342e12150db8480730bcdf397a7c7b7ac1f2 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 10 Dec 2015 14:52:22 +0000 Subject: bitbake: toaster: tables Check layer presence in project for customise_btn Make sure we send the current list of layers to the customise button to be able to know whether it should be set as an add layer button or a customise button on the New custom image page. (Bitbake rev: 5ddb35c98b609d85f97d482b54cabe3a2812afe6) Signed-off-by: Michael Wood Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/tables.py | 3 +++ .../lib/toaster/toastergui/templates/customise_btn.html | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index d80b90254a..ba2726d070 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -583,6 +583,9 @@ class NewCustomImagesTable(ImageRecipesTable): def setup_queryset(self, *args, **kwargs): super(ImageRecipesTable, self).setup_queryset(*args, **kwargs) + prj = Project.objects.get(pk = kwargs['pid']) + self.static_context_extra['current_layers'] = \ + prj.get_project_layer_versions(pk=True) self.queryset = self.queryset.filter(is_image=True) diff --git a/bitbake/lib/toaster/toastergui/templates/customise_btn.html b/bitbake/lib/toaster/toastergui/templates/customise_btn.html index 54d05f9ea6..2e54a9d905 100644 --- a/bitbake/lib/toaster/toastergui/templates/customise_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/customise_btn.html @@ -1,9 +1,15 @@ - - - - -- cgit v1.2.3-54-g00ecf