abogushov / django-admin-json-editor

Adds json-editor for JSONField in Django Administration
MIT License
173 stars 61 forks source link

Fixes rendering issues with django 2.2 #35

Open karangupta31 opened 3 years ago

karangupta31 commented 3 years ago

The issues being faced with the bootstrap not rendering properly seem to be because of the django "aligned" class on fieldsets. I have added 2 options to the plugin to remove the aligned class from the plugin.

This is a workaround till we don't have a proper solution.

xrmx commented 3 years ago

This is more adding a new theme than fixing some rendering issues. Then you are removing django admin classes from javascript which does not seem the proper way to handle that, have you tried overriding stuff in css instead? BTW have you tried using the html theme?

karangupta31 commented 3 years ago

This is more adding a new theme than fixing some rendering issues. Then you are removing django admin classes from javascript which does not seem the proper way to handle that, have you tried overriding stuff in css instead? BTW have you tried using the html theme?

@xrmx I added the new theme, because it looked better overall than the bootstrap theme. The html theme looked really bad.

Overriding stuff in css meant, overriding everything django class had under it. I could have changed a few things and made it work for the test scenarios, but i couldn't assure that those 2/3 or 5 overridden styling would help for any new type of property. Django classes really mess up almost every element from the plugin. I tried to be as generic as possible with the solution i implemented. I agree that this is a hack, but its definitely better than the broken state of the package. I'm open to suggestions.

I read about how django form media works and the different properties, but couldn't find anything that might remove the affect of a parent css from the child. The only 2 options i could make out was what i implemented.

karangupta31 commented 3 years ago

@abogushov Can you please take a look?