diff options
-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 | ||