Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Output uneditable values as text-only. Provide a darker background co…
…lor to read-only fields. (CO-2586) (#59)
arlen committed Mar 31, 2023
1 parent adbe473 commit 57cecc7
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/View/Helper/FieldHelper.php
@@ -118,6 +118,9 @@ public function control(string $fieldName,
// This is a read-only timestamp, use the field to render itself
$control = $this->viewObj->$fieldName->nice();
$isRequired = false;
} elseif(!$this->editable) {
// Just output the field value.
$control = $this->viewObj->$fieldName;
} else {
if($fieldType == 'boolean') {
// A boolean field is a checkbox. Include the label with the field.
3 changes: 3 additions & 0 deletions app/webroot/css/co-base.css
@@ -1059,6 +1059,9 @@ ul.form-list input[type="number"]:focus,
ul.form-list input[type="password"]:focus {
background-color: var(--cmg-color-yellow-004);
}
ul.form-list input[readonly="readonly"] {
background-color: var(--cmg-color-lightgray-004);
}
ul.form-list select {
font-size: 0.9em;
}

0 comments on commit 57cecc7

Please sign in to comment.