* [review-request][PATCH 1/4] bitbake: toastergui: Machine select button url parameters change
@ 2015-08-06 14:16 Michael Wood
2015-08-06 14:16 ` [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event Michael Wood
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Michael Wood @ 2015-08-06 14:16 UTC (permalink / raw)
To: toaster
Update the url for changing the machine in the project page.
[YOCTO #8113]
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/toaster/toastergui/tables.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 8d5166be..1187244 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -323,7 +323,7 @@ class LayerMachinesTable(MachinesTable):
self.add_column(title="Description",
field_name="description")
- select_btn_template = '<a href="{% url "project" extra.pid %}#/machineselect={{data.name}}" class="btn btn-block select-machine-btn" {% if extra.in_prj == 0%}disabled="disabled"{%endif%}>Select machine</a>'
+ select_btn_template = '<a href="{% url "project" extra.pid %}?setMachine={{data.name}}" class="btn btn-block select-machine-btn" {% if extra.in_prj == 0%}disabled="disabled"{%endif%}>Select machine</a>'
self.add_column(title="Select machine",
static_data_name="add-del-layers",
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event 2015-08-06 14:16 [review-request][PATCH 1/4] bitbake: toastergui: Machine select button url parameters change Michael Wood @ 2015-08-06 14:16 ` Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 3/4] bitbake: toastergui: Fix typo on layers in project filter condition Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism Michael Wood 2 siblings, 0 replies; 6+ messages in thread From: Michael Wood @ 2015-08-06 14:16 UTC (permalink / raw) To: toaster We were attaching this handler before the elements were fully ready in the dom. Which allowed these links although disabled to take users to the change machine page. Signed-off-by: Michael Wood <michael.g.wood@intel.com> --- bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index be6bbcd..d12d3ae 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -202,6 +202,12 @@ function layerDetailsPageInit (ctx) { /* re run the machinesTabShow to update the text */ machinesTabShow(); } + + $(".select-machine-btn").click(function(e){ + if ($(this).attr("disabled") === "disabled") + e.preventDefault(); + }); + }); $("#targets-tab").on('show', targetsTabShow); @@ -385,10 +391,6 @@ function layerDetailsPageInit (ctx) { $(this).parents("form").submit(); }); - $(".select-machine-btn").click(function(e){ - if ($(this).attr("disabled") === "disabled") - e.preventDefault(); - }); layerDepsList.find(".icon-trash").click(layerDepRemoveClick); layerDepsList.find("a").tooltip(); -- 2.1.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [review-request][PATCH 3/4] bitbake: toastergui: Fix typo on layers in project filter condition 2015-08-06 14:16 [review-request][PATCH 1/4] bitbake: toastergui: Machine select button url parameters change Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event Michael Wood @ 2015-08-06 14:16 ` Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism Michael Wood 2 siblings, 0 replies; 6+ messages in thread From: Michael Wood @ 2015-08-06 14:16 UTC (permalink / raw) To: toaster Should be & rather than "and" which was returning the truth'd value of the and condition. [YOCTO #8114] Signed-off-by: Michael Wood <michael.g.wood@intel.com> --- bitbake/lib/toaster/toastergui/tables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 1187244..51fe4b6 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -312,7 +312,7 @@ class LayerMachinesTable(MachinesTable): MachinesTable.setup_queryset(self, *args, **kwargs) self.queryset = self.queryset.filter(layer_version__pk=int(kwargs['layerid'])) - self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) and Q(layercommit=kwargs['layerid'])).count() + self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) & Q(layercommit=kwargs['layerid'])).count() def setup_columns(self, *args, **kwargs): self.add_column(title="Machine", @@ -452,7 +452,7 @@ class LayerRecipesTable(RecipesTable): RecipesTable.setup_queryset(self, *args, **kwargs) self.queryset = self.queryset.filter(layer_version__pk=int(kwargs['layerid'])) - self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) and Q(layercommit=kwargs['layerid'])).count() + self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) & Q(layercommit=kwargs['layerid'])).count() def setup_columns(self, *args, **kwargs): self.add_column(title="Recipe", -- 2.1.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism 2015-08-06 14:16 [review-request][PATCH 1/4] bitbake: toastergui: Machine select button url parameters change Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 3/4] bitbake: toastergui: Fix typo on layers in project filter condition Michael Wood @ 2015-08-06 14:16 ` Michael Wood 2015-08-06 14:57 ` Barros Pena, Belen 2 siblings, 1 reply; 6+ messages in thread From: Michael Wood @ 2015-08-06 14:16 UTC (permalink / raw) To: toaster 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. Signed-off-by: Michael Wood <michael.g.wood@intel.com> --- bitbake/lib/toaster/toastergui/static/js/layerBtn.js | 13 +++++++++++++ bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 8 -------- bitbake/lib/toaster/toastergui/tables.py | 2 +- bitbake/lib/toaster/toastergui/templates/recipe_btn.html | 4 ++-- 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 4243c2b..a0509f9 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) { }); }); + $(".build-recipe-btn").unbind('click'); + $(".build-recipe-btn").click(function(e){ + e.preventDefault(); + var recipe = $(this).data('recipe-name'); + + libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, + libtoaster.ctx.projectId, recipe, + function(){ + /* Success */ + window.location.replace(libtoaster.ctx.projectBuildsUrl); + }); + }); + /* Setup the initial state of the buttons */ 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 d12d3ae..3f5d7a9 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) { /* re run the machinesTabShow to update the text */ targetsTabShow(); } - - $(".build-target-btn").unbind('click'); - $(".build-target-btn").click(function(){ - /* fire a build */ - var target = $(this).data('target-name'); - libtoaster.startABuild(ctx.projectBuildsUrl, libtoaster.ctx.projectId, target, null, null); - window.location.replace(libtoaster.ctx.projectPageUrl); - }); }); $("#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 51fe4b6..810e101 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -465,7 +465,7 @@ class LayerRecipesTable(RecipesTable): field_name="get_description_or_summary") - 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>' + 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>' self.add_column(title="Build recipe", 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 d9ec3fa..77c1b23 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html @@ -1,6 +1,6 @@ -<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;" > +<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;" > Build recipe -</a> +</button> <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"> <i class="icon-plus"></i> Add layer -- 2.1.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism 2015-08-06 14:16 ` [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism Michael Wood @ 2015-08-06 14:57 ` Barros Pena, Belen 2015-08-06 15:44 ` Michael Wood 0 siblings, 1 reply; 6+ messages in thread From: Barros Pena, Belen @ 2015-08-06 14:57 UTC (permalink / raw) To: Wood, Michael G, toaster@yoctoproject.org On 06/08/2015 15:16, "toaster-bounces@yoctoproject.org on behalf of Michael Wood" <toaster-bounces@yoctoproject.org on behalf of michael.g.wood@intel.com> wrote: >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. The whole series looks good to me. Thanks! Belén > >Signed-off-by: Michael Wood <michael.g.wood@intel.com> >--- > bitbake/lib/toaster/toastergui/static/js/layerBtn.js | 13 >+++++++++++++ > bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 8 -------- > bitbake/lib/toaster/toastergui/tables.py | 2 +- > bitbake/lib/toaster/toastergui/templates/recipe_btn.html | 4 ++-- > 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 4243c2b..a0509f9 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) { > }); > }); > >+ $(".build-recipe-btn").unbind('click'); >+ $(".build-recipe-btn").click(function(e){ >+ e.preventDefault(); >+ var recipe = $(this).data('recipe-name'); >+ >+ libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, >+ libtoaster.ctx.projectId, recipe, >+ function(){ >+ /* Success */ >+ window.location.replace(libtoaster.ctx.projectBuildsUrl); >+ }); >+ }); >+ > /* Setup the initial state of the buttons */ > > 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 d12d3ae..3f5d7a9 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) { > /* re run the machinesTabShow to update the text */ > targetsTabShow(); > } >- >- $(".build-target-btn").unbind('click'); >- $(".build-target-btn").click(function(){ >- /* fire a build */ >- var target = $(this).data('target-name'); >- libtoaster.startABuild(ctx.projectBuildsUrl, >libtoaster.ctx.projectId, target, null, null); >- window.location.replace(libtoaster.ctx.projectPageUrl); >- }); > }); > > $("#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 51fe4b6..810e101 100644 >--- a/bitbake/lib/toaster/toastergui/tables.py >+++ b/bitbake/lib/toaster/toastergui/tables.py >@@ -465,7 +465,7 @@ class LayerRecipesTable(RecipesTable): > field_name="get_description_or_summary") > > >- 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>' >+ 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>' > > self.add_column(title="Build recipe", > 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 d9ec3fa..77c1b23 100644 >--- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html >+++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html >@@ -1,6 +1,6 @@ >-<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;" > >+<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;" > > Build recipe >-</a> >+</button> > <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"> > <i class="icon-plus"></i> > Add layer >-- >2.1.4 > >-- >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism 2015-08-06 14:57 ` Barros Pena, Belen @ 2015-08-06 15:44 ` Michael Wood 0 siblings, 0 replies; 6+ messages in thread From: Michael Wood @ 2015-08-06 15:44 UTC (permalink / raw) To: Barros Pena, Belen, toaster@yoctoproject.org Also available as a branch at michaelw/toaster/layerdetails-btns-fix http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=michaelw/toaster/layerdetails-btns-fix On 06/08/15 15:57, Barros Pena, Belen wrote: > > On 06/08/2015 15:16, "toaster-bounces@yoctoproject.org on behalf of > Michael Wood" <toaster-bounces@yoctoproject.org on behalf of > michael.g.wood@intel.com> wrote: > >> 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. > The whole series looks good to me. > > Thanks! > > Belén > >> Signed-off-by: Michael Wood <michael.g.wood@intel.com> >> --- >> bitbake/lib/toaster/toastergui/static/js/layerBtn.js | 13 >> +++++++++++++ >> bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 8 -------- >> bitbake/lib/toaster/toastergui/tables.py | 2 +- >> bitbake/lib/toaster/toastergui/templates/recipe_btn.html | 4 ++-- >> 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 4243c2b..a0509f9 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) { >> }); >> }); >> >> + $(".build-recipe-btn").unbind('click'); >> + $(".build-recipe-btn").click(function(e){ >> + e.preventDefault(); >> + var recipe = $(this).data('recipe-name'); >> + >> + libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, >> + libtoaster.ctx.projectId, recipe, >> + function(){ >> + /* Success */ >> + window.location.replace(libtoaster.ctx.projectBuildsUrl); >> + }); >> + }); >> + >> /* Setup the initial state of the buttons */ >> >> 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 d12d3ae..3f5d7a9 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) { >> /* re run the machinesTabShow to update the text */ >> targetsTabShow(); >> } >> - >> - $(".build-target-btn").unbind('click'); >> - $(".build-target-btn").click(function(){ >> - /* fire a build */ >> - var target = $(this).data('target-name'); >> - libtoaster.startABuild(ctx.projectBuildsUrl, >> libtoaster.ctx.projectId, target, null, null); >> - window.location.replace(libtoaster.ctx.projectPageUrl); >> - }); >> }); >> >> $("#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 51fe4b6..810e101 100644 >> --- a/bitbake/lib/toaster/toastergui/tables.py >> +++ b/bitbake/lib/toaster/toastergui/tables.py >> @@ -465,7 +465,7 @@ class LayerRecipesTable(RecipesTable): >> field_name="get_description_or_summary") >> >> >> - 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>' >> + 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>' >> >> self.add_column(title="Build recipe", >> 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 d9ec3fa..77c1b23 100644 >> --- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html >> +++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html >> @@ -1,6 +1,6 @@ >> -<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;" > >> +<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;" > >> Build recipe >> -</a> >> +</button> >> <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"> >> <i class="icon-plus"></i> >> Add layer >> -- >> 2.1.4 >> >> -- >> _______________________________________________ >> toaster mailing list >> toaster@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/toaster ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-06 15:44 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-08-06 14:16 [review-request][PATCH 1/4] bitbake: toastergui: Machine select button url parameters change Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 2/4] bitbake: toastergui: Move click disabled check after table ready event Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 3/4] bitbake: toastergui: Fix typo on layers in project filter condition Michael Wood 2015-08-06 14:16 ` [review-request][PATCH 4/4] bitbake: toastergui: layerBtn Fix build trigger mechanism Michael Wood 2015-08-06 14:57 ` Barros Pena, Belen 2015-08-06 15:44 ` Michael Wood
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.