Ticket #3957 (partial) - ganeti_webmgr uses ganeti python namespace:
[ganeti_webmgr.git] / ganeti_web / templates / virtual_machine / table.html
blob53db7df7d0b6c5da51239924e9ad6f173f82db97
1 {% block head %}
2 {% load i18n %}
4 {% comment %}
5 This is the AJAX table sub-template that can be used to list virtual
6 machines and clusters.
8 When rendering this template, you may optionally provide a `tableID`
9 argument and the table will encapsulate itself within the provided term,
10 for example:
12 return render_to_response("virtual_machine/table.html",
13 {'tableID': 'table_foo'},
14 context_instance=RequestContext(request))
16 This is handy if you're trying to render this sub-template more than once
17 on the same page.
18 {% endcomment %}
20 <style>
21 td.actions div.delete {
22 float:none;
24 #content td.actions a, #content td.actions {
25 padding:5px 0 0 0;
27 #vm-wrapper {
28 margin-top: 40px;
30 </style>
32 <script type="text/javascript" src="{{MEDIA_URL}}/js/VM_ajaxTable.js"></script>
33 <script type="text/javascript">
35 $(function(){
36 /* "Main" */
38 {% if cluster %}
39 var url = "{% url cluster-virtualmachine-table cluster.slug %}";
40 {% else %}
41 {% if primary_node %}
42 var url = "{% url vm-table-primary node %}"
43 {% else %}{% if secondary_node %}
44 var url = "{% url vm-table-secondary node %}"
45 {% else %}
46 var url = "{% url virtualmachine-table %}";
47 {% endif %}{% endif %}
48 {% endif %}
50 {% if tableID %}
51 var tableID = '{{tableID}}';
52 {% else %}
53 var tableID = 'ajaxTable';
54 {% endif %}
56 $('#'+tableID).data('ajaxTable', new ajaxTable(url, tableID));
57 $('#'+tableID).data('ajaxTable').init();
58 });
60 </script>
61 {% endblock %}
63 {% if cluster %}
64 <a class="button add" href="{% url instance-create cluster.slug %}">
65 {% trans "Add Virtual Machine" %}
66 </a>
67 {% else %}
68 {% if can_create %}
69 <a class="button add" href="{% url instance-create %}">
70 {% trans "Add Virtual Machine" %}
71 </a>
72 {% endif %}
73 {% endif %}
75 {% if tableID %}
76 <div id='{{tableID}}'>
77 {% else %}
78 <div id='ajaxTable'>
79 {% endif %}
80 <div id="vm-wrapper">
81 {% include "virtual_machine/inner_table.html" %}
82 </div>
84 <div class='spinner'>
85 <br/>
86 {% trans "Loading" %}...
87 <br/>
88 <br/>
89 <img src='{{ MEDIA_URL }}/images/ajax-loader.gif'>
90 </div>
91 </div>