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

<link href="/static/bootstrap/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="/static/bootstrap/css/spacelab/bootstrap.min.css" rel="stylesheet" >
<link rel="icon" href="/static/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon" />
<script src="/static/js/jquery-2.1.0.min.js"></script>
<script src="/static/js/jquery.form.min.js"></script>
<script src="/static/bootstrap/js/bootbox.min.js" type="text/javascript" ></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/js/toastr-master/build/toastr.min.js"></script>
<link  href="/static/js/toastr-master/build/toastr.min.css" rel="stylesheet">
<script src="/static/bootstrap/assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="/static/js/jquery-ui/js/jquery-ui-1.10.4.custom.js"></script>
<script src='/static/js/date_picker_zh.js'></script>
<link href="/static/css/sticky-footer-navbar.css" rel="stylesheet">
<link href="/static/js/jquery-ui/css/ui-redmond/jquery-ui-1.10.4.custom.min.css" rel="Stylesheet" />



{% block js %}
    {{ block.super }}

    $('.btn-save').click(function(){
        $('.btn').hide();
        $.SubmitForm('#obj_form form','{{request.path}}');
    });

    //2020-11-24
    $('#data-content .btn-delete').click(function(){
        $.ajax({
            url:'/obj/delete/productprop/{{form.instance.id}}/',                             
            success: function(data) {
                if(data.cnt>0){  
                    toastr.success('当前产品属性已删除!', '操作成功：',
                        {timeOut: 800, positionClass: "toast-center-center"}
                    );
                    $.RefreshContent("/obj/list/productprop/");                   
                };
            },

        });       
    
    });
{% endblock %}


    {% block subtitle-1 %}
        {% trans "产品管理" %}
    {% endblock %}
    {% block subtitle-2 %}
        {% trans "产品属性" %}
    {% endblock %}
    {% block subtitle-3 %}
        {% if form.instance.id %}
            {% trans "修改" %}
        {% else %}
            {% trans "新建" %}
        {% endif %}
    {% endblock %}


{% block form_content %}
    {{ block.super }}
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'categoryprop' %} </label>
        <div class="col-sm-10">{{ form.categoryprop }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'value' %} </label>
        <div class="col-sm-10">{{ form.value }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'remark' %} </label>
        <div class="col-sm-10">{{ form.remark }}</div>
    </div>
    <div>
        {% if form.instance.id %}
            {% if is_show %}
                <a class="btn btn-danger btn-delete" type="button"  >{% trans '删除' %}</a>
            {% endif %}
        {% endif %}
        <a class="btn btn-primary btn-save" type="submit" style="float:right;">{% trans '保存' %}</a>
    </div>
{% endblock %}
