django-unfold icon indicating copy to clipboard operation
django-unfold copied to clipboard

Add support for django-reversion and django-reversion-compare

Open justinqian42 opened this issue 1 year ago • 4 comments

Hi Lukas,

I hope you're doing well. Thanks so much for your great work!

Not sure if anyone else reported this, but I found that django-reversion-compare doesn't work well with unfold. The History action button disappears and the compare pages are not correctly styled.

I'm afraid it requires some sort of work that you've done for django-import-export.

Would you consider supporting it at your earliest convenience?

Thanks in advance! Best Regards, Justin

justinqian42 avatar Jun 15 '23 05:06 justinqian42

Hi Justin, thank you very much for kind words. Would you mind to attach a screenshot?

lukasvinclav avatar Jun 17 '23 10:06 lukasvinclav

I just checked the plugin and it seems that it is necessary to add a support for django-reversion and django-reversion-compare. I personally don't have any experience with any of these plugins so I was wondering that maybe you can help me with the implementation. Do you have time to prepare PR?

lukasvinclav avatar Jun 17 '23 10:06 lukasvinclav

Hi Lukas,

Great thanks for your prompt reply. I'm so sorry for my delayed response. Been crazy busy lately.

Before giving you a simple yes or no, I might need to check with you about whether my guess is right.

So after reviewing the source code of django-admin at https://github.com/django/django/blob/stable/4.2.x/django/contrib/admin/, I learned that the history web page is based on the default template object_history.html, and it can be overridden either by specifying a modified template file under a ModelAdmin class, or by embedding that part into your or django-reversion-compare's code.

Actually, since you already provided a modified object_history template at https://github.com/unfoldadmin/django-unfold/blob/main/src/unfold/templates/admin/object_history.html, I may refer to the styling to make my own template files. And of course I will need to merge the django-reversion-compare code in to make sure the page displays correctly.

So, if my guess is right, my question is -- should I commit the code to django-reversion-compare instead? Cuz obviously its templates override yours to some extent and that messes up the styling.

Thanks again for your efforts on this great project!

Best Regards, Justin

justinqian42 avatar Jun 22 '23 10:06 justinqian42

Hi Lukas,

I've submitted PR https://github.com/unfoldadmin/django-unfold/pull/90. Please have a look when you feel free. Happy to discuss further if any questions raised.

Cheers, Justin

justinqian42 avatar Jun 26 '23 03:06 justinqian42

For third party application integration you can contact us here https://unfoldadmin.com/

lukasvinclav avatar Jul 05 '24 10:07 lukasvinclav