{% load i18n %}

<script type="text/javascript">
    $(document).ready(function(){
        var table=$('#tb').DataTable({
            dom: 'Bfrtip',
            autoWidth: true,
            buttons: [{extend:'excelHtml5',text: '导出到Excel'}],   
            language:lng,          
            data:{{data|safe}}
        });     
        table.columns().every( function () {                        
            var that = this;             
            $('input', this.footer() ).on( 'keyup change clear', function () {
                if ( that.search() !== this.value ) {
                    that.search( this.value ).draw();
                }
            });
        });    


        
        $('#data-content .btn-add').click(function(event){     
            $(this).hide();
            event.stopPropagation()
            event.preventDefault(); 
            $.RefreshContent($(this).attr('href'));            
        });  
        

        

        $('#tb').on("click","td a",function(event){
            event.preventDefault();    
            $.RefreshContent($(this).attr('href'));            
        });         
    });
</script>


<ol class="breadcrumb">
    <li>{% trans "公司管理" %}</li>
    <li>{% trans "稽察授权" %}</li>   

    {% if show_add %}
        <a type="button" class='btn btn-add pull-right' href="/company/bugsell/mktinspection/edit/">
            <span class='glyphicon glyphicon-plus' style='padding-right:5px;'></span>
            {% trans '新建' %}
        </a>
    {% endif %}
</ol>



<div class="col-md-12 col-sm-12 col-xs-12">
    <div>稽察授权模式：
        <span style="color:green;">{{schema}}</span>
    </div>
    <div class="x_panel">
        <div  class="table-responsive">
            <table id='tb'  class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
            <thead>
                {% for c in clmns %}
                    <th>{{c}}</th>
                {% endfor %}
            </thead>
            <tbody></tbody>
            <tfoot>
                {% for c in clmns %}
                    <th><input type="text" placeholder="{{c}}"></th>            
                {% endfor %}            
            </tfoot>
            </table>
        </div>
    </div>
</div
