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




{% block js %}
    {{ block.super }}
    $('.btn-save').click(function(){
        $.SubmitForm('#obj_form form','{{request.path}}');
    });
{% 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 }}
    {% if form.instance.company.has_external_code %}
        <div class="form-group ">
            <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'external_code' %}</label>
            <div class="col-sm-10">{{ form.external_code }}</div>
        </div>
    {% endif %}
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'name' %} </label>
        <div class="col-sm-10">{{ form.name }}</div>
    </div>
    <div class="form-group ">
        <label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'address' %} </label>
        <div class="col-sm-10">{{ form.address }}</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>
        <a class="btn btn-primary btn-save" type="submit" style="float:right;">{% trans '保存' %}</a>
    </div>
{% endblock %}
