From 32307aeec84cd5f657cdaa4767ed2f092bcb57aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 28 Aug 2015 16:18:25 +0200 Subject: [PATCH] Bug #3956: Move vm template instantiate html to an hbs file --- .../templates-tab/form-panels/instantiate.js | 44 +++---------------- .../form-panels/instantiate/templateRow.hbs | 40 +++++++++++++++++ 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate/templateRow.hbs diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js index 471fab62ed..cf7917defd 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js @@ -5,6 +5,7 @@ define(function(require) { var BaseFormPanel = require('utils/form-panels/form-panel'); var TemplateHTML = require('hbs!./instantiate/html'); + var TemplateRowHTML = require('hbs!./instantiate/templateRow'); var Sunstone = require('sunstone'); var Notifier = require('utils/notifier'); var OpenNebulaTemplate = require('opennebula/template'); @@ -158,45 +159,10 @@ define(function(require) { timeout: true, success: function (request, template_json) { templatesContext.append( - '

' + - '' + - template_json.VMTEMPLATE.NAME + - '' + - '

'+ - '
'+ - '
' + - '
'+ - '
'+ - '

'+ - ''+ - ' '+ - Locale.tr("Capacity")+ - ''+ - '
'+ - '

'+ - '
'+ - '
'+ - '
'+ - '
'+ - CapacityInputs.html() + - '
' + - '
'+ - '
'+ - '
' + - '
' + - '
'+ - '
' + - '
' + - '
'+ - '
'+ - '
' + - '
' + - '
' + - '
' + - '
'+ - '
'+ - '
' + - '
'); + TemplateRowHTML( + { element: template_json.VMTEMPLATE, + capacityInputsHTML: CapacityInputs.html() + }) ); DisksResize.insert(template_json, $(".disksContext" + template_json.VMTEMPLATE.ID, context)); NicsSection.insert(template_json, $(".nicsContext" + template_json.VMTEMPLATE.ID, context)); diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate/templateRow.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate/templateRow.hbs new file mode 100644 index 0000000000..0877ecf949 --- /dev/null +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate/templateRow.hbs @@ -0,0 +1,40 @@ +

+ + {{element.NAME}} + +

+
+
+
+
+

+ +  {{tr "Capacity"}} + +
+

+
+
+
+
+ {{{capacityInputsHTML}}} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file