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

feat(generic): add a collections filter #1567

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

b1rger
Copy link
Contributor

@b1rger b1rger commented Jan 29, 2025

Closes: #1557

@b1rger b1rger marked this pull request as ready for review January 29, 2025 16:32
@gythaogg
Copy link
Contributor

gythaogg commented Jan 30, 2025

Exclude option is cool! Tested with nomansland, works perfectly.

UI observation - excuse me if it is an artifact of improperly configured bootstrap.
The label for "collections" looks different from other form labels. In my browser it seems to take a legend tag(because it is enclosed within a fieldset?) while other form labels use the label tag, even though all of them use the same style class form-label

image

@b1rger
Copy link
Contributor Author

b1rger commented Jan 30, 2025

UI observation - excuse me if it is an artifact of improperly configured bootstrap.
The label for "collections" looks different from other form labels. In my browser it seems to take a legend tag(because it is enclosed within a fieldset?) while other form labels use the label tag, even though all of them use the same style class form-label

Ah, good catch! I had to do a lot of fiddling with the input group setup, so I totally overlooked the label. I'll have a look, maybe I can fix that

@b1rger b1rger force-pushed the birger/1557-collections-filter branch from 9e2eac9 to 2e2fc09 Compare January 30, 2025 14:02
@b1rger
Copy link
Contributor Author

b1rger commented Jan 30, 2025

UI observation - excuse me if it is an artifact of improperly configured bootstrap.
The label for "collections" looks different from other form labels. In my browser it seems to take a legend tag(because it is enclosed within a fieldset?) while other form labels use the label tag, even though all of them use the same style class form-label

Oke, so apparently this is how crispy bootstrap5 renders fieldsets. I've now set the widgets use_fieldset attribute to False, but I'm not sure if thats the right approach - it might make sense to group those elements in a fieldset, but on the other hand its only two elements. We could also set the label_class attribute on the form helper, but that would have an effect on all labels and legends.
(Maybe there is even a way to make the include/exclude select element somehow show that it refers to the collection multiselect...)

1 similar comment
@b1rger
Copy link
Contributor Author

b1rger commented Jan 30, 2025

UI observation - excuse me if it is an artifact of improperly configured bootstrap.
The label for "collections" looks different from other form labels. In my browser it seems to take a legend tag(because it is enclosed within a fieldset?) while other form labels use the label tag, even though all of them use the same style class form-label

Oke, so apparently this is how crispy bootstrap5 renders fieldsets. I've now set the widgets use_fieldset attribute to False, but I'm not sure if thats the right approach - it might make sense to group those elements in a fieldset, but on the other hand its only two elements. We could also set the label_class attribute on the form helper, but that would have an effect on all labels and legends.
(Maybe there is even a way to make the include/exclude select element somehow show that it refers to the collection multiselect...)

@b1rger b1rger requested a review from gythaogg January 30, 2025 14:25
Copy link
Contributor

@gythaogg gythaogg left a comment

Choose a reason for hiding this comment

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

So - I can confirm that the all the labels, including collections looks uniform!

@b1rger b1rger merged commit 501ab78 into main Feb 5, 2025
14 checks passed
@b1rger b1rger deleted the birger/1557-collections-filter branch February 5, 2025 05:55
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 a collections filter to the generic filterset
2 participants