Fantomas42 / django-blog-zinnia

Simple yet powerful and really extendable application for managing a blog within your Django Web site.
http://django-blog-zinnia.com/
BSD 3-Clause "New" or "Revised" License
2.12k stars 730 forks source link

Zinnia/admin/entry classes conflict with bootstrap #518

Open odama626 opened 7 years ago

odama626 commented 7 years ago

Actual behavior

expanding fieldsets are set to display none

Expected behavior

open, close

I did some digging and found that it would be a really simple change (at least here) to get it compatible simply adding the 'in' class to each one of the field entries make it work as expected.

'classes': ('collapse', 'collapse-closed')}), to 'classes': ('collapse in', 'collapse-closed')}),

Steps to reproduce the issue

  1. override admin template, add bootstrap
  2. /admin/zinnia/entry/add
  3. click show on any fieldset

Specifications

I checked all three of your current branches, stylesheet collision would still occur

Disclaimer

Please read these questions carefully and answer honestly with an x into all the boxes [ ]:

Fantomas42 commented 7 years ago

Hello,

Do you have an example to reproduce the step one ? In this way I can see the fix.

odama626 commented 6 years ago

Sorry, I didn't see the reply until you closed it.

https://getbootstrap.com/docs/4.0/components/collapse/

bootstrap's collapse class hides content where as your collapse class shows content.

The conflict is the fieldsets classes in admin/entry.py https://github.com/Fantomas42/django-blog-zinnia/blob/develop/zinnia/admin/entry.py

and possibly other places, after having thought about it since creating the issue.

I fixed the issue personally by adding a second class 'in' and changing the css to be

.collapse.in { }

Not elegant in the least but it resolved the conflict in my particular situation.

Furthermore, I don't think this would be trivial to fix because it would be a breaking change for anyone that has extended the fieldsets.