<div class="spacer">
<div class="box">
  <div class="row"
       tal:define="error_%(id)s errors/%(id)s |nothing;
    %(id)s python: request.get(%(id)r, here.%(accessor)s() and
    here.%(accessor)s() or here.getDefault('%(id)s'));"
    >
    
    <div class="label %(required)s">
      <span i18n:translate="%(id)s_text">%(label)s </span> 
      
      <div id="%(id)s_help" 
	   i18n:translate="%(id)s_help"
	class="help" 
	style="visibility:hidden">
	%(description)s
      </div>
    </div>

<script>
  function %(id)s_changeContentType(select) {
	sel = document.getElementById(select);
	if (sel) {
           sel.value = "text/structured";
        }
	return true;
}
</script>
    
<div class="field"
                 tal:attributes="class python:test(error_%(id)s, 'field error', 'field')" >

                <div tal:replace="error_%(id)s" />


    <div class="field" tal:attributes="class python:test(error_%(id)s, 'field error', 'field')" >
    <div tal:replace="error_%(id)s" />

      <textarea cols="%(cols)s" 
		rows="%(rows)s" 
		name="%(id)s"
		tabindex="#"
		onchange="%(id)s_changeContentType('%(id)s_text_format');"
		tal:attributes="tabindex tabindex/next;"
	onfocus="formtooltip('%(id)s_help',1)" 
	onblur="formtooltip('%(id)s_help',0)"
	><span tal:omit-tag="" 	
	  tal:condition="python: here.isBinary(%(id)r) != 1"
	  tal:content="here/%(id)s/getRaw | nothing">%(id)s</span></textarea>
      
      <div tal:omit-tag="" tal:define="unit python: here.getUnit(%(id)r)"
           tal:condition="python: hasattr(unit, 'isUnit')">      
      <div tal:condition="python: here.isBinary(%(id)r) == 1"
	tal:define="size unit/get_size;
	            icon unit/getIcon;"
	>
	<a href="" tal:attributes="href string: ${here/absolute_url}/%(id)s/;">
	  <img src="" tal:attributes="src string:${here/portal_url}/${icon}"/>Download %(label)s
	</a> (<span tal:content="python: str(size /1024) + 'Kb'">0Kb</span>)

      </div>
      </div>
	<a href="" tal:attributes="href string: ${here/absolute_url}/%(id)s/external_edit;"
		   tal:define="edit here/edit.gif">
	<img tal:replace="structure python:edit.tag(title='Edit with External Editor')" />
	Edit</a>

    </div>
  </div>


