bitbake: toastergui: project page Add inline project name change feature

This feature allows the project name to be changed from where ever it is
displayed in the project pages.

[YOCTO #7329]

(Bitbake rev: 81cb1cd1aa900f29a25d14dce93d301cd6b6fdb7)

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>
This commit is contained in:
Michael Wood 2015-07-31 15:09:23 +03:00 committed by Richard Purdie
parent c76137e25b
commit 829fe32621
2 changed files with 39 additions and 1 deletions

View File

@ -5,6 +5,10 @@ function basePageInit(ctx) {
var newBuildButton = $("#new-build-button");
var newBuildTargetInput;
var newBuildTargetBuildBtn;
var projectNameForm = $("#project-name-change-form");
var projectName = $("#project-name");
var projectNameFormToggle = $("#project-change-form-toggle");
var projectNameChangeCancel = $("#project-name-change-cancel");
/* initially the current project is used unless overridden by the new build
* button in top right nav
@ -16,6 +20,31 @@ function basePageInit(ctx) {
var newBuildProjectInput = $("#new-build-button #project-name-input");
var newBuildProjectSaveBtn = $("#new-build-button #save-project-button");
/* Project name change functionality */
projectNameFormToggle.click(function(e){
e.preventDefault();
$(this).add(projectName).hide();
projectNameForm.fadeIn();
});
projectNameChangeCancel.click(function(e){
e.preventDefault();
projectNameForm.hide();
projectName.add(projectNameFormToggle).fadeIn();
});
$("#project-name-change-btn").click(function(e){
var newProjectName = $("#project-name-change-input").val();
libtoaster.editCurrentProject({ projectName: newProjectName },function (){
projectName.text(newProjectName);
libtoaster.ctx.projectName = newProjectName;
projectNameChangeCancel.click();
});
});
_checkProjectBuildable();

View File

@ -5,7 +5,16 @@
<!-- project name -->
<div class="row-fluid page-header">
<h1>{{project.name}}</h1>
<h1><span id="project-name">{{project.name}}</span>
<i class="icon-pencil" data-original-title="" id="project-change-form-toggle" title=""></i>
</h1>
<form id="project-name-change-form" style="margin-bottom: 0px; display: none;">
<div class="input-append">
<input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}">
<button id="project-name-change-btn" class="btn btn-large" type="button">Save</button>
<a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a>
</div>
</form>
</div>
<div class="row-fluid" id="project-topbar">