Permalink
Browse files

ENHANCEMENT: open/7881 - removed disabled checkboxes and replaced the…

…m with green ticks. Added help text above the list of permissions. Removed action buttons by fade out when user goes to users permissions tab.
  • Loading branch information...
1 parent 91e4fde commit 07bc75c281a787e53441f159d10616b4beccba1e Jeremy Bridson committed with chillu Sep 26, 2012
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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;
@@ -83,6 +83,7 @@
}
}
});
-
+
});
+
}(jQuery));
@@ -184,20 +184,32 @@ public function Field($properties = array()) {
// show its origin automatically
$inheritMessage = ' (' . join(', ', $uninheritedCodes[$code]).')';
}
-
+
// If the field is readonly, always mark as "disabled"
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";
+ }
}
/**

0 comments on commit 07bc75c

Please sign in to comment.