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

"Add" button floats on top of horizontal filters #628

Open
gamesbook opened this issue Jun 27, 2017 · 9 comments · May be fixed by #774
Open

"Add" button floats on top of horizontal filters #628

gamesbook opened this issue Jun 27, 2017 · 9 comments · May be fixed by #774

Comments

@gamesbook
Copy link

If this is a bug please specify versions you're using first.

Django version: 1.10.7
Django Suit version: 2.0a1
Python version: 3.5.3

Issue:

overlap

As can be seen, on narrower screens, when there are a number of filters, the filter boxes "wrap around" but the +Add button covers part of the right-hand filter. It might be better if this was at position (a) or (b).

@Jay-Arr-HummingBird
Copy link

I'm using Python 3.7.6, suit 2.0a1 & Django 3.1.2 and am having this same problem.
Has anyone a solution for this wrap around problem?

@gamesbook
Copy link
Author

I'd really to hear one. Users will start to complain soon. Needs someone with CSS skills for this...

@pulse-mind
Copy link

How do you display filters like this ?
I am trying to migrate from V1 to V2 but on V2 my filters are not displayed Horizontally with select, they are displayed like in a regular django admin.

@gamesbook
Copy link
Author

@pulse-mind - you need to set up another tuple list with the ones that you want in this horizontal band e.g.

    list_filter = ('name', 'edit', )
    suit_list_filter_horizontal = ('name', 'edit', )

@pulse-mind
Copy link

thank you @gamesbook !!!

It works except for specific filters, I've done some overrides like this :

class DepartmentListFilter(admin.SimpleListFilter):
    title = _('Department')
    parameter_name = 'department'

    def lookups(self, request, model_admin):
    ....

    def queryset(self, request, queryset):
    ....

In my suit filter I've set something like :

suit_list_filter_horizontal = ('name', 'edit', DepartmentListFilter)

I've got "name" and "edit" but not the "DepartmentListFilter" which is working on V1.

@gamesbook
Copy link
Author

You cannot use DepartmentListFilter in the suit_list_filter_horizontal configuration. You need to use the matching parameter_name (in your case department) that you are using to configure the DepartmentListFilter class. This must also be used as a string value (in the same way as the other members of the tuple); so:

    suit_list_filter_horizontal = ('name', 'edit', 'department')

@pulse-mind
Copy link

Thank you, why thinking complex when it is easy :) !!

pulse-mind pushed a commit to pulse-mind/django-suit that referenced this issue Nov 17, 2020
pulse-mind pushed a commit to pulse-mind/django-suit that referenced this issue Nov 17, 2020
pulse-mind added a commit to pulse-mind/django-suit that referenced this issue Nov 17, 2020
* darklow#628 : manage addlink button with a lot of horizontal filters
* Update travis and settings for tests
@pulse-mind
Copy link

@gamesbook , I submit a pull request with a lot of commits. I hope darklow will accept it!.
darklow does not have time to spend on this project. I can understand that he has something else to do, this project is not a lot of money valuable but may be @darklow you can add more people in the maintainer list to allow pull requests at least ?

@gamesbook
Copy link
Author

@pulse-mind Appreciate that. I hope he can too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment