ENHANCEMENT: open/7881 - removed disabled checkboxes and replaced them with green ticks. Added help text above the list of permissions. Removed action buttons by fade out when user goes to users permissions tab.

This commit is contained in:
Jeremy Bridson 2012-09-26 13:19:26 +12:00 committed by Ingo Schommer
parent 91e4fde96f
commit 07bc75c281
4 changed files with 56 additions and 8 deletions

View File

@ -852,5 +852,13 @@ li.class-ErrorPage > a .jstree-pageicon { background-position: 0 -112px; }
.SecurityAdmin .permissioncheckboxset .optionset li, .SecurityAdmin .permissioncheckboxsetfield_readonly .optionset li { float: none; width: auto; }
/* For user permissions the readonly checkboxes are set as display none and are replaced with a <span> that has a
green tick icon as a background this is created using compass generated classes and hardcoded in the php */
.permissioncheckboxsetfield_readonly .optionset li.odd, .permissioncheckboxsetfield_readonly .optionset li.even { margin-left: 16px; }
.permissioncheckboxsetfield_readonly .optionset li.help { width: 384px; }
.permissioncheckboxsetfield_readonly .optionset li input { display: none; }
.permissioncheckboxsetfield_readonly .optionset li label { position: relative; }
.permissioncheckboxsetfield_readonly .optionset li label span { position: absolute; left: -16px; top: -2px; }
.cms .cms-content .SecurityAdmin .cms-content-fields { overflow-y: auto; }
.cms .cms-content .SecurityAdmin .cms-content-fields .aligned-right-label { margin-left: 184px; padding: 8px 0; }

View File

@ -10,6 +10,33 @@
}
}
/* For user permissions the readonly checkboxes are set as display none and are replaced with a <span> that has a
green tick icon as a background this is created using compass generated classes and hardcoded in the php */
.permissioncheckboxsetfield_readonly {
.optionset {
li {
&.odd, &.even {
margin-left:$grid-x*2; // aligns the labels after input is set to display none.
}
&.help{
width:$grid-x*48;
}
input {
display:none;
}
label {
position:relative; // needs to be set to position the span element correctly
span { // background set using compass generated classes (background is green tick icon)
position:absolute;
left:$grid-x*-2;
top:-2px;
}
}
}
}
}
.cms .cms-content .SecurityAdmin { //datagrid overflow on Security Admin
.cms-content-fields {
overflow-y:auto;

View File

@ -85,4 +85,5 @@
});
});
}(jQuery));

View File

@ -189,15 +189,27 @@ class PermissionCheckboxSetField extends FormField {
if($this->readonly) $disabled = ' disabled="true"';
$inheritMessage = '<small>' . $inheritMessage . '</small>';
$options .= "<li class=\"$extraClass\">" .
"<input id=\"$itemID\"$disabled name=\"$this->name[$code]\" type=\"checkbox\" value=\"$code\"$checked class=\"checkbox\" />" .
"<label {$title}for=\"$itemID\">$value$inheritMessage</label>" .
"</li>\n";
// If the field is readonly, add a span that will replace the disabled checkbox input
if($this->readonly) {
$options .= "<li class=\"$extraClass\">" .
"<input id=\"$itemID\"$disabled name=\"$this->name[$code]\" type=\"checkbox\" value=\"$code\"$checked class=\"checkbox\" />" .
"<label {$title}for=\"$itemID\"><span class=\"ui-button-icon-primary ui-icon btn-icon-accept\"></span>$value$inheritMessage</label>" .
"</li>\n";
} else {
$options .= "<li class=\"$extraClass\">" .
"<input id=\"$itemID\"$disabled name=\"$this->name[$code]\" type=\"checkbox\" value=\"$code\"$checked class=\"checkbox\" />" .
"<label {$title}for=\"$itemID\">$value$inheritMessage</label>" .
"</li>\n";
}
}
}
}
return "<ul id=\"{$this->id()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n$options</ul>\n";
if($this->readonly) {
return "<ul id=\"{$this->id()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n<li class=\"help\">Assigning groups to this user will adjust the permissions they have. See the groups section for details of permissions on individual groups.</li>$options</ul>\n";
} else {
return "<ul id=\"{$this->id()}\" class=\"optionset checkboxsetfield{$this->extraClass()}\">\n$options</ul>\n";
}
}
/**