summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-12-10 14:52:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:19 +0000
commit6d9f342e12150db8480730bcdf397a7c7b7ac1f2 (patch)
treed100a207bbff0cefde4eb66fb26d230f328be7ab /bitbake
parent76c000801415597975724978d42763f4ac573c50 (diff)
downloadpoky-6d9f342e12150db8480730bcdf397a7c7b7ac1f2.tar.gz
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 <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py3
-rw-r--r--bitbake/lib/toaster/toastergui/templates/customise_btn.html14
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):
583 583
584 def setup_queryset(self, *args, **kwargs): 584 def setup_queryset(self, *args, **kwargs):
585 super(ImageRecipesTable, self).setup_queryset(*args, **kwargs) 585 super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
586 prj = Project.objects.get(pk = kwargs['pid'])
587 self.static_context_extra['current_layers'] = \
588 prj.get_project_layer_versions(pk=True)
586 589
587 self.queryset = self.queryset.filter(is_image=True) 590 self.queryset = self.queryset.filter(is_image=True)
588 591
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 @@
1<button class="btn btn-block layer-exists-{{data.layer_version.id}} customise-btn" style="display:none;" data-recipe="{{data.id}}"> 1<button class="btn btn-block layer-exists-{{data.layer_version.pk}} customise-btn" data-recipe="{{data.pk}}"
2 {% if data.layer_version.pk not in extra.current_layers %}
3 style="display:none;"
4 {% endif %}
5 >
2 Customise 6 Customise
3</button> 7</button>
4 8<button class="btn btn-block layer-add-{{data.layer_version.pk}} layerbtn" data-layer='{ "id": {{data.layer_version.pk}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add"
5<button class="btn btn-block layer-add-{{data.layer_version.id}} layerbtn" data-layer='{ "id": {{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{% url 'layerdetails' extra.pid data.layer_version.id %}"}' data-directive="add"> 9 {% if data.layer_version.pk in extra.current_layers %}
10 style="display:none;"
11 {% endif %}
12 >
6 <i class="icon-plus"></i> 13 <i class="icon-plus"></i>
7 Add layer 14 Add layer
8</button> 15</button>
9