Skip to contentSkip to conversation

toaster: fix custom image name form

PATCH New Belen Barros Pena 1 participant 2 messages Feb 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toaster: fix custom image name form

From: Belen Barros Pena <[email protected]>

The placeholder text in the form where you name your new custom images didn't display fully. This patch fixes the styles so that the text shows properly. It also changes the text itself to make it a bit shorter.

[YOCTO #9122]

---
 bitbake/lib/toaster/toastergui/static/css/default.css              | 2 +-
 bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/toaster/toastergui/static/css/default.css +1 -1
index b674a9d..c5a580f 100644
@@ -197,7 +197,7 @@ table p { margin-bottom: 0 }
 .configuration-alert p { margin-bottom: 0px; }
 .project-form { margin-top: 10px; }
 .add-layers .btn-block + .btn-block, .build .btn-block + .btn-block { margin-top: 0px; }
-input.huge { font-size: 17.5px; padding: 11px 19px; }
+input.huge { font-size: 17.5px; padding: 11px; min-width: 60%; }
 .build-form { margin-bottom: 0px; }
 .build-form .input-append { margin-bottom: 0px; }
 .build-form .btn-large { padding: 11px 35px; }
bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html +1 -1
index fed489f..b1b5148 100644
@@ -22,7 +22,7 @@
       <span class="help-block span8">Image names must be unique. They should not contain spaces or capital letters, and the only allowed special character is dash (-).<p></p>
       </span></div>
     <div class="control-group controls">
-      <input type="text" class="huge span5" placeholder="Type the name, something like 'core-image-myimage'" required>
+      <input type="text" class="huge" placeholder="Type the custom image name" required>
         <span class="help-block error" id="invalid-name-help" style="display:none"></span>
       </div>
     </div>
Signature · 1 line
2.5.4 (Apple Git-61)
#1 lore raw

PATCH 2/2 toaster: apply error class to name field

From: Belen Barros Pena <[email protected]>

The form for naming new custom images shows you an error message when the name already exists or you include an invalid character in it. But when an error appears, the input field was missing the red hihglight.

This patch applies the right class to the form controls whenever an error message is shown.

---
 bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 3 +++
 1 file changed, 3 insertions(+)
bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +3 -0
index 0b9d31a..328997a 100644
@@ -36,6 +36,7 @@ function newCustomImageModalInit(){
   function showError(text){
     invalidNameHelp.text(text);
     invalidNameHelp.show();
+    nameInput.parent().addClass('error');
   }
 
   nameInput.on('keyup', function(){
@@ -47,9 +48,11 @@ function newCustomImageModalInit(){
     if (nameInput.val().search(/[^a-z|0-9|-]/) != -1){
       showError(invalidMsg);
       newCustomImgBtn.prop("disabled", true);
+      nameInput.parent().addClass('error');
     } else {
       invalidNameHelp.hide();
       newCustomImgBtn.prop("disabled", false);
+      nameInput.parent().removeClass('error');
     }
   });
 }
Signature · 1 line
2.5.4 (Apple Git-61)