forked from django-import-export/django-import-export
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request django-import-export#406 from django-import-export…
…/action_formats_js show formats selector only when export action is selected
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
Configuration | ||
============= | ||
|
||
The only mandatory configuration is adding ``import_export`` to your | ||
``INSTALLED_APPS``. This isn't necessary, if admin integration is not | ||
used. | ||
You only need to perform this configuration step if you use django-import-export in the admin. | ||
|
||
Add ``import_export`` to your ``INSTALLED_APPS``: | ||
|
||
INSTALLED_APPS = [ | ||
# ... | ||
|
||
'import_export', | ||
] | ||
|
||
Deploy static files: | ||
|
||
$ python manage.py collectstatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(function($) { | ||
$(document).on('ready', function() { | ||
$('select[name="action"]', '#changelist-form').on('change', function() { | ||
if ($(this).val() == 'export_admin_action') { | ||
$('select[name="file_format"]', '#changelist-form').parent().show(); | ||
} else { | ||
$('select[name="file_format"]', '#changelist-form').parent().hide(); | ||
} | ||
}); | ||
$('select[name="action"]', '#changelist-form').change(); | ||
}); | ||
})(django.jQuery); |