{% extends "data_edit.html" %}
{% load i18n %}

{% block form %}
{% autoescape off %} 
<tr><td>

  <table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
        {{form.name|field_as_td_h}}
      <td  >{{form.name.errors }}</td>
      
    </tr>
    <tr>
        {{form.code|field_as_td_h}}
	 
      <td  >{{form.code.errors }}<div id = "yanzheng" class="floatL Link_blue1 lineH22"><a href="javascript:void(0)" onclick="wgCheckNo('code','div_id_code',this,'{{dbapp_url}}','personnel','Department')">{%trans '验证'%}</a></div><div id='div_id_code'  class="floatL color_orange lineH22"></div></td>
     
    </tr>
    <tr>
	 {{form.parent|field_as_td_h}}
      <td  >{{form.parent.errors }}</td>
      
    </tr>


   {% for i,k in form.errors.items %}
   {{i}}{{k}}
   {% endfor %}
   

  </table>
</td></tr>

{% endautoescape %}
{% endblock %}
{% block addjs %}
$("label[for='id_code']").attr("class","required");
$(function(){
	if($("#id_edit_form").find("#id_code").val()!=""){
		$("#yanzheng").hide()
	}else{
		$("#yanzheng").show()
	}
});
{% endblock %}