[bitbake-devel] [PATCH 2/5] toaster: ui handles duplicate project name in new project page

Michael Wood michael.g.wood at intel.com
Mon May 9 23:01:49 UTC 2016


From: Sujith H <sujith.h at gmail.com>

When already existing project name is typed by user,
the ui pops up message regarding the existance of 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>
---
 lib/toaster/toastergui/templates/newproject.html | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/toaster/toastergui/templates/newproject.html b/lib/toaster/toastergui/templates/newproject.html
index e83b2be..8913057 100644
--- a/lib/toaster/toastergui/templates/newproject.html
+++ b/lib/toaster/toastergui/templates/newproject.html
@@ -19,9 +19,12 @@
         <div class="span6">
         <form method="POST">{% csrf_token %}
 
-            <fieldset>
+            <fieldset id="validate-project-name">
               <label>Project name <span class="muted">(required)</span></label>
-              <input type="text" class="input-xlarge" required id="new-project-name" name="projectname">
+              <div>
+                <input type="text" class="input-xlarge" required id="new-project-name" name="projectname">
+                <p class="help-block error" style="display: none;" id="hint-error-project-name">A project with this name exists. Project names must be unique.</p>
+              </div>
             </fieldset>
 <!--
             <fieldset>
@@ -113,6 +116,11 @@
                 $('#description-' + new_release).fadeIn();
             });
 
+            libtoaster.makeProjectNameValidation($("#new-project-name"),
+                 $("#hint-error-project-name"), $("#validate-project-name"),
+                 $(".btn-primary"));
+
+
 /*			// Hide the project release when you select an analysis project
 			function projectType() {
 				if ($("input[type='radio']:checked").val() == 'build') {
-- 
2.7.4




More information about the bitbake-devel mailing list