diff options
author | Sujith H <sujith.h@gmail.com> | 2016-05-10 00:01:50 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-11 11:32:58 +0100 |
commit | 7e2d5017be4e988df893a36976029b1ea51031f4 (patch) | |
tree | 15be0925c5f0e112bb904327126f8eab05e64677 /bitbake/lib/toaster/toastergui | |
parent | dc57476d0b6c2c4cb8868b48058e78c24c065217 (diff) | |
download | poky-7e2d5017be4e988df893a36976029b1ea51031f4.tar.gz |
bitbake: 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]
(Bitbake rev: 05ddf48cda6690adab4c097b16387578523e751b)
Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projecttopbar.js | 7 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/projecttopbar.html | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js b/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js index b09f974e47..f0cd18bf48 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js +++ b/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js | |||
@@ -25,6 +25,7 @@ function projectTopBarInit(ctx) { | |||
25 | e.preventDefault(); | 25 | e.preventDefault(); |
26 | projectNameForm.hide(); | 26 | projectNameForm.hide(); |
27 | projectNameContainer.fadeIn(); | 27 | projectNameContainer.fadeIn(); |
28 | $("#project-name-change-input").val(projectName.text()); | ||
28 | }); | 29 | }); |
29 | 30 | ||
30 | $("#project-name-change-btn").click(function(){ | 31 | $("#project-name-change-btn").click(function(){ |
@@ -87,4 +88,10 @@ function projectTopBarInit(ctx) { | |||
87 | window.location.replace(libtoaster.ctx.projectBuildsUrl); | 88 | window.location.replace(libtoaster.ctx.projectBuildsUrl); |
88 | }, null); | 89 | }, null); |
89 | }); | 90 | }); |
91 | |||
92 | /* Call makeProjectNameValidation function */ | ||
93 | libtoaster.makeProjectNameValidation($("#project-name-change-input"), | ||
94 | $("#hint-error-project-name"), $("#validate-project-name"), | ||
95 | $("#project-name-change-btn")); | ||
96 | |||
90 | } | 97 | } |
diff --git a/bitbake/lib/toaster/toastergui/templates/projecttopbar.html b/bitbake/lib/toaster/toastergui/templates/projecttopbar.html index 007de06ffb..e878caba8b 100644 --- a/bitbake/lib/toaster/toastergui/templates/projecttopbar.html +++ b/bitbake/lib/toaster/toastergui/templates/projecttopbar.html | |||
@@ -33,11 +33,12 @@ | |||
33 | {% endif %} | 33 | {% endif %} |
34 | </h1> | 34 | </h1> |
35 | <form id="project-name-change-form" style="margin-bottom: 0px; display: none;"> | 35 | <form id="project-name-change-form" style="margin-bottom: 0px; display: none;"> |
36 | <div class="input-append"> | 36 | <div class="input-append" id="validate-project-name"> |
37 | <input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}"> | 37 | <input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}"> |
38 | <button id="project-name-change-btn" class="btn btn-large" type="button">Save</button> | 38 | <button id="project-name-change-btn" class="btn btn-large" type="button">Save</button> |
39 | <a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a> | 39 | <a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a> |
40 | </div> | 40 | </div> |
41 | <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> | ||
41 | </form> | 42 | </form> |
42 | </div> | 43 | </div> |
43 | 44 | ||