mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
91e4fde96f
commit
07bc75c281
@ -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; }
|
||||
|
@ -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;
|
||||
|
@ -85,4 +85,5 @@
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
|
@ -189,6 +189,14 @@ class PermissionCheckboxSetField extends FormField {
|
||||
if($this->readonly) $disabled = ' disabled="true"';
|
||||
|
||||
$inheritMessage = '<small>' . $inheritMessage . '</small>';
|
||||
|
||||
// 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>" .
|
||||
@ -196,9 +204,13 @@ class PermissionCheckboxSetField extends FormField {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the permission set associated with $record DataObject
|
||||
|
Loading…
x
Reference in New Issue
Block a user