diff options
author | Elliot Smith <elliot.smith@intel.com> | 2015-10-05 16:39:36 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-16 14:59:59 +0100 |
commit | 2517987f8db37d50df03e690be2501447b7eeeb8 (patch) | |
tree | a4f5001de4f7e30d77a86ce2bf8135a3789407a6 /bitbake/lib/toaster/toastergui/views.py | |
parent | 56d4c84cec911a9cf44848b0de6e04617fe7d82d (diff) | |
download | poky-2517987f8db37d50df03e690be2501447b7eeeb8.tar.gz |
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 <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index c4264a11a9..e2f2874539 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -1870,10 +1870,15 @@ def image_information_dir(request, build_id, target_id, packagefile_id): | |||
1870 | return redirect(builds) | 1870 | return redirect(builds) |
1871 | # the context processor that supplies data used across all the pages | 1871 | # the context processor that supplies data used across all the pages |
1872 | 1872 | ||
1873 | 1873 | # a context processor which runs on every request; this provides the | |
1874 | # projects and non_cli_projects (i.e. projects created by the user) | ||
1875 | # variables referred to in templates, which used to determine the | ||
1876 | # visibility of UI elements like the "New build" button | ||
1874 | def managedcontextprocessor(request): | 1877 | def managedcontextprocessor(request): |
1878 | projects = Project.objects.all() | ||
1875 | ret = { | 1879 | ret = { |
1876 | "projects": Project.objects.all(), | 1880 | "projects": projects, |
1881 | "non_cli_projects": projects.exclude(is_default=True), | ||
1877 | "DEBUG" : toastermain.settings.DEBUG, | 1882 | "DEBUG" : toastermain.settings.DEBUG, |
1878 | "CUSTOM_IMAGE" : toastermain.settings.CUSTOM_IMAGE, | 1883 | "CUSTOM_IMAGE" : toastermain.settings.CUSTOM_IMAGE, |
1879 | "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH, | 1884 | "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH, |