From 2517987f8db37d50df03e690be2501447b7eeeb8 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Mon, 5 Oct 2015 16:39:36 +0100 Subject: bitbake: toaster: Modify "New build" button behaviour for cli builds project The "New build" button should only be displayed if there are user-generated projects, not if there is only the command-line builds project. (Toaster can't run builds on behalf of the command-line builds project.) The "New build" form should also display as if no project has been set (i.e. show the project and recipe text entries). Add a variable which tracks the number of non-command-line projects, then use this to hide the button when appropriate. Also track whether the current project is the default one, and use this to add extra conditions to when the "New build" text entries are shown. [YOCTO #8231] (Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8) Signed-off-by: Elliot Smith Signed-off-by: Ed Bartosh Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/templates/base.html | 95 +++++++++++----------- 1 file changed, 49 insertions(+), 46 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/templates/base.html') diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html index 3f277909d7..c1d0693066 100644 --- a/bitbake/lib/toaster/toastergui/templates/base.html +++ b/bitbake/lib/toaster/toastergui/templates/base.html @@ -38,6 +38,7 @@ projectId : {{project.id}}, projectPageUrl : {% url 'project' project.id as purl %}{{purl|json}}, projectName : {{project.name|json}}, + projectIsDefault: {% if project.is_default %}true{% else %}false{% endif %}, recipesTypeAheadUrl: {% url 'xhr_recipestypeahead' project.id as paturl%}{{paturl|json}}, layersTypeAheadUrl: {% url 'xhr_layerstypeahead' project.id as paturl%}{{paturl|json}}, machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}}, @@ -48,7 +49,7 @@ projectId : undefined, projectPageUrl : undefined, projectName : undefined, - projectId : undefined, + projectIsDefault: false, {% endif %} }; @@ -122,52 +123,54 @@ - - + {% endif %} -- cgit v1.2.3-54-g00ecf