mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
bitbake: toaster: base Only show New Build button when there are > 0 projects
Only show new build button if we have defined at least one project as we can't select a project to build against if there are no projects created yet. (Bitbake rev: 6daada59ee846c4e957bba3574dc262a0c79854d) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
49ac18dd0f
commit
152e2d9cc5
@@ -3,10 +3,12 @@
|
|||||||
function basePageInit (ctx) {
|
function basePageInit (ctx) {
|
||||||
|
|
||||||
var newBuildButton = $("#new-build-button");
|
var newBuildButton = $("#new-build-button");
|
||||||
/* Hide the button if we're on the project,newproject or importlyaer page */
|
/* Hide the button if we're on the project,newproject or importlyaer page
|
||||||
if (ctx.currentUrl.search('newproject|project/\\d/$|importlayer/$') > 0){
|
* or if there are no projects yet defined
|
||||||
newBuildButton.hide();
|
*/
|
||||||
return;
|
if (ctx.numProjects == 0 || ctx.currentUrl.search('newproject|project/\\d/$|importlayer/$') > 0){
|
||||||
|
newBuildButton.hide();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -17,6 +19,9 @@ function basePageInit (ctx) {
|
|||||||
|
|
||||||
|
|
||||||
function _checkProjectBuildable(){
|
function _checkProjectBuildable(){
|
||||||
|
if (ctx.projectId == undefined)
|
||||||
|
return;
|
||||||
|
|
||||||
libtoaster.getProjectInfo(ctx.projectInfoUrl, ctx.projectId,
|
libtoaster.getProjectInfo(ctx.projectInfoUrl, ctx.projectId,
|
||||||
function(data){
|
function(data){
|
||||||
if (data.machine.name == undefined || data.layers.length == 0) {
|
if (data.machine.name == undefined || data.layers.length == 0) {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
ctx.projectBuildUrl = "{% url 'xhr_build' %}";
|
ctx.projectBuildUrl = "{% url 'xhr_build' %}";
|
||||||
ctx.projectPageUrl = "{% url 'project' %}";
|
ctx.projectPageUrl = "{% url 'project' %}";
|
||||||
ctx.projectInfoUrl = "{% url 'xhr_projectinfo' %}";
|
ctx.projectInfoUrl = "{% url 'xhr_projectinfo' %}";
|
||||||
|
ctx.numProjects = {{projects|length}};
|
||||||
{% if project %}
|
{% if project %}
|
||||||
ctx.projectId = {{project.id}};
|
ctx.projectId = {{project.id}};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user