Last active
August 2, 2017 13:02
-
-
Save gt11799/760251b93236e099a6594456621a57e9 to your computer and use it in GitHub Desktop.
如果修改django admin页面的右上角按钮
This file contains hidden or 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
| {% extends "admin/change_list.html" %} | |
| {% block object-tools-items %} | |
| <script> | |
| function export_file() { | |
| var export_url = '/export'; | |
| var url = window.location.href; | |
| var params = url.split('?')[1]; | |
| if (typeof(params) == undefined) { | |
| export_url += '?' + params; | |
| }; | |
| window.open(export_url); | |
| } | |
| </script> | |
| <li> | |
| <a href="#" class="grp-state-focus" onclick="export_file()">导出</a> | |
| </li> | |
| {{ block.super }} | |
| {% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment