{% extends "admin/change_form.html" %}
{% load i18n admin_urls %}

{% block object-tools-items %}
{% url opts|admin_urlname:'permissions' original.pk|admin_urlquote as history_url %}
    <li><a href="{% add_preserved_filters history_url %}" class="permissionslink"><i class="fas fa-history"></i>{% trans "Object permissions" %}</a></li>
    &nbsp;&nbsp;
    <button type="button" class="el-button asdf el-button--small el-button--default" onclick="myFunction()">
        <!---->
        <i class="fa fa-address-book" aria-hidden="true"></i>
        <span>对象权限</span>
    </button>

    {{ block.super }}

{% endblock %}

{% block content %}
    {{ block.super }}
    <script type="text/javascript">
        function myFunction()
        {
             var mo2g = '<span id="mo2g"></span>';
            //给A标签中的文字添加一个能被jQuery捕获的元素
            $('.permissionslink').append(mo2g);
            //模拟点击A标签中的文字
            $('#mo2g').click();

        }
    </script>

    <style type="text/css">
        .permissionslink {
            display: none!important;
        }
    </style>
{% endblock %}