summaryrefslogtreecommitdiffstats
path: root/webui_templates
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-04-01 15:00:38 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-04-01 15:00:38 -0400
commit952cdfbd85671c2ed6dfa55fa34b33739815e288 (patch)
treeaa17f412c7eda058d7d6a5e78f76c5885ecb552a /webui_templates
parent339e79b493b8bcf41dbf59a1931d171e04c0284d (diff)
downloadthird_party-cobbler-952cdfbd85671c2ed6dfa55fa34b33739815e288.tar.gz
third_party-cobbler-952cdfbd85671c2ed6dfa55fa34b33739815e288.tar.xz
third_party-cobbler-952cdfbd85671c2ed6dfa55fa34b33739815e288.zip
Move the authentication error messages in the WebUI to a common template file so they can be reused, in those messages, explain who is in the access control list. Also make the system "remove"
buttons for NICs change to "hide" buttons in non-editable modes.
Diffstat (limited to 'webui_templates')
-rw-r--r--webui_templates/distro_edit.tmpl8
-rw-r--r--webui_templates/enoaccess.tmpl10
-rw-r--r--webui_templates/profile_edit.tmpl8
-rw-r--r--webui_templates/repo_edit.tmpl8
-rw-r--r--webui_templates/system_edit.tmpl31
5 files changed, 39 insertions, 26 deletions
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl
index 6089ac9..47b7e10 100644
--- a/webui_templates/distro_edit.tmpl
+++ b/webui_templates/distro_edit.tmpl
@@ -16,10 +16,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $distro.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="POST" action="$base_url">
@@ -197,7 +195,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $distro
+ #if $distro and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/enoaccess.tmpl b/webui_templates/enoaccess.tmpl
new file mode 100644
index 0000000..5af1ae3
--- /dev/null
+++ b/webui_templates/enoaccess.tmpl
@@ -0,0 +1,10 @@
+#set $myowners = ", ".join($owners)
+
+<blockquote>
+WARNING: You do not have permission to make changes to this
+object. To recieve access, contact your Cobbler server administrator.
+</br>
+
+The access control list for this object is: <B><U>$myowners</U></B>.
+</blockquote>
+
diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl
index a0b6fdc..258a8f2 100644
--- a/webui_templates/profile_edit.tmpl
+++ b/webui_templates/profile_edit.tmpl
@@ -14,10 +14,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $profile.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=profile_save">
@@ -334,7 +332,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $profile
+ #if $profile and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl
index fdfd840..b58e54f 100644
--- a/webui_templates/repo_edit.tmpl
+++ b/webui_templates/repo_edit.tmpl
@@ -14,10 +14,8 @@ function disablename(value)
#end if
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $repo.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=repo_save">
@@ -188,7 +186,7 @@ To recieve access, contact your Cobbler server administrator.
</tr>
- #if $repo
+ #if $repo and $editable == True
<tr>
<td>
<label for="delete">Delete</label>
diff --git a/webui_templates/system_edit.tmpl b/webui_templates/system_edit.tmpl
index 517f569..cdb1adc 100644
--- a/webui_templates/system_edit.tmpl
+++ b/webui_templates/system_edit.tmpl
@@ -14,9 +14,11 @@
function delete_interface(num)
{
- #for $field in $fields
- document.getElementById("${field}-intf" + num).value = "";
- #end for
+ #if $editable == True
+ #for $field in $fields
+ document.getElementById("${field}-intf" + num).value = "";
+ #end for
+ #end if
toggleRowVisibility("id" + num);
}
@@ -87,10 +89,8 @@ function page_onload() {
</script>
#if $editable != True
-<blockquote>
-WARNING: It looks like you do not have permission to make changes.
-To recieve access, contact your Cobbler server administrator.
-</blockquote>
+#set global $owners = $system.owners
+#include "/usr/share/cobbler/webui_templates/enoaccess.tmpl"
#end if
<form method="post" action="$base_url?mode=system_save">
@@ -390,11 +390,20 @@ To recieve access, contact your Cobbler server administrator.
#if $interface != "intf0"
<tr class="listrow" id="child-id${counter}-8">
<td>
- <label for="enabled-$interface">Remove</label>
+ #if $editable == True
+ <label for="enabled-$interface">Remove</label>
+ #else
+ <label for="enabled-$interface">Hide</label>
+ #end if
</td>
<td>
- <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)">
- <p class="context-tip">Clicking this button removes the interface from the configuration.</p>
+ #if $editable == True
+ <input type="button" name="delete-$interface" value="remove" onclick="delete_interface($counter)">
+ <p class="context-tip">Clicking this button removes the interface from the configuration.</p>
+ #else
+ <input type="button" name="delete-$interface" value="hide" onclick="delete_interface($counter)">
+
+ #end if
</td>
</tr>
#end if
@@ -416,7 +425,7 @@ To recieve access, contact your Cobbler server administrator.
</td>
</tr>
- #if $system
+ #if $system and $editable == True
<tr id="id10001">
<td>
<label for="delete">Delete</label>