Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #16009 - Added styling to form templates to enable floating button groups #17523

Merged
merged 10 commits into from
Oct 15, 2024

Conversation

atownson
Copy link
Contributor

Fixes: #16009

Created a new style class, btn-float-group , and added to object_edit, bulk_edit, and filter_list templates.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @atownson! We should "float' the bulk operation buttons for object list views too.

position: sticky;
bottom: 0px;
z-index: 1;
padding: 2px 0px 10px 0px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to add a bit more top padding. IMO vertical spacing should be the same above and below the buttons while floating.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went a different direction here. Let me know what you think. Essentially I removed the button group div background altogether, which created truly 'floating' buttons and IMO added more real estate to the form by not covering it up.

NetBox Button Illustration Rev

@@ -52,7 +52,7 @@ pre {
}

// Altering background colors
.page, .page-tabs .nav-tabs .nav-link.active {
.page, .page-tabs .nav-tabs .nav-link.active, .btn-float-group {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to avoid declaring any custom classes here, as this module should be restricted to overrides for Tabler itself. Maybe we can inherit the background color from .page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been moved to custom/_misc.scss. Inheriting from .page proved to be problematic as the class inherited many undesirable attributes.

netbox/templates/inc/filter_list.html Show resolved Hide resolved
@atownson
Copy link
Contributor Author

Nice work @atownson! We should "float' the bulk operation buttons for object list views too.

I took a look at 'floating' the object list views too. It's easy enough to implement, but I felt like the buttons were getting in the way for this form type. I suspect most users would rather have more real estate in the list rather than the convivence of accessing the bulk buttons.
NetBox Button Illustration Rev 2

Nevertheless, if you'd like for me to float these as well just let me know.

@atownson
Copy link
Contributor Author

Another thought on the list form floating buttons: What if the buttons didn't float until the user checked an item in the list, then the buttons floated? This would indicate clear intention to use the bulk buttons and provide easy accessibility to them.

@atownson
Copy link
Contributor Author

I went ahead and added the conditional floating for object list forms.
NetBox Button Illustration Rev 3

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @atownson!

@jeremystretch jeremystretch merged commit aab9656 into netbox-community:develop Oct 15, 2024
3 checks passed
@atownson atownson deleted the issue_16009 branch October 17, 2024 17:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional save / create / cancel buttons to top of forms (or make existing buttons stay visible)
2 participants