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

Document DJANGO_TABLES2_TEMPLATE setting for responsive tables #85

Open
koeaw opened this issue Feb 29, 2024 · 5 comments
Open

Document DJANGO_TABLES2_TEMPLATE setting for responsive tables #85

koeaw opened this issue Feb 29, 2024 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@koeaw
Copy link
Contributor

koeaw commented Feb 29, 2024

django-tables2's default template doesn't accommodate wide tables, but allows setting a different (global) template via the DJANGO_TABLES2_TEMPLATE variable, which affects the CSS of the table-container class.

It would be a good idea to document this, or maybe even consider what they propose in the docs:

If you use bootstrap 5 for your site, it makes sense to set the default to the bootstrap 5 template

and set this to the *-responsive.html template of whatever Bootstrap version we are using in APIS-Core and let users override this on an individual basis (should they really wish to).

Before
... table with lots of data/many columns spills over containing element:
Screenshot 2024-02-29 at 17-11-32 Title Placeholder

After
... table can be scrolled thanks to overflow being added to container:
Screenshot from 2024-02-29 17-17-08_crop

The latter was achieved by adding

DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap5-responsive.html"

to settings.

@koeaw koeaw added the documentation Improvements or additions to documentation label Feb 29, 2024
@koeaw
Copy link
Contributor Author

koeaw commented Feb 29, 2024

Relatedly, it might make sense to provide defaults for DJANGO_TABLES2_TABLE_ATTRS for better accessibility.

E.g. when we last used webpage, our tables were set to be hoverable + striped by default (the docs give an example for the former, not the latter).

@b1rger
Copy link
Member

b1rger commented Feb 29, 2024

It is already documented in the upstream django tables documentation, which is linked from our documentation. Do we have the resources to copy documentation from an upstream project and keep it up to date in our own documentation? Which of the settings of django-tables2, django-fitlersets, django-rest-framework, django crispy forms, django autocomplete light, reversion ... should we copy to our documentation?

@koeaw
Copy link
Contributor Author

koeaw commented Feb 29, 2024

Which of the settings of django-tables2, django-fitlersets, django-rest-framework, django crispy forms, django autocomplete light, reversion ... should we copy to our documentation?

Probably everything that's relevant to UX/accessibility if we don't provide it ourselves, out of the box, tbqh.

@koeaw koeaw removed their assignment Mar 20, 2024
@sennierer sennierer transferred this issue from acdh-oeaw/apis-core-rdf Jul 10, 2024
@sennierer
Copy link
Collaborator

given that we dont need to update documentation, but might want to improve default settings for more sensible tables we moved the ticket here

@koeaw
Copy link
Contributor Author

koeaw commented Jul 10, 2024

For reference, the django-tables2 settings we currently use in Frischmuth.

@koeaw koeaw changed the title Doument DJANGO_TABLES2_TEMPLATE setting for responsive tables Document DJANGO_TABLES2_TEMPLATE setting for responsive tables Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants