diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-08-06 19:23:49 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-06 16:04:50 -0500 |
commit | 58197f345b203f55de202f8c91129e3d381359ed (patch) | |
tree | fd9aa5eb5cfe8927efe073ba750b6d475fbc2d55 /bitbake | |
parent | a65099eec3df428f33308a12611262f00ba90f56 (diff) | |
download | poky-58197f345b203f55de202f8c91129e3d381359ed.tar.gz |
bitbake: toastergui: layerBtn Fix build trigger mechanism
The new project page is no longer responsible for triggering the build so
add a handler for this in layerBtn which is used in the layerdetails and
layers pages. This also removes the conflicting and redundant handler
for this in the layerdetails.
(Bitbake rev: b4c389443bdd121121fd1d1a9006a9f1f63f186f)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
4 files changed, 16 insertions, 11 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js index 4243c2bf01..a0509f9aa3 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js | |||
@@ -55,6 +55,19 @@ function layerBtnsInit(ctx) { | |||
55 | }); | 55 | }); |
56 | }); | 56 | }); |
57 | 57 | ||
58 | $(".build-recipe-btn").unbind('click'); | ||
59 | $(".build-recipe-btn").click(function(e){ | ||
60 | e.preventDefault(); | ||
61 | var recipe = $(this).data('recipe-name'); | ||
62 | |||
63 | libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, | ||
64 | libtoaster.ctx.projectId, recipe, | ||
65 | function(){ | ||
66 | /* Success */ | ||
67 | window.location.replace(libtoaster.ctx.projectBuildsUrl); | ||
68 | }); | ||
69 | }); | ||
70 | |||
58 | /* Setup the initial state of the buttons */ | 71 | /* Setup the initial state of the buttons */ |
59 | 72 | ||
60 | for (var i in ctx.projectLayers){ | 73 | for (var i in ctx.projectLayers){ |
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index d9ba687354..000e8038f6 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js | |||
@@ -179,14 +179,6 @@ function layerDetailsPageInit (ctx) { | |||
179 | /* re run the machinesTabShow to update the text */ | 179 | /* re run the machinesTabShow to update the text */ |
180 | targetsTabShow(); | 180 | targetsTabShow(); |
181 | } | 181 | } |
182 | |||
183 | $(".build-target-btn").unbind('click'); | ||
184 | $(".build-target-btn").click(function(){ | ||
185 | /* fire a build */ | ||
186 | var target = $(this).data('target-name'); | ||
187 | libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, target, null, null); | ||
188 | window.location.replace(libtoaster.ctx.projectPageUrl); | ||
189 | }); | ||
190 | }); | 182 | }); |
191 | 183 | ||
192 | $("#machinestable").on('table-done', function(e, total, tableParams){ | 184 | $("#machinestable").on('table-done', function(e, total, tableParams){ |
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 1af9c0bd90..92e3b5c667 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
@@ -438,7 +438,7 @@ class LayerRecipesTable(RecipesTable): | |||
438 | field_name="get_description_or_summary") | 438 | field_name="get_description_or_summary") |
439 | 439 | ||
440 | 440 | ||
441 | build_recipe_template ='<button class="btn btn-block build-target-btn" data-target-name="{{data.name}}" {%if extra.in_prj == 0 %}disabled="disabled"{%endif%}>Build recipe</button>' | 441 | build_recipe_template ='<button class="btn btn-block build-recipe-btn" data-recipe-name="{{data.name}}" {%if extra.in_prj == 0 %}disabled="disabled"{%endif%}>Build recipe</button>' |
442 | 442 | ||
443 | self.add_column(title="Build recipe", | 443 | self.add_column(title="Build recipe", |
444 | static_data_name="add-del-layers", | 444 | static_data_name="add-del-layers", |
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html index d9ec3faec1..77c1b235b9 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html | |||
@@ -1,6 +1,6 @@ | |||
1 | <a href="{% url 'project' extra.pid %}#/targetbuild={{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.pk}}" style="display:none; margin-top: 5px;" > | 1 | <button data-recipe-name="{{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.pk}} build-recipe-btn" style="display:none; margin-top: 5px;" > |
2 | Build recipe | 2 | Build recipe |
3 | </a> | 3 | </button> |
4 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.pk}}" 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"> | 4 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.pk}}" 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 | <i class="icon-plus"></i> | 5 | <i class="icon-plus"></i> |
6 | Add layer | 6 | Add layer |