-
Notifications
You must be signed in to change notification settings - Fork 258
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
Using TranslationAdmin with different admin template. #606
Comments
Hi There is no documentation on required structure, it just expects default django strcuture. You are looking in right direction. If you want to make it work, you need to identify selectors which are different from django defaults, and create something like mapping.
And then refactor code to use those custom selectors. |
Alright. If I create these configurations and function to detect template, are you willing to merge it? One more step further, this configuration can also contain classes that are used to mark created html. Mostly meaning language switching tabs. I might as well use css framework I am using (at least I hope I could do that by just modifying css, one more step would be possibility to change html too, but I don't wanna go that far). Edit: |
Yes, i'll merge it. |
Happy user of this package. I recently tried switching admin to other templates (currently experimenting with django-jazzmin).
Sadly tabs are not working there. Been debugging for a while and I think it is mostly (or only) because html structure does not match what is expected in JS code.
For example main select expects
h1
to exist in#content
to append it there (. In case of this template when I removed requirement for innerh1
, main select started working, but not the rest.https://github.com/deschler/django-modeltranslation/blob/master/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js#L466
Now after I already spent some time on this I'd like to know, if there's any documentation on this - what kind of structure is required for javascript to work or any hints, where should I look in javascript?
Think ideal scenario is if those hook elements in the templates could be somehow configurable using css selectors, but I expect that could require some more extensive refactoring. I am happy to create PR with some guidance if we find some easy solution, that can work nicely for everyone.
The text was updated successfully, but these errors were encountered: