Files
netbox/netbox/project-static/styles/transitional/_forms.scss
Jason Novinger 17e5184a11 Fixes #20759: Group object types by app in permission form (#20931)
* Fixes #20759: Group object types by app in permission form

Modified the ObjectPermissionForm to use optgroups for organizing
object types by application. This shortens the display names (e.g.,
"permission" instead of "Authentication and Authorization | permission")
while maintaining clear organization through visual grouping.

Changes:
- Updated get_object_types_choices() to return nested optgroup structure
- Enhanced AvailableOptions and SelectedOptions widgets to handle optgroups
- Modified TypeScript moveOptions to preserve optgroup structure
- Added hover text showing full model names
- Styled optgroups with bold, padded labels

* Address PR feedback
2025-12-09 08:43:29 -05:00

49 lines
892 B
SCSS

// Limit the width of object edit forms
form.object-edit {
margin: auto;
max-width: 800px;
}
// Use <h3> style for field group headings
.field-group {
h2 {
@extend h3;
}
}
// Set bond font & append an asterisk to labels for required fields
.col-form-label.required {
font-weight: bold;
&:after {
position: absolute;
display: inline-block;
margin-left: 0;
font-family: 'Material Design Icons';
font-size: 8px;
content: '\f06C4';
}
}
// Set red border on form fields inside a row with .has-errors
.has-errors {
input,
select,
textarea {
border: 1px solid $red;
}
}
// Make optgroup labels sticky when scrolling through select elements
select[multiple] {
optgroup {
position: sticky;
top: 0;
background-color: var(--bs-body-bg);
font-style: normal;
font-weight: bold;
}
option {
padding-left: 0.5rem;
}
}