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

'Import' 'Export' 'Add <Model>' buttons not being styled #435

Closed
ghost opened this Issue Jan 12, 2014 · 10 comments

Comments

Projects
None yet
7 participants
@ghost

ghost commented Jan 12, 2014

Hi,

I am using django-import-export feature with django admin:

   class ProductAdmin(admin.ImportExportModelAdmin):
         .....

This puts 'Import' and 'Export' buttons alongside 'Add Model' button at the top of the change list view.

But when I use grappelli these buttons dont get styled in the jazzy grappelli way, rather they are just text links.

https://www.dropbox.com/s/fs52h072wfzjuaw/Screenshot%202014-01-12%2021.58.16.png

Any help/advice much appreciated.

Thanks

HT

@sehmaschine

This comment has been minimized.

Show comment
Hide comment
@sehmaschine

sehmaschine Jan 13, 2014

Owner

that´s because django-import-export uses another dom-structure for their templates. you need to overwrite their template with grappellis dom.

Owner

sehmaschine commented Jan 13, 2014

that´s because django-import-export uses another dom-structure for their templates. you need to overwrite their template with grappellis dom.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jan 13, 2014

Thanks sehmaschine,

How do I go about doing that?

ghost commented Jan 13, 2014

Thanks sehmaschine,

How do I go about doing that?

@sehmaschine

This comment has been minimized.

Show comment
Hide comment
@sehmaschine

sehmaschine Jan 13, 2014

Owner

Please take a look at the django docs – there it´s explained how to overwrite templates.

Owner

sehmaschine commented Jan 13, 2014

Please take a look at the django docs – there it´s explained how to overwrite templates.

@judithdboonstra

This comment has been minimized.

Show comment
Hide comment
@judithdboonstra

judithdboonstra Apr 9, 2014

I am wondering if you managed to properly overwrite your templates to make this work, sanjayhallan. I have overwritten mine (the system is finding them without error) - each of my import-export templates that before extended the django admin templates now extend the grappelli admin templates instead. Yet, my screen still look as you described.

Thank you in advance for whatever insight you can offer me on this issue.

I am wondering if you managed to properly overwrite your templates to make this work, sanjayhallan. I have overwritten mine (the system is finding them without error) - each of my import-export templates that before extended the django admin templates now extend the grappelli admin templates instead. Yet, my screen still look as you described.

Thank you in advance for whatever insight you can offer me on this issue.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 10, 2014

Hi - I never got around to doing this. Hope you solve it and then would be grateful if you post back any findings - Thanks.

ghost commented Apr 10, 2014

Hi - I never got around to doing this. Hope you solve it and then would be grateful if you post back any findings - Thanks.

@slawekl

This comment has been minimized.

Show comment
Hide comment
@slawekl

slawekl Nov 2, 2014

I resolved issue like suggest sehmaschine, to my project I override default import-export template - e.g. path project/template/admin/import_export/ I copy from lib/python/site-packages/import-export/templates/admin/import-export/ all htmls and I set up like in grappelli css classes and all working and looks not bad. Maybe it will be helpfull for any one.

slawekl commented Nov 2, 2014

I resolved issue like suggest sehmaschine, to my project I override default import-export template - e.g. path project/template/admin/import_export/ I copy from lib/python/site-packages/import-export/templates/admin/import-export/ all htmls and I set up like in grappelli css classes and all working and looks not bad. Maybe it will be helpfull for any one.

@AlexLoar

This comment has been minimized.

Show comment
Hide comment
@AlexLoar

AlexLoar Jan 28, 2015

@slawekl I managed to gather both apps but I still have a problem in how are showed the buttons Import, Export and Add because are hidden (are located between the word admin and Filter): dl.dropboxusercontent.com/u/23171086/image.png

@slawekl I managed to gather both apps but I still have a problem in how are showed the buttons Import, Export and Add because are hidden (are located between the word admin and Filter): dl.dropboxusercontent.com/u/23171086/image.png

@techietek

This comment has been minimized.

Show comment
Hide comment
@techietek

techietek Aug 18, 2015

I just hacked something up as I had the same issue, i haven't had time to do the import template so if someone gets a chance let me know :), you can just add those files to your template dir:

templates/admin/import_export/
https://gist.github.com/techietek/ffc53269c57549ebcb05

which should give you something like below:
screen shot 2015-08-18 at 12 32 21 pm

screen shot 2015-08-18 at 12 32 39 pm

I just hacked something up as I had the same issue, i haven't had time to do the import template so if someone gets a chance let me know :), you can just add those files to your template dir:

templates/admin/import_export/
https://gist.github.com/techietek/ffc53269c57549ebcb05

which should give you something like below:
screen shot 2015-08-18 at 12 32 21 pm

screen shot 2015-08-18 at 12 32 39 pm

@vincentleeuwen

This comment has been minimized.

Show comment
Hide comment
@vincentleeuwen

vincentleeuwen Jan 6, 2016

@techietek Works like a charm! Thanks for sharing!

@techietek Works like a charm! Thanks for sharing!

@benxy

This comment has been minimized.

Show comment
Hide comment
@benxy

benxy Nov 1, 2016

Also, note that in Django 1.9 url tag is loaded by default so it has to be removed from base.html and export.html.

http://stackoverflow.com/questions/5653497/django-load-url-from-future-yields-error-url-is-not-a-valid-tag-libra

benxy commented Nov 1, 2016

Also, note that in Django 1.9 url tag is loaded by default so it has to be removed from base.html and export.html.

http://stackoverflow.com/questions/5653497/django-load-url-from-future-yields-error-url-is-not-a-valid-tag-libra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment