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


    {% block js %}
        {{ block.super }}
        $('.btn-save').click(function(){
            $.SubmitForm('#obj_form form','{{request.path}}');
        });
        {% if not form.instance.id %}
            $('#id_company').val('{{request.user.company.id}}');
            $('#id_user').val('{{request.user.id}}');
        {% endif %}
    {% endblock %}


    {% block subtitle-1 %}
        {% trans "公司管理" %}
    {% endblock %}
    {% block subtitle-2 %}
        {% trans "品牌推荐官" %}
    {% endblock %}

    <span style="margin-left:10px; color:green; ">
        {% block subtitle-3 %}
            {% if form.instance.id %}
                {% trans "修改" %}
            {% else %}
                {% trans "新建" %}
            {% endif %}
        {% endblock %}
{#        {% if form.instance.id %}#}
{#            {% block subtitle-3 %}#}
{#                {% trans "修改" %}#}
{#            {% endblock %}#}
{#        {% else %}#}
{#            {% block subtitle-3 %}#}
{#                {% trans "新建" %}#}
{#            {% endblock %}#}
{#        {% endif %}#}
    </span>



{% block form_content %}
    {{ block.super }}
    
    <div class="form-group ">
        <label class="col-sm-2 control-label ">姓名</label>
        <div class="col-sm-10">{{ form.name }}</div>
    </div>

    <div class="form-group ">
        <label class="col-sm-2 control-label ">电话</label>
        <div class="col-sm-10">{{ form.cellphone }}</div>
    </div>

    <div class="form-group ">
        <label class="col-sm-2 control-label ">地址 </label>
        <div class="col-sm-10">{{ form.address }}</div>
    </div>

    <div class="form-group ">
        <label class="col-sm-2 control-label ">关联经销商 </label>
        <div class="col-sm-10">{{ form.agent }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">关联用户 </label>
        <div class="col-sm-10">{{ form.user }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">Openid </label>
        <div class="col-sm-10">{{ form.wxopenid }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">是否通过审核 </label>
        <div class="col-sm-10">{{ form.is_active }}</div>
    </div>
    <div>
        注意：关联用户按手机号进行匹配
    </div>
    <div>
        <a class="btn btn-primary btn-save" type="button" style="float:right;">{% trans '保存' %}</a>
    </div>
{% endblock %}
