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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

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.

@@ -37,7 +37,7 @@
</div>
{% endif %}
</div>
<div class="card-footer text-end d-print-none border-0">
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 move these buttons outside of the card for consistency with other floating button groups. (Also, the background color is off.)

screenshot

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 is done

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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