1
{% extends "master.tmpl" %}
5
<script type="text/javascript">
6
function items_check_all(){
7
var checkall = document.getElementById("itemsall").checked
8
var items = document.getElementsByName("items")
9
for(i=0; i<items.length; ++i) {
10
items[i].checked=checkall;
15
function items_check(obj) {
16
obj.parentNode.parentNode.className=(obj.checked)? 'selected' : '';
19
function items_checked_values() {
20
var items = document.getElementsByName("items")
21
var values = new Array();
22
for(i=0; i<items.length; ++i) {
23
if (items[i].checked) {
24
values.push(items[i].value)
31
function obj_rename(old) {
32
var newname = window.prompt("Change {{ what }} name to?",old);
33
if (newname != null) {
34
window.location = "/cobbler_web/{{ what }}/rename/" + old + "/" + newname;
37
function obj_copy(old) {
38
var newname = window.prompt("Name for the new {{ what }}?",old);
39
if (newname != null) {
40
window.location = "/cobbler_web/{{ what }}/copy/" + old + "/" + newname;
43
function obj_delete(old) {
44
if (confirm("Delete {{ what }} (" + old + ") and all child objects?")) {
45
window.location = "/cobbler_web/{{ what }}/delete/" + old;
49
function action(otype) {
50
sel_action = document.getElementById("actions").value
51
what = sel_action.split("|")[0]
52
action = sel_action.split("|")[1]
53
document.location = "/cobbler_web/" + what + "/" + action
56
function action_multi(otype) {
57
var values = items_checked_values()
61
document.getElementById("names").value = values
63
sel_batchaction = document.getElementById("batchactions").value
64
action = sel_batchaction.split("|")[0]
65
param = sel_batchaction.split("|")[1]
67
if (action == "profile") {
68
param = window.prompt("New installation profile name for checked systems?","")
69
if ((param == null) || (param == "")) {
77
if ((action == "power") && (param == "on")) {
78
value = confirm("Confirm: Really power up all checked systems?")
80
if ((action == "power") && (param == "off")) {
81
value = confirm("Confirm: Really power down all checked systems?")
83
if ((action == "power") && (param == "reboot")) {
84
value = confirm("Confirm: Really reboot all checked systems?")
86
if ((action == "netboot") && (param == "enable")) {
87
value = confirm("Confirm: Really flag all checked systems for PXE reinstallation?")
89
if ((action == "netboot") && (param == "disable")) {
90
value = confirm("Confirm: Really disable all checked systems for PXE reinstallation?")
92
if ((action == "delete" ) && (param == "delete")) {
93
value = confirm("Confirm: Really delete all checked " + otype + "?" )
95
if ((action == "reposync")) {
100
document.myform.action = "/cobbler_web/" + otype + "/multi/" + action + "/" + param
101
document.myform.submit()
104
alert("Operation aborted.")
108
<h1>{{ what|title }}s</h1>
112
<a class="action" href="/cobbler_web/{{what}}/edit">Create new {{ what }}</a>
113
{% ifequal what "profile" %}<a class="action" href="/cobbler_web/sub{{what}}/edit">Create new sub-{{ what }}</a>{% endifequal %}
116
<select id="batchactions">
117
<option value="" selected="selected">Batch Actions</option>
118
{% for title,action,value in batchactions %}<option value="{{ action }}|{{ value }}">{{ title }}</option>{% endfor %}
120
<input class="button" type="button" value="go" onclick="javascript:action_multi('{{ what }}')" />
122
{% include "paginate.tmpl" %}
125
<form name="myform" method="post" action="/cobbler_web/{{ what }}/action">
126
<table id="listitems" cellspacing="0">
130
<input type="checkbox" id="itemsall" onclick="javascript:items_check_all();" />
132
{% for value in columns %}
134
<a href="/cobbler_web/{{ what }}/modifylist/sort/{{ value.0 }}">{{ value.0|title }}</a>
135
{% ifequal value.1 "asc" %}
138
{% ifequal value.1 "desc" %}
147
{% for item in items %}
148
<tr class="{% cycle 'rowodd' 'roweven' %}">
149
<td><input type="checkbox" name="items" value="{{ item.0.1 }}" onclick="javascript:items_check(this);" /></td>
150
{% for value in item %}
152
{% ifequal value.0 "name" %}
153
<a href="/cobbler_web/{{ what }}/edit/{{ value.1 }}">{{ value.1 }}</a>
155
{% ifequal value.2 "editlink" %}
156
{% ifnotequal value.1 "~" %}
157
<a href="/cobbler_web/{{ value.0 }}/edit/{{ value.1 }}">{{ value.1 }}</a>
160
{% ifequal value.2 "checkbox" %}
161
{% ifequal value.1 1 %}
162
<input type="checkbox" name="{{ item.name }}" id="{{ item.name }}" value="{{ item.name }}" disabled="disabled" checked="checked" />
164
<input type="checkbox" name="{{ item.name }}" id="{{ item.name }}" value="{{ item.name }}" disabled="disabled" />
167
{% ifequal value.2 "text" %}
173
<a class="action" href="/cobbler_web/{{ what }}/edit/{{ item.0.1 }}">Edit</a>
174
<span class="action" onClick="javascript:obj_copy('{{ item.0.1 }}')">Copy</span>
175
<span class="action" onClick="javascript:obj_rename('{{ item.0.1 }}')">Rename</span>
176
<span class="action" onClick="javascript:obj_delete('{{ item.0.1 }}')">Delete</span>
177
{% ifequal what "system" %}
178
<span class="action" onClick="window.location='/cblr/svc/op/ks/system/{{ item.0.1 }}'">View kickstart</span>
180
{% ifequal what "profile" %}
181
<span class="action" onClick="window.location='/cblr/svc/op/ks/profile/{{ item.0.1 }}'">View kickstart</span>
188
<input type="hidden" name="names" id="names" value=""/>
190
{% include "filter.tmpl" %}
192
{% endblock content %}