otto-torino / django-baton

A cool, modern and responsive django admin application based on bootstrap 5 that brings AI to the Django admin - https://baton.sqrt64.it/
MIT License
859 stars 92 forks source link

Add ACTIVATE_TABS to BATON settings #282

Closed tyctor closed 5 months ago

tyctor commented 5 months ago

value of ACTIVATE_TABS is list of strings if url contain some of that strings, form tab will be activated on page for example: ACTIVATE_TABS = ["my-page-with-form"] will match url /admin/my-page-with-form/

abidibo commented 5 months ago

Hi @tyctor thank you for the contribution. Can you explain more in detail your use case?

I wonder if your necessity is already covered by the Page detection hook functionality: https://github.com/otto-torino/django-baton?tab=readme-ov-file#page-detection which requires less maintenance, tests and so on...

Let me know, bye!

tyctor commented 5 months ago

Hi, @abidibo , thanks for link, I read the documentation carelessly, yes it solves my uses case.

in my opinion, from my point of view as user, is easier to write list of strings into settings, that write javascript code.

but it is only my opinion, maybe i dont see benefits of js solution.

what you think?

abidibo commented 5 months ago

Yes, it's easier without doubt. But since the functionality already exists, and also covers more use cases (you can pretend to be in any kind of page type, not just to activate tabs) I would stay with it. Less code means less bugs, less maintenance problems, less tests and so on...

tyctor commented 5 months ago

sure, js is more generic