Skip to content

Output uneditable fields as text-only. Provide a darker background color to read-only fields. (CO-2586) #59

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/View/Helper/FieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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 {
$control = $this->Form->control($fieldName, $coptions);
}
Expand Down
3 changes: 3 additions & 0 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,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;
}
Expand Down