summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-18 17:21:42 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-18 17:21:42 -0400
commit36bb2e494412b689a71b9f139a655f97965c8ee9 (patch)
tree52b9ba9f5ed20fc1aa0595027cfd1aa0a510b3b5
parent19cc21593ecfa1d8c644e3fa853f51e36f935838 (diff)
downloadthird_party-cobbler-36bb2e494412b689a71b9f139a655f97965c8ee9.tar.gz
third_party-cobbler-36bb2e494412b689a71b9f139a655f97965c8ee9.tar.xz
third_party-cobbler-36bb2e494412b689a71b9f139a655f97965c8ee9.zip
Arch and breed in the WUI are now radio buttons, plus a workaround for an issue where the values
of a disabled form field do not appear to be set to the browser.
-rw-r--r--cobbler/webui/CobblerWeb.py9
-rw-r--r--webui_templates/distro_edit.tmpl48
2 files changed, 48 insertions, 9 deletions
diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py
index a5e9d30..abbc5aa 100644
--- a/cobbler/webui/CobblerWeb.py
+++ b/cobbler/webui/CobblerWeb.py
@@ -254,6 +254,8 @@ class CobblerWeb(object):
return self.distro_list()
# pre-command paramter checking
+ if name is None and editmode=='edit' and oldname is not None:
+ name = oldname
if name is None:
return self.error_page("name is required")
if kernel is None or not str(kernel).startswith("/"):
@@ -328,6 +330,8 @@ class CobblerWeb(object):
return self.login(message="")
# parameter checking
+ if name is None and editmode=='edit' and oldname is not None:
+ name = oldname
if name is None:
return self.error_page("System name parameter is REQUIRED.")
if (editmode == 'rename' or editmode == 'copy') and name == oldname:
@@ -448,6 +452,8 @@ class CobblerWeb(object):
return self.login(message="")
# pre-command parameter checking
+ if name is None and editmode=='edit' and oldname is not None:
+ name = oldname
if name is None:
return self.error_page("name is required")
if distro is None:
@@ -541,6 +547,9 @@ class CobblerWeb(object):
return self.login(message="")
# pre-command parameter checking
+
+ if name is None and editmode=='edit' and oldname is not None:
+ name = oldname
if name is None:
return self.error_page("name is required")
if (editmode == 'rename' or editmode == 'copy') and name == oldname:
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl
index bd76bfe..cbf4cbb 100644
--- a/webui_templates/distro_edit.tmpl
+++ b/webui_templates/distro_edit.tmpl
@@ -63,11 +63,26 @@ function disablename(value)
<br/>
<label for="arch">Architecture</label>
- <input type="text" size="32" style="width: 150px;" name="arch" id="arch"
- #if $distro
- value="$distro.arch"
- #end if
- />
+
+ #if $distro and $distro.arch == "x86"
+ <input type="radio" size="32" name="arch" id="arch" value="x86" checked>x86
+ #else
+ <input type="radio" size="32" name="arch" id="arch" value="x86">x86
+ #end if
+ #if $distro and $distro.arch == "x86_64"
+ <input type="radio" size="32" name="arch" id="arch" value="x86_64" checked>x86_64
+ #else
+ <input type="radio" size="32" name="arch" id="arch" value="x86_64">x86_64
+ #end if
+ #if $distro and $distro.arch == "ia64"
+ <input type="radio" size="32" name="arch" id="arch" value="ia64" checked>ia64
+ #else
+ <input type="radio" size="32" name="arch" id="arch" value="ia64">ia64
+ #end if
+
+
+
+
<br/>
<label for="kopts">Kernel Options</label>
@@ -87,11 +102,26 @@ function disablename(value)
<br/>
<label for="breed">Breed</label>
- <input type="text" size="32" style="width: 150px;" name="breed" id="breed"
- #if $distro
- value="$distro.breed"
+ #if $distro and $distro.breed == "redhat"
+ <input type="radio" size="32" name="breed" id="breed" value="redhat" checked>Red Hat Based
+ #else
+ #if $distro and $distro.breed != "redhat"
+ <input type="radio" size="32" name="breed" id="breed" value="redhat">Red Hat Based
+ #else
+ <input type="radio" size="32" name="breed" id="breed" value="redhat" checked>Red Hat Based
#end if
- />
+ #end if
+ #if $distro and $distro.breed == "debian"
+ <input type="radio" size="32" name="breed" id="breed" value="debian" checked>Debian
+ #else
+ <input type="radio" size="32" name="breed" id="breed" value="debian">Debian
+ #end if
+ #if $distro and $distro.breed == "suse"
+ <input type="radio" size="32" name="breed" id="breed" value="suse" checked>SuSE
+ #else
+ <input type="radio" size="32" name="breed" id="breed" value="suse">SuSE
+ #end if
+
<br/>
#if $distro