From 486fe19bc16343cd360cbf2fe5b73d3318fb4c88 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 13 Jan 2012 20:00:13 +0100 Subject: [PATCH] SelfService: small fixes Add checkboxes to compute creation resource selects. Add ids next to the checkboxes names. Hitting return now submits instead of closing the creation dialogs. Treat the case when description is undefined. (cherry picked from commit 8d18227865885970ffc305a442b46f1eab14f3b9) --- .../occi/lib/ui/public/js/plugins/compute.js | 16 ++++++++++++---- .../occi/lib/ui/public/js/plugins/network.js | 4 ++-- .../occi/lib/ui/public/js/plugins/storage.js | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index fb64497c31..aaab2fc1c4 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -93,8 +93,8 @@ var create_vm_tmpl ='
\ \ \
\ - \ - \ + \ + \ \
\ \ @@ -695,6 +695,10 @@ function popUpCreateVMDialog(){ ); $('#network_box',dialog).html(net_select); + $('#network_box option',dialog).each(function(){ + $(this).text('☐ '+$(this).text()+' (id:'+$(this).val()+')'); + }); + var image_select = makeSelectOptions(dataTable_images, 1,//id_col @@ -704,6 +708,10 @@ function popUpCreateVMDialog(){ true); $('#disk_box',dialog).html(image_select); + $('#disk_box option',dialog).each(function(){ + $(this).text('☐ '+$(this).text()+' (id:'+$(this).val()+')'); + }); + $('#network_box,#disk_box',dialog).change(function(){ $(this).val(""); @@ -713,11 +721,11 @@ function popUpCreateVMDialog(){ $('#network_box option,#disk_box option',dialog).click(function(){ var clicked = $(this).attr('clicked'); if (clicked){//unbold, unmark - $(this).text($(this).text().replace(/✓/g,'')); + $(this).text($(this).text().replace(/☒/g,'☐')); $(this).removeAttr('clicked'); } else {//bold,mark - $(this).text("✓"+$(this).text()); + $(this).text($(this).text().replace(/☐/g,'☒')); $(this).attr('clicked','clicked'); } return false; diff --git a/src/cloud/occi/lib/ui/public/js/plugins/network.js b/src/cloud/occi/lib/ui/public/js/plugins/network.js index 436b040939..257eb9cf04 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/network.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/network.js @@ -53,8 +53,8 @@ var create_vn_tmpl =
\ \
\ - \ - \ + \ + \ \
\
\ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index d6fbfe10d9..5b7f768d40 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -92,8 +92,8 @@ var create_image_tmpl =
\ -->\
\ - \ - \ + \ + \ \
\ \ @@ -369,7 +369,7 @@ function updateImageInfo(request,img){ \ \ '+tr("Description")+'\ - '+img_info.DESCRIPTION+'\ + '+(img_info.DESCRIPTION ? img_info.DESCRIPTION : "--")+'\ \ \ '+tr("Type")+'\