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

semi-configurable selection of elements to generate tabs in admin #607

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

hovi
Copy link
Contributor

@hovi hovi commented Jul 18, 2021

#606
Draft PR suggesting direction of configurable selectors.

@hovi hovi marked this pull request as draft July 18, 2021 10:43
Copy link
Collaborator

@last-partizan last-partizan left a comment

Choose a reason for hiding this comment

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

I think i can merge it in this state.

Does it work fine for you with both, django and jazzmin templates?
Do you have any other improvements in mind?

@hovi
Copy link
Contributor Author

hovi commented Jul 18, 2021

I wouldn't merge it as it is. It's just a random draft.
It works for me, but it's not very flexible for general purposes.

In jazzmin, main select is visible, but doesn't change languages for tabs, I have to fix that..

I will think about it a bit more. I guess we could merge and then go for better separation/configuration incrementally in different PRs.

@hovi
Copy link
Contributor Author

hovi commented Jul 22, 2021

I think this is good enough for incremental merge. Go ahead and merge if you are okay with it.

A few notes:

  • js tab library also puts it's own classes and there's no way to configure "active" tab class.
  • There's problem with main select in jazzmin due to using select2 widget. Not sure exactly why, could also be because of multiple jquery instances.
  • Overall I'd say correct solution would be big refactoring with clear separation of functionality and templating. Ideal would be to make js library plugable so that js tab can be used or something else too (ex. bootstrap javascript) or make own implementation, since it should be something very very simple - just hiding/showing content based on active tab.

@hovi hovi marked this pull request as ready for review July 22, 2021 09:43
@last-partizan last-partizan merged commit eb05201 into deschler:master Jul 22, 2021
@last-partizan
Copy link
Collaborator

Merged it, thanks.

I think to refactor this is a good idea, nobody has touched it for a long time.

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.

2 participants