{% extends 'obj_form.html' %}
{% load i18n %}
{% load tj_filters %}

{% block css %}
    {{ block.super }}    
   
{% endblock %}



{% block js %}
    {{ block.super }}
    $('.btn-save').click(function(){
        $.SubmitForm('#obj_form form','{{request.path}}');
    });
	
	var page_length = 10;

    var table = $('#tb').DataTable({
        dom: 'Bfrtip',
        autoWidth: true,
        pageLength: page_length,
        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();
            }
        });
    });
	$('#tb a').click(function(event){
            event.preventDefault();    
            $.RefreshContent($(this).attr('href'));            
    });
   
{% endblock %}

 
{% block subtitle-1 %}
    {% trans '供应商管理' %}
{% endblock %}
{% block subtitle-2 %}
    {% trans '资质图片管理' %}
{% endblock %}      





{% block form_content %}
    {{ block.super }}
    
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '图片类型:' %} </label>
        <div class="col-sm-10">{{ form.category }}</div>
    </div>   
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '图片上传:' %} </label>
        <div class="col-sm-10">{{ form.photo }}</div>
    </div>   
    
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% trans '备注说明:' %} </label>
        <div class="col-sm-10">{{ form.remark }}</div>
    </div>   
    <div>
        <a class="btn btn-primary btn-save" type="submit" style="float:right;">{% trans '保存' %}</a>
    </div>



<div class="col-md-12 col-sm-12 col-xs-12" style="margin-top:20px">
    <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>

{% endblock %}