The branch, develop has been updated
Old revision: e7bdd7f5626aebb8e8e6a4783122d90918052ff6, new revision: 31f993c45f8331b427e4c8e1da9525313f4b8077.
via 31f993c45f8331b427e4c8e1da9525313f4b8077 (commit)
via 68c94d4e587160a35d6fec3f498720468cc784eb (commit)
via 55c14e7c81d9fda798be1d02ab007c9f5efd33d9 (commit)
via dcf12cdce3634f6d5bfb27468a3a149f7d9d803c (commit)
from e7bdd7f5626aebb8e8e6a4783122d90918052ff6 (commit)
- Log -----------------------------------------------------------------
commit 31f993c45f8331b427e4c8e1da9525313f4b8077
Merge: e7bdd7f 68c94d4
Author: Chance Zibolski <
chance....@gmail.com>
Date: Fri Jan 17 11:57:36 2014 -0800
Merge branch 'enhancement/11943' into develop
* enhancement/11943:
Updated summary page to group info into wizard's steps
Hide extra nic inputs dynamically.
Add summary to end of VM Wizard
commit 68c94d4e587160a35d6fec3f498720468cc784eb
Author: Bryon <
br...@osuosl.org>
Date: Thu Jan 16 16:03:03 2014 -0800
Updated summary page to group info into wizard's steps
commit 55c14e7c81d9fda798be1d02ab007c9f5efd33d9
Author: Chance Zibolski <
chance....@gmail.com>
Date: Thu Oct 17 12:45:15 2013 -0700
Hide extra nic inputs dynamically.
refs #11943
commit dcf12cdce3634f6d5bfb27468a3a149f7d9d803c
Author: Chance Zibolski <
chance....@gmail.com>
Date: Fri Feb 22 19:46:11 2013 -0800
Add summary to end of VM Wizard
Split the templates up a lot to use inheritance a bit better. Makes using a
different template for different forms easier.
Moved moved helptips out into its own file and made some changes to fix some
CSS breakage I caused. Now the current helpTip() function works with the older
style helptips, and the initHelpTip() function can probably removed.
refs #11943
Summary of changes:
ganeti_webmgr/static/css/help_tips.css | 6 +-
ganeti_webmgr/static/css/vm_wizard/base.css | 12 +
ganeti_webmgr/static/css/vm_wizard/summary.css | 15 ++
ganeti_webmgr/static/js/helpTips.js | 32 +++-
ganeti_webmgr/templates/ganeti/cluster/edit.html | 8 +-
.../templates/ganeti/forms/create_choice.html | 18 +-
ganeti_webmgr/templates/ganeti/forms/helptips.html | 14 ++
.../templates/ganeti/forms/step_controls.html | 20 ++
ganeti_webmgr/templates/ganeti/forms/summary.html | 222 ++++++++++++++++++++
.../templates/ganeti/forms/vm_wizard_base.html | 59 +++++
.../ganeti/forms/vm_wizard_generic_table.html | 24 ++
.../ganeti/virtual_machine/edit_base.html | 8 +-
.../templates/ganeti/virtual_machine/rename.html | 6 +-
.../templates/ganeti/virtual_machine/reparent.html | 4 +-
ganeti_webmgr/virtualmachines/forms.py | 16 ++-
15 files changed, 433 insertions(+), 31 deletions(-)
create mode 100644 ganeti_webmgr/static/css/vm_wizard/summary.css
create mode 100644 ganeti_webmgr/templates/ganeti/forms/helptips.html
create mode 100644 ganeti_webmgr/templates/ganeti/forms/step_controls.html
create mode 100644 ganeti_webmgr/templates/ganeti/forms/summary.html
create mode 100644 ganeti_webmgr/templates/ganeti/forms/vm_wizard_base.html
create mode 100644 ganeti_webmgr/templates/ganeti/forms/vm_wizard_generic_table.html
diff --git a/ganeti_webmgr/static/css/help_tips.css b/ganeti_webmgr/static/css/help_tips.css
index 13b6a13..aa498bd 100644
--- a/ganeti_webmgr/static/css/help_tips.css
+++ b/ganeti_webmgr/static/css/help_tips.css
@@ -1,8 +1,7 @@
-.help_tip {
+div[id^="help-"] {
background-color:#eee;
border:1px solid #888;
border-radius:5px;
- display:none;
float:left;
margin:20px 0 0 0;
width:390px;
@@ -11,7 +10,7 @@
-webkit-border-radius:5px;
}
-.help_tip h3 {
+div[id^="help-"] h3 {
background-color:#c2e192;
border-bottom:1px solid #888;
color:#444;
@@ -27,4 +26,3 @@
#help div p {margin: 0 0 10px 0;}
#help div ul {margin:10px 0 10px 30px;}
#help div li {list-style:disc; }
-#help-contents {display:none}
diff --git a/ganeti_webmgr/static/css/vm_wizard/base.css b/ganeti_webmgr/static/css/vm_wizard/base.css
index a6d45bf..b3a30ba 100644
--- a/ganeti_webmgr/static/css/vm_wizard/base.css
+++ b/ganeti_webmgr/static/css/vm_wizard/base.css
@@ -7,3 +7,15 @@
.multi {
display: inline-block;
}
+
+button.edit_step {
+ background:none!important;
+ border:none;
+ padding:0!important;
+ cursor: pointer;
+ font-weight: bold;
+}
+
+button.edit_step:hover{
+ text-decoration:underline;
+}
diff --git a/ganeti_webmgr/static/css/vm_wizard/summary.css b/ganeti_webmgr/static/css/vm_wizard/summary.css
new file mode 100644
index 0000000..98b50ec
--- /dev/null
+++ b/ganeti_webmgr/static/css/vm_wizard/summary.css
@@ -0,0 +1,15 @@
+#summary table {
+ width: 63%;
+ height: 70%;
+ margin: 0 auto;
+}
+
+#step_controls {
+ display: table;
+ margin: 0 auto;
+}
+
+#summary td {
+ text-align: left;
+ text-indent: 26px;
+}
diff --git a/ganeti_webmgr/static/js/helpTips.js b/ganeti_webmgr/static/js/helpTips.js
index e394a75..38652a3 100644
--- a/ganeti_webmgr/static/js/helpTips.js
+++ b/ganeti_webmgr/static/js/helpTips.js
@@ -1,3 +1,31 @@
+function helpTips(selector) {
+ // Inputs which have a help tip.
+ var $form_fields = $('input, select', selector);
+ var $tips = $('div[id^="help-"]');
+ // Hide help tips with javascript by default.
+ // With no js, the tips will still be there.
+ $tips.hide()
+ /* Binds the event to our inputs,
+ passing the focused element to the handler. */
+ $form_fields.live('focus', this, getHelpTips);
+
+ function getHelpTips(event) {
+ // The name of the input corresponds to the help tip's data-help attribute.
+ var help_name =
this.name;
+ var $tip = $('#help-'+help_name);
+ // Fix for old helptip labels
+ if ($tip.children('h3').length == 0) {
+ var id = $(this).attr('id');
+ var label = $("label[for='" + id + "']").html();
+ $tip.prepend($("<h3>").html(label));
+ }
+ // Hide all tips.
+ $tips.hide()
+ // Show the tip.
+ $tip.show();
+ }
+}
+
function initHelpTips(selector){
/* initialize the help tips for each item on the create VM template */
@@ -6,7 +34,7 @@ function initHelpTips(selector){
.end()
.find('input[type="checkbox"]')
.live('click', helpTip);
-
+
function helpTip(){
var name =
this.name;
var label = $(this).prev('label').html();
@@ -20,7 +48,7 @@ function initHelpTips(selector){
/* Strip all digits and underscores from end of name.
Makes things work with unknown number of disks/nics. */
var content = $('#help-'+name.replace(/[0-9_]*$/,''));
-
+
if(content.length != 0){
$('#help')
.show();
diff --git a/ganeti_webmgr/templates/ganeti/cluster/edit.html b/ganeti_webmgr/templates/ganeti/cluster/edit.html
index d83cd0a..5949737 100644
--- a/ganeti_webmgr/templates/ganeti/cluster/edit.html
+++ b/ganeti_webmgr/templates/ganeti/cluster/edit.html
@@ -22,7 +22,7 @@
$(document).ready(function() {
/* run when document is fully loaded */
// init the help tips for the individ. form objects
- initHelpTips('#clusterform');
+ helpTips("#clusterform");
});
</script>
@@ -74,11 +74,7 @@
</form>
</div>
-<div id="help" class="help_tip">
- <h3></h3>
- <div></div>
-</div>
-<div id="help-contents">
+<div id="help">
{% include "ganeti/helptips/cluster_edit.html" %}
</div>
diff --git a/ganeti_webmgr/templates/ganeti/forms/create_choice.html b/ganeti_webmgr/templates/ganeti/forms/create_choice.html
index b58f817..3289c78 100644
--- a/ganeti_webmgr/templates/ganeti/forms/create_choice.html
+++ b/ganeti_webmgr/templates/ganeti/forms/create_choice.html
@@ -1,14 +1,16 @@
{% load i18n %}
{% spaceless %}
-{% with vm|default:"Virtual Machine" as vm %}
- {% if choices|length == 2 %}
- {% blocktrans %}{{vm}} and Template {% endblocktrans %}
- {% elif 'hostname' in choices %}
- {% trans vm %}
- {% elif 'template_name' in choices %}
- {% trans "Template" %}
+{% with vm=vm|default:"Virtual Machine" owner=summary.owner_form %}
+ {% if wizard.steps.step0 < 2%}
+ {% blocktrans %}Template and/or {{vm}} {% endblocktrans %}
{% else %}
- {% blocktrans %}Template and/or {{vm}} {% endblocktrans %}
+ {% if owner.template_name and owner.hostname %}
+ {% blocktrans %}{{vm}} and Template {% endblocktrans %}
+ {% elif owner.hostname %}
+ {% trans vm %}
+ {% elif owner.template_name %}
+ {% trans "Template" %}
+ {% endif %}
{% endif %}
{% endwith %}
{% endspaceless %}
diff --git a/ganeti_webmgr/templates/ganeti/forms/helptips.html b/ganeti_webmgr/templates/ganeti/forms/helptips.html
new file mode 100644
index 0000000..cf56b38
--- /dev/null
+++ b/ganeti_webmgr/templates/ganeti/forms/helptips.html
@@ -0,0 +1,14 @@
+{% load i18n %}
+
+{% block helptips %}
+ <div id="help">
+ {% for field in form %}
+ {% if field.help_text %}
+ <div id='help-{{ field.html_name }}'>
+ <h3>{{ field.label }}</h3>
+ <div>{{ field.help_text|safe }}</div>
+ </div>
+ {% endif %}
+ {% endfor %}
+ </div>
+{% endblock helptips %}
diff --git a/ganeti_webmgr/templates/ganeti/forms/step_controls.html b/ganeti_webmgr/templates/ganeti/forms/step_controls.html
new file mode 100644
index 0000000..811543b
--- /dev/null
+++ b/ganeti_webmgr/templates/ganeti/forms/step_controls.html
@@ -0,0 +1,20 @@
+{% load i18n %}
+{% load include_strip %}
+
+{% if wizard.steps.prev %}
+ <button class="select" name="wizard_goto_step" type="submit"
+ value="{{ wizard.steps.first }}">
+ {% trans "Start Over" %}
+ </button>
+ <button class="select" name="wizard_goto_step" type="submit"
+ value="{{ wizard.steps.prev }}">
+ {% trans "Previous" %}
+ </button>
+{% endif %}
+{% if wizard.steps.next %}
+ <input class="select" type="submit"
+ value="{% trans "Next"%} "/>
+{% else %}
+ <input class="select" type="submit"
+ value="{% trans "Create" %} {% include_strip "ganeti/forms/create_choice.html" with vm="VM" %}" />
+{% endif %}
diff --git a/ganeti_webmgr/templates/ganeti/forms/summary.html b/ganeti_webmgr/templates/ganeti/forms/summary.html
new file mode 100644
index 0000000..965533f
--- /dev/null
+++ b/ganeti_webmgr/templates/ganeti/forms/summary.html
@@ -0,0 +1,222 @@
+{% extends "ganeti/forms/vm_wizard_base.html" %}
+{% load i18n %}
+{% load webmgr_tags %}
+
+
+{% block header %}
+Summary
+{% endblock header %}
+
+
+{% block form_content %}
+
+<div id="summary">
+
+<table>
+ {% with owner=summary.owner_form advanced=summary.advanced_form basics=summary.basics_form hv=summary.hv_form %}
+
+ <tbody>
+
+ <!-- Step 1 -->
+
+ <tr><th colspan="2">
+ <button class="edit_step" name="wizard_goto_step" type="submit" value="0">{% trans "Step 1 (Edit)" %}</button>
+ </th></tr>
+
+ <tr>
+ <td>{% trans "Cluster" %}:</td>
+ <td>{{ summary.cluster_form.cluster }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Template or VM:" %}</td>
+ {% if owner.hostname and owner.template_name %}
+ <td>{% trans "Both" %}</td>
+ {% elif owner.hostname %}
+ <td>{% trans "Virtual Machine" %}</td>
+ {% else %}
+ <td>{% trans "Template" %}</td>
+ {% endif %}
+ </tr>
+ <tr><td><!-- spacer row for readability --></td></tr>
+
+ <!-- Step 2 -->
+
+ <tr><th colspan="2">
+ <button class="edit_step" name="wizard_goto_step" type="submit" value="1">{% trans "Step 2 (Edit)" %}</button>
+ </th></tr>
+
+ <tr>
+ <td>{% trans "Owner" %}:</td>
+ <td>{{ summary.owner_form.owner }}</td>
+ </tr>
+
+ {% if owner.template_name %}
+ <tr>
+ <td>{% trans "Template Name" %}</td>
+ <td>{{ owner.template_name }}</td>
+ </tr>
+ {% endif %}
+ {% if owner.hostname %}
+ <tr>
+ <td>{% trans "Host Name" %}</td>
+ <td>{{ owner.hostname }}</td>
+ </tr>
+ {% endif %}
+ <tr><td><!-- spacer row for readability --></td></tr>
+
+ <!-- Step 3 -->
+
+ <tr><th colspan="2">
+ <button class="edit_step" name="wizard_goto_step" type="submit" value="2">{% trans "Step 3 (Edit)" %}</button>
+ </th></tr>
+
+ <tr>
+ <td>{% trans "Hypervisor" %}</td>
+ <td>{{ basics.hv }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Operating System" %}</td>
+ <td>{% if not basics.no_install %}
+ {{ basics.os }}
+ {% else %}
+ Don't install
+
+ {% endif %} </td></tr>
+ <tr>
+ <td>Automatic Allocation</td>
+ <td>
+ {% if basics.iallocator %}
+ <img src="/static/images/icons/check.png" />
+ {% else %}
+ <img src="/static/images/icons/cross.png" />
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td>{% trans "Virtual CPU Count" %}</td>
+ <td>{{ basics.vcpus }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Memory (RAM)" %}</td>
+ <td>{{ basics.memory|render_storage }}</td>
+ </tr>
+ <!-- Disks -->
+ <tr>
+ <td>{% trans "Disk Template" %}</td>
+ <td>{{ basics.disk_template }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Disk Type" %}</td>
+ <td>{{ hv.disk_type }}</td>
+ </tr>
+ {% for disk in basics.disks %}
+ <tr>
+ <td>{% trans "Disk" %}/{{ forloop.counter0 }}</td>
+ <td>{{ disk.size|render_storage }}</td>
+ </tr>
+ {% endfor %}
+
+ <tr><td><!-- spacer row for readability --></td></tr>
+
+ <!-- Step 4 -->
+
+ <tr><th colspan="2">
+ <button class="edit_step" name="wizard_goto_step" type="submit" value="3">{% trans "Step 4 (Edit)" %}</button>
+ </th></tr>
+
+ <tr>
+ <td>{% trans "Check IP" %}?</td>
+ <td>
+ {% if advanced.ip_check %}
+ <img src="/static/images/icons/check.png" />
+ {% else %}
+ <img src="/static/images/icons/cross.png" />
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td>{% trans "Check Hostname" %}?</td>
+ <td>
+ {% if advanced.name_check %}
+ <img src="/static/images/icons/check.png" />
+ {% else %}
+ <img src="/static/images/icons/cross.png" />
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td>{% trans "Boot VM" %}?</td>
+ <td>
+ {% if advanced.no_start %}
+ <img src="/static/images/icons/cross.png" />
+ {% else %}
+ <img src="/static/images/icons/check.png" />
+ {% endif %}
+ </td>
+ </tr>
+ <tr><td><!-- spacer row for readability --></td></tr>
+
+ <!-- Step 5 -->
+ <tr><th colspan="2">
+ <button class="edit_step" name="wizard_goto_step" type="submit" value="4">{% trans "Step 5 (Edit)" %}</button>
+ </th></tr>
+
+ <tr>
+ <td>{% trans "Kernel Path" %}</td>
+ <td>{{ hv.kernel_path|default:"Not Set" }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Root Path" %}</td>
+ <td>{{ hv.root_path|default:"Not Set" }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Enable Serial Console" %}?</td>
+ <td>
+ {% if hv.serial_console %}
+ <img src="/static/images/icons/check.png" />
+ {% else %}
+ <img src="/static/images/icons/cross.png" />
+ {% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td>{% trans "Boot Device" %}</td>
+ <td>{{ hv.boot_order|default:"Not Set" }}</td>
+ </tr>
+ <!-- CD drive -->
+ {% if hv.cdrom_image_path %}
+ <tr>
+ <td>{% trans "CDROM Image Path" %}</td>
+ <td>{{ hv.cdrom_image_path }}</td>
+ </tr>
+ {% endif %}
+ {% if hv.cdrom2_image_path %}
+ <tr>
+ <td>{% trans "CDROM2 Image Path" %}</td>
+ <td>{{ hv.cdrom2_image_path }}</td>
+ </tr>
+ {% endif %}
+ {% if hv.cdrom_disk_type %}
+ <tr>
+ <td>{% trans "CDROM Disk Type" %}</td>
+ <td>{{ hv.cdrom_disk_type }}</td>
+ </tr>
+ {% endif %}
+ <tr>
+ <td>{% trans "NIC Type" %}</td>
+ <td>{{ hv.nic_type }}</td>
+ </tr>
+
+ <tr><td><!-- spacer row for readability --></td></tr>
+
+ </tbody>
+
+ {% endwith %}
+</table>
+
+<div id="step_controls">
+ {% include "ganeti/forms/step_controls.html" %}
+</div>
+
+</div>
+{% endblock form_content %}
diff --git a/ganeti_webmgr/templates/ganeti/forms/vm_wizard_base.html b/ganeti_webmgr/templates/ganeti/forms/vm_wizard_base.html
new file mode 100644
index 0000000..142a6e4
--- /dev/null
+++ b/ganeti_webmgr/templates/ganeti/forms/vm_wizard_base.html
@@ -0,0 +1,59 @@
+{% extends "menu_base.html" %}
+{% load i18n %}
+{% load webmgr_tags %}
+{% load include_strip %}
+
+
+{% block title %}{%trans "Create a Virtual Machine" %}{% endblock %}
+
+{% block head %}
+{{ wizard.form.media }}
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/vm_wizard/base.css"/>
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/help_tips.css"/>
+
+<script src="{{STATIC_URL}}/js/helpTips.js"></script>
+<script src="{{STATIC_URL}}/js/disableSingletonDropdown.js" type="text/javascript"></script>
+<script src="{{STATIC_URL}}/js/multiInputHide.js" type="text/javascript"></script>
+
+<script type="text/javascript">
+$(document).ready(function() {
+ helpTips("#wizard");
+ multi_input('.disk');
+ multi_input('.nic');
+});
+</script>
+{% endblock %}
+
+{% block content %}
+<h1>{% block header %}
+Create {% include_strip "ganeti/forms/create_choice.html" with choices=summary.cluster_form.choices %} :
+{% endblock header %}</h1>
+
+<h2>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</h2>
+
+<div class="vm-summary">
+ <ul>
+ {% if summary.cluster_form.cluster %}
+ <li>Cluster: {{ summary.cluster_form.cluster }}</li>
+ {% endif %}
+ {% if summary.owner_form %}
+ <li>Owner: {{ summary.owner_form.owner }}</li>
+ {% endif %}
+ </ul>
+</div>
+
+<form action="" id='wizard' method="POST">{% csrf_token %} {{ wizard.management_form }}
+{% block form_content %}
+
+{% comment %} Including the step_controls by default. {% endcomment %}
+{% include "ganeti/forms/step_controls.html" %}
+{% endblock form_content %}
+</form>
+
+{% comment %}
+ All this does is render each fields help_text
+ and puts it into a help_tip div for styling
+{% endcomment %}
+{% include "ganeti/forms/helptips.html" with form=wizard.form only %}
+
+{% endblock content %}
diff --git a/ganeti_webmgr/templates/ganeti/forms/vm_wizard_generic_table.html b/ganeti_webmgr/templates/ganeti/forms/vm_wizard_generic_table.html
new file mode 100644
index 0000000..186a9f5
--- /dev/null
+++ b/ganeti_webmgr/templates/ganeti/forms/vm_wizard_generic_table.html
@@ -0,0 +1,24 @@
+{% extends "ganeti/forms/vm_wizard_base.html" %}
+
+{% block form_content %}
+ <table>
+ {{ wizard.form.non_field_errors }}
+
+ {% for hidden in wizard.forms.invisible_fields %}
+ {{ hidden }}
+ {% endfor %}
+
+ {% for field in wizard.form.visible_fields %}
+ <tr>
+ <th>{{ field.label_tag }}</th>
+ <td>{{ field.errors }} {{ field }}</td>
+ </tr>
+ {% endfor %}
+ <tr >
+ <td></td>
+ <td id="step_controls">
+ {% include "ganeti/forms/step_controls.html" %}
+ </td>
+ </tr>
+ </table>
+{% endblock form_content %}
diff --git a/ganeti_webmgr/templates/ganeti/virtual_machine/edit_base.html b/ganeti_webmgr/templates/ganeti/virtual_machine/edit_base.html
index dabc392..dbe5593 100644
--- a/ganeti_webmgr/templates/ganeti/virtual_machine/edit_base.html
+++ b/ganeti_webmgr/templates/ganeti/virtual_machine/edit_base.html
@@ -10,7 +10,7 @@
$(document).ready(function() {
var formUpdate = new modifyFormUpdater({{ form.nics }});
formUpdate.init();
- initHelpTips("#vmeditform");
+ helpTips("#vmeditform");
});
</script>
{% endblock %}
@@ -59,11 +59,7 @@
<input class="submit" type="submit" value="{% trans "Continue" %}" />
</form>
</div>
-<div id="help" class="help_tip">
- <h3></h3>
- <div></div>
-</div>
-<div id="help-contents">
+<div id="help">
{% include "ganeti/helptips/vm.html" %}
{% include "ganeti/helptips/vm_edit.html" %}
{% block helptips %}{% endblock %}
diff --git a/ganeti_webmgr/templates/ganeti/virtual_machine/rename.html b/ganeti_webmgr/templates/ganeti/virtual_machine/rename.html
index 4e5c50e..6c00707 100644
--- a/ganeti_webmgr/templates/ganeti/virtual_machine/rename.html
+++ b/ganeti_webmgr/templates/ganeti/virtual_machine/rename.html
@@ -9,7 +9,9 @@
<link rel="stylesheet" type="text/css"
href="{{STATIC_URL}}/css/help_tips.css"/>
<script src="{{STATIC_URL}}/js/helpTips.js"></script>
- <script type="text/javascript">initHelpTips('#virtualmachineform');</script>
+ <script type="text/javascript">
+ helpTips('#virtualmachineform');
+ </script>
<script type="text/javascript">
// Make sure that if IP Check is selected, so is DNS Name Check
$(document).ready(function() {
@@ -62,7 +64,7 @@
<div></div>
</div>
- <div id="help-contents">
+ <div id="help">
{% include "ganeti/helptips/vm_rename.html" %}
</div>
{% endblock %}
diff --git a/ganeti_webmgr/templates/ganeti/virtual_machine/reparent.html b/ganeti_webmgr/templates/ganeti/virtual_machine/reparent.html
index 7747950..58d6e18 100644
--- a/ganeti_webmgr/templates/ganeti/virtual_machine/reparent.html
+++ b/ganeti_webmgr/templates/ganeti/virtual_machine/reparent.html
@@ -13,7 +13,7 @@
<script type="text/javascript" src="{{SITE_ROOT}}/object_permissions_media/js/autocomplete_user_search.js"></script>
<script type="text/javascript">
$(document).ready(function() {
- initHelpTips("#virtualmachineform");
+ helpTips("#virtualmachineform");
autocomplete_user_search($("#id_owner"),'{% url owner-search %}');
});
</script>
@@ -44,7 +44,7 @@
<div></div>
</div>
- <div id="help-contents">
+ <div id="help">
{% include "ganeti/helptips/vm_create.html" %}
</div>
{% endblock %}
diff --git a/ganeti_webmgr/virtualmachines/forms.py b/ganeti_webmgr/virtualmachines/forms.py
index 5e2236a..867a2f2 100644
--- a/ganeti_webmgr/virtualmachines/forms.py
+++ b/ganeti_webmgr/virtualmachines/forms.py
@@ -1117,10 +1117,15 @@ class VMWizardKVMForm(Form):
return data
+class VMWizardSummaryForm(Form):
+ class Media:
+ css = {
+ 'all': ('/static/css/vm_wizard/summary.css',)
+ }
class VMWizardView(LoginRequiredMixin, PermissionRequiredMixin,
CookieWizardView):
- template_name = "ganeti/forms/vm_wizard.html"
+ template_name = "ganeti/forms/vm_wizard_generic_table.html"
permission_required = ["admin", "create_vm"]
no_perms_msg = ("You do not have admin or create vm "
"privledges to any clusters.")
@@ -1175,6 +1180,12 @@ class VMWizardView(LoginRequiredMixin, PermissionRequiredMixin,
return data.get("iallocator", False)
return False
+ def get_template_names(self):
+ template = self.template_name
+ if self.steps.current == '5':
+ template = 'ganeti/forms/summary.html'
+ return template
+
def get_form(self, step=None, data=None, files=None):
s = int(self.steps.current) if step is None else int(step)
initial = self.get_form_initial(s)
@@ -1223,6 +1234,8 @@ class VMWizardView(LoginRequiredMixin, PermissionRequiredMixin,
form._configure_for_template(self._get_template())
else:
form = Form()
+ elif s == 5:
+ form = VMWizardSummaryForm(data=data)
else:
form = super(VMWizardView, self).get_form(step, data, files)
@@ -1345,6 +1358,7 @@ def vm_wizard(*args, **kwargs):
VMWizardOwnerForm,
VMWizardBasicsForm,
VMWizardAdvancedForm,
+ VMWizardSummaryForm,
Form,
)
initial = kwargs.get('initial_dict', None)