summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-04-19 17:28:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-19 21:11:26 +0100
commit1cf8f215b3543ce0f39ebd3321d58cfb518f1c1f (patch)
treeac2ec1be24db0eb3f845d53cfa7ce6c18c36ab70 /bitbake/lib/toaster/toastergui/views.py
parenta40a3e6defefd69521a417a366b8752be7e778f9 (diff)
downloadpoky-1cf8f215b3543ce0f39ebd3321d58cfb518f1c1f.tar.gz
bitbake: toaster: add modal to select custom image for editing
Add functionality to the placeholder button on the build dashboard to open a modal dialog displaying editable custom images, in cases where multiple custom images were built by the build. Where there is only one editable custom image, go direct to its edit page. The images shown in the modal are custom recipes for the project which were built during the build shown in the dashboard. This also affects the new custom image dialog, as that also has to show custom image recipes as well as image recipes built during the build. Modify the API on the Build object to support both. Also modify and rename the queryset_to_list template filter so that it can deal with lists as well as querysets, as the new custom image modal has to show a list of image recipes which is an amalgam of two querysets. [YOCTO #9123] (Bitbake rev: 8c2aea3fa8e1071de60390e86e2536904fa9b7c0) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 942dc31ae9..bd5bf63341 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -507,6 +507,7 @@ def builddashboard( request, build_id ):
507 507
508 context = { 508 context = {
509 'build' : build, 509 'build' : build,
510 'project' : build.project,
510 'hasImages' : hasImages, 511 'hasImages' : hasImages,
511 'ntargets' : ntargets, 512 'ntargets' : ntargets,
512 'targets' : targets, 513 'targets' : targets,
@@ -797,6 +798,7 @@ eans multiple licenses exist that cover different parts of the source',
797 context = { 798 context = {
798 'objectname': variant, 799 'objectname': variant,
799 'build' : build, 800 'build' : build,
801 'project' : build.project,
800 'target' : Target.objects.filter( pk = target_id )[ 0 ], 802 'target' : Target.objects.filter( pk = target_id )[ 0 ],
801 'objects' : packages, 803 'objects' : packages,
802 'packages_sum' : packages_sum[ 'installed_size__sum' ], 804 'packages_sum' : packages_sum[ 'installed_size__sum' ],
@@ -937,7 +939,10 @@ def dirinfo(request, build_id, target_id, file_path=None):
937 if head != sep: 939 if head != sep:
938 dir_list.insert(0, head) 940 dir_list.insert(0, head)
939 941
940 context = { 'build': Build.objects.get(pk=build_id), 942 build = Build.objects.get(pk=build_id)
943
944 context = { 'build': build,
945 'project': build.project,
941 'target': Target.objects.get(pk=target_id), 946 'target': Target.objects.get(pk=target_id),
942 'packages_sum': packages_sum['installed_size__sum'], 947 'packages_sum': packages_sum['installed_size__sum'],
943 'objects': objects, 948 'objects': objects,
@@ -1211,6 +1216,7 @@ def tasks_common(request, build_id, variant, task_anchor):
1211 'filter_search_display': filter_search_display, 1216 'filter_search_display': filter_search_display,
1212 'mainheading': title_variant, 1217 'mainheading': title_variant,
1213 'build': build, 1218 'build': build,
1219 'project': build.project,
1214 'objects': task_objects, 1220 'objects': task_objects,
1215 'default_orderby' : default_orderby, 1221 'default_orderby' : default_orderby,
1216 'search_term': search_term, 1222 'search_term': search_term,
@@ -1282,6 +1288,7 @@ def recipes(request, build_id):
1282 context = { 1288 context = {
1283 'objectname': 'recipes', 1289 'objectname': 'recipes',
1284 'build': build, 1290 'build': build,
1291 'project': build.project,
1285 'objects': recipes, 1292 'objects': recipes,
1286 'default_orderby' : 'name:+', 1293 'default_orderby' : 'name:+',
1287 'recipe_deps' : deps, 1294 'recipe_deps' : deps,
@@ -1366,10 +1373,12 @@ def configuration(request, build_id):
1366 'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU') 1373 'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU')
1367 context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\ 1374 context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\
1368 .values_list('variable_name', 'variable_value')) 1375 .values_list('variable_name', 'variable_value'))
1376 build = Build.objects.get(pk=build_id)
1369 context.update({'objectname': 'configuration', 1377 context.update({'objectname': 'configuration',
1370 'object_search_display':'variables', 1378 'object_search_display':'variables',
1371 'filter_search_display':'variables', 1379 'filter_search_display':'variables',
1372 'build': Build.objects.get(pk=build_id), 1380 'build': build,
1381 'project': build.project,
1373 'targets': Target.objects.filter(build=build_id)}) 1382 'targets': Target.objects.filter(build=build_id)})
1374 return render(request, template, context) 1383 return render(request, template, context)
1375 1384
@@ -1406,12 +1415,15 @@ def configvars(request, build_id):
1406 file_filter += '/bitbake.conf' 1415 file_filter += '/bitbake.conf'
1407 build_dir=re.sub("/tmp/log/.*","",Build.objects.get(pk=build_id).cooker_log_path) 1416 build_dir=re.sub("/tmp/log/.*","",Build.objects.get(pk=build_id).cooker_log_path)
1408 1417
1418 build = Build.objects.get(pk=build_id)
1419
1409 context = { 1420 context = {
1410 'objectname': 'configvars', 1421 'objectname': 'configvars',
1411 'object_search_display':'BitBake variables', 1422 'object_search_display':'BitBake variables',
1412 'filter_search_display':'variables', 1423 'filter_search_display':'variables',
1413 'file_filter': file_filter, 1424 'file_filter': file_filter,
1414 'build': Build.objects.get(pk=build_id), 1425 'build': build,
1426 'project': build.project,
1415 'objects' : variables, 1427 'objects' : variables,
1416 'total_count':queryset_with_search.count(), 1428 'total_count':queryset_with_search.count(),
1417 'default_orderby' : 'variable_name:+', 1429 'default_orderby' : 'variable_name:+',
@@ -1480,6 +1492,7 @@ def bpackage(request, build_id):
1480 context = { 1492 context = {
1481 'objectname': 'packages built', 1493 'objectname': 'packages built',
1482 'build': build, 1494 'build': build,
1495 'project': build.project,
1483 'objects' : packages, 1496 'objects' : packages,
1484 'default_orderby' : 'name:+', 1497 'default_orderby' : 'name:+',
1485 'tablecols':[ 1498 'tablecols':[
@@ -1554,7 +1567,12 @@ def bpackage(request, build_id):
1554def bfile(request, build_id, package_id): 1567def bfile(request, build_id, package_id):
1555 template = 'bfile.html' 1568 template = 'bfile.html'
1556 files = Package_File.objects.filter(package = package_id) 1569 files = Package_File.objects.filter(package = package_id)
1557 context = {'build': Build.objects.get(pk=build_id), 'objects' : files} 1570 build = Build.objects.get(pk=build_id)
1571 context = {
1572 'build': build,
1573 'project': build.project,
1574 'objects' : files
1575 }
1558 return render(request, template, context) 1576 return render(request, template, context)
1559 1577
1560 1578