summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-07-31 15:09:03 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:26:11 +0100
commitb06a633f25aec303e867c6109fb97d63d9ee1f73 (patch)
treee8cb117fa87f50114d63fa1104804abeb0708433 /bitbake/lib/toaster/toastergui/static
parent3d3a2dbf5fc10773bb18ab7fb00f3db254139f47 (diff)
downloadpoky-b06a633f25aec303e867c6109fb97d63d9ee1f73.tar.gz
bitbake: toastergui: Implement new project navigation
Change the structure of the project page to include a navigation menu and top tab navigation. Remove old breadcrumb method. [YOCTO #7329] (Bitbake rev: 66fa0dd988e01ec79e74be7a5697eaa3b4f017d8) 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/lib/toaster/toastergui/static')
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/default.css1
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/base.js54
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/layerdetails.js13
3 files changed, 51 insertions, 17 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css
index da78f47f85..072a71d834 100644
--- a/bitbake/lib/toaster/toastergui/static/css/default.css
+++ b/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -179,7 +179,6 @@ table { table-layout: fixed; word-wrap: break-word; }
179.well-alert > .lead { color: #C09853; padding-bottom: .75em; } 179.well-alert > .lead { color: #C09853; padding-bottom: .75em; }
180.configuration-alert { margin-bottom: 0px; padding: 8px 14px; } 180.configuration-alert { margin-bottom: 0px; padding: 8px 14px; }
181.configuration-alert p { margin-bottom: 0px; } 181.configuration-alert p { margin-bottom: 0px; }
182fieldset { padding-left: 19px; }
183.project-form { margin-top: 10px; } 182.project-form { margin-top: 10px; }
184.add-layers .btn-block + .btn-block, .build .btn-block + .btn-block { margin-top: 0px; } 183.add-layers .btn-block + .btn-block, .build .btn-block + .btn-block { margin-top: 0px; }
185input.huge { font-size: 17.5px; padding: 11px 19px; } 184input.huge { font-size: 17.5px; padding: 11px 19px; }
diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js
index f1711c134f..6fd77ea457 100644
--- a/bitbake/lib/toaster/toastergui/static/js/base.js
+++ b/bitbake/lib/toaster/toastergui/static/js/base.js
@@ -3,33 +3,57 @@
3function basePageInit(ctx) { 3function basePageInit(ctx) {
4 4
5 var newBuildButton = $("#new-build-button"); 5 var newBuildButton = $("#new-build-button");
6 /* Hide the button if we're on the project,newproject or importlyaer page 6 var newBuildTargetInput;
7 var newBuildTargetBuildBtn;
8
9 var selectedProject = libtoaster.ctx;
10 var selectedTarget;
11
12 var newBuildProjectInput = $("#new-build-button #project-name-input");
13 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button");
14
15 $("#config-nav .nav li a").each(function(){
16 if (window.location.pathname === $(this).attr('href'))
17 $(this).parent().addClass('active');
18 else
19 $(this).parent().removeClass('active');
20 });
21
22 if ($(".total-builds").length !== 0){
23 libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl, function(prjInfo){
24 if (prjInfo.builds)
25 $(".total-builds").text(prjInfo.builds.length);
26 });
27 }
28
29 /* Hide the button if we're on the project,newproject or importlyaer page
7 * or if there are no projects yet defined 30 * or if there are no projects yet defined
31 * only show if there isn't already a build-target-input already
8 */ 32 */
9 if (ctx.numProjects === 0 || ctx.currentUrl.search('newproject|project/\\d$|importlayer$') > 0) { 33 if (ctx.numProjects > 0 &&
10 newBuildButton.hide(); 34 ctx.currentUrl.search('newproject') < 0 &&
35 $(".build-target-input").length === 1) {
36
37 newBuildTargetInput = $("#new-build-button .build-target-input");
38 newBuildTargetBuildBtn = $("#new-build-button .build-button");
39
40 newBuildButton.show();
41 _setupNewBuildButton();
42 } else if ($(".build-target-input").length > 0) {
43 newBuildTargetInput = $("#project-topbar .build-target-input");
44 newBuildTargetBuildBtn = $("#project-topbar .build-button");
45 } else {
11 return; 46 return;
12 } 47 }
13 48
14 var selectedProject = libtoaster.ctx;
15 var selectedTarget;
16 49
17 /* Hide the change project icon when there is only one project */ 50 /* Hide the change project icon when there is only one project */
18 if (ctx.numProjects === 1) { 51 if (ctx.numProjects === 1) {
19 $('#project .icon-pencil').hide(); 52 $('#project .icon-pencil').hide();
20 } 53 }
21 54
22 newBuildButton.show().removeAttr("disabled");
23
24
25 var newBuildProjectInput = $("#new-build-button #project-name-input");
26 var newBuildTargetBuildBtn = $("#new-build-button #build-button");
27 var newBuildTargetInput = $("#new-build-button #build-target-input");
28 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button");
29
30 55
31 _checkProjectBuildable(); 56 _checkProjectBuildable();
32 _setupNewBuildButton();
33 57
34 58
35 function _checkProjectBuildable() { 59 function _checkProjectBuildable() {
@@ -57,8 +81,6 @@ function basePageInit(ctx) {
57 selectedProject.projectName = item.name; 81 selectedProject.projectName = item.name;
58 selectedProject.projectId = item.id; 82 selectedProject.projectId = item.id;
59 selectedProject.projectBuildsUrl = item.projectBuildsUrl; 83 selectedProject.projectBuildsUrl = item.projectBuildsUrl;
60
61
62 }); 84 });
63 85
64 } 86 }
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
index 0accd971d4..e522373b3f 100644
--- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -15,6 +15,19 @@ function layerDetailsPageInit (ctx) {
15 layerDepBtn.removeAttr("disabled"); 15 layerDepBtn.removeAttr("disabled");
16 }); 16 });
17 17
18 $(".breadcrumb li:first a").click(function(e){
19 /* By default this link goes to the project configuration page. However
20 * if we have some builds we go there instead of the default href
21 */
22 libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl, function(prjInfo){
23 if (prjInfo.builds && prjInfo.builds.length > 0) {
24 window.location.replace(libtoaster.ctx.projectBuildsUrl);
25 e.preventDefault();
26 return;
27 }
28 });
29 });
30
18 function addRemoveDep(depLayerId, add, doneCb) { 31 function addRemoveDep(depLayerId, add, doneCb) {
19 var data = { layer_version_id : ctx.layerVersion.id }; 32 var data = { layer_version_id : ctx.layerVersion.id };
20 if (add) 33 if (add)