The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<tmpl_if NAME='PREVIEW'>
  <div class='quiki_preview'>
    <h4>Preview</h4>
    <hr />
    <tmpl_var name="CONTENT">
    <div style="clear: both"></div>
  </div>
</tmpl_if>

<script type="text/javascript">
  $(document).ready(function(){ 
    $('textarea.resizable:not(.processed)').TextAreaResizer(); 
    $('#quiki_attach_table').hide();
  });

  function attach_show() {
     var title = $('#quiki_attach_title');
     if (title.hasClass('quiki_collapsed')) {
        title.removeClass('quiki_collapsed');
        title.addClass('quiki_expanded');
     } else {
        title.removeClass('quiki_expanded');
        title.addClass('quiki_collapsed');
     }
     $('#quiki_attach_table').toggle(400);
  }

</script>

<form name="edit_form" method="post" enctype="multipart/form-data">
  <textarea id="editfield" name="text"  rows="30" cols="80" class="resizable"><tmpl_var TEXT></textarea>
  <input type="hidden" name="node" value="<tmpl_var WIKINODE>" />
  <input type="hidden" name="action" value="save" />

  <tmpl_if name=ATTACHS>
    <div id="quiki_attach_list">
      <h4 id="quiki_attach_title" style="cursor: pointer" class="quiki_collapsed"
          onClick="attach_show();">Node attachments</h4>
      <table id="quiki_attach_table">
        <tr>
          <th></th>
          <th>Identifier</th>
          <th> </th>
          <th>Size</th>
          <th>Description</th>
        </tr>
        <tmpl_loop name=ATTACHS>
          <tr>
            <td> <img src="images/paste.png" title="Copy to Textarea"
                     onClick="insertAtCursor('editfield','{{wiki:<tmpl_var ID>}}')"
                     alt="Copy to Textarea"/> </td>
            <td> <a target="_new"
                    href="data/attach/<tmpl_var name="WIKINODE">/<tmpl_var ID>"><tmpl_var ID></a> </td>
            <td> <img src="images/<tmpl_var name="MIMEIMG"/>" alt="<tmpl_var name="MIME"/>" title="<tmpl_var name="MIME"/>"/></td>
            <td style="text-align: right"> <tmpl_var SIZE > Kb</td>
            <td> <tmpl_var DESC ></td>
          </tr>
        </tmpl_loop>
      </table>
    </div>
  </tmpl_if>