[oe-commits] [bitbake] 03/09: toaster: ui handles duplicate project name in project page
git at git.openembedded.org
git at git.openembedded.org
Wed May 11 10:32:58 UTC 2016
rpurdie pushed a commit to branch python3
in repository bitbake.
commit 05ddf48cda6690adab4c097b16387578523e751b
Author: Sujith H <sujith.h at gmail.com>
AuthorDate: Tue May 10 00:01:50 2016 +0100
toaster: ui handles duplicate project name in project page
When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name. When an existing project is typed the save
button will be disabled. Else user can proceed ahead by
modifying the project name.
[YOCTO #7005]
Signed-off-by: Sujith H <sujith.h at gmail.com>
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/toaster/toastergui/static/js/projecttopbar.js | 7 +++++++
lib/toaster/toastergui/templates/projecttopbar.html | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/toaster/toastergui/static/js/projecttopbar.js b/lib/toaster/toastergui/static/js/projecttopbar.js
index b09f974..f0cd18b 100644
--- a/lib/toaster/toastergui/static/js/projecttopbar.js
+++ b/lib/toaster/toastergui/static/js/projecttopbar.js
@@ -25,6 +25,7 @@ function projectTopBarInit(ctx) {
e.preventDefault();
projectNameForm.hide();
projectNameContainer.fadeIn();
+ $("#project-name-change-input").val(projectName.text());
});
$("#project-name-change-btn").click(function(){
@@ -87,4 +88,10 @@ function projectTopBarInit(ctx) {
window.location.replace(libtoaster.ctx.projectBuildsUrl);
}, null);
});
+
+ /* Call makeProjectNameValidation function */
+ libtoaster.makeProjectNameValidation($("#project-name-change-input"),
+ $("#hint-error-project-name"), $("#validate-project-name"),
+ $("#project-name-change-btn"));
+
}
diff --git a/lib/toaster/toastergui/templates/projecttopbar.html b/lib/toaster/toastergui/templates/projecttopbar.html
index 007de06..e878cab 100644
--- a/lib/toaster/toastergui/templates/projecttopbar.html
+++ b/lib/toaster/toastergui/templates/projecttopbar.html
@@ -33,11 +33,12 @@
{% endif %}
</h1>
<form id="project-name-change-form" style="margin-bottom: 0px; display: none;">
- <div class="input-append">
+ <div class="input-append" id="validate-project-name">
<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>
+ <p class="help-block error" style="display: none;margin-top: 10px;" id="hint-error-project-name">A project with this name exists. Project names must be unique.</p>
</form>
</div>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list