Skip to content
Permalink
Browse files

WATO: custom attributes now inheritable

  • Loading branch information
MathiasKettner committed May 31, 2011
1 parent 80cad14 commit fcef9816cdc0a6b2984c251b64302e533afc89d3
Showing with 340 additions and 213 deletions.
  1. +30 −2 web/htdocs/check_mk.css
  2. +8 −0 web/htdocs/htmllib.py
  3. +9 −5 web/htdocs/js/wato.js
  4. +291 −204 web/htdocs/wato.py
  5. +2 −2 web/plugins/wato/builtin_attributes.py
@@ -20,7 +20,7 @@ td, th {
vertical-align: top;
}

button, input, td, select {
button, input, td, th, select {
font-size: 9pt;
}

@@ -1080,7 +1080,7 @@ table.form img.toggleheader.hover {
table.form td.legend {
color: #274750;
border: 1px solid #fff;
border-right-style: none;
/* border-right-style: none; */
height: 32px;
padding-top: 10px;
}
@@ -1623,6 +1623,21 @@ table.add_snapin i {
*/

.wato table.form {
/* width: 50%;
left: 25%;
position: relative;*/
}

.wato table.form td.checkbox {
width: 40px;
height: 40px;
vertical-align: middle;
text-align: center;
border: 1px solid white;
border-left-style: none;
}

.wato table.auditlog {
background-image: url("images/form_background.png");
background-repeat: repeat;
@@ -1658,6 +1673,19 @@ table.add_snapin i {
width: 100%;
}

.wato div.inherited {
color: #000;
font-weight: bold;
}
.wato td.inherited {
color: #666;
}
.wato div.inherited h3 {
margin: 0px;
padding: 0px;
font-size: 8pt;
color: #68a;
}
/*
____
| _ \ _ __ ___ __ _ _ __ ___ ___ ___
@@ -359,6 +359,14 @@ def checkbox(self, varname, deflt="", cssclass = '', onchange=None):
if error:
html += "</x>"

# Get value of checkbox. Return True, False or None
def get_checkbox(self, varname):
if not self.var("filled_in") == self.form_name: # this form filled in
return None
else:
value = self.req.vars.get(varname, "")
return not not value

def datetime_input(self, varname, default_value):
try:
t = self.get_datetime_input(varname)
@@ -51,15 +51,19 @@ function wato_check_all(css_class) {
}

/* Make attributes visible or not when clicked on a checkbox */
function wato_toggle_attribute(oCheckbox, divid) {
oDiv = document.getElementById(divid);
function wato_toggle_attribute(oCheckbox, attrname) {
var oEntry = document.getElementById("attr_entry_" + attrname);
var oDefault = document.getElementById("attr_default_" + attrname);
if (oCheckbox.checked) {
oDiv.style.display = "";
oEntry.style.display = "";
oDefault.style.display = "none";
}
else {
oDiv.style.display = "none";
oEntry.style.display = "none";
oDefault.style.display = "";
}
odiv = null;
oEntry = null;
oDefault = null;
}

// ----------------------------------------------------------------------------

0 comments on commit fcef981

Please sign in to comment.
You can’t perform that action at this time.