[% WRAPPER page/wrapper.tt title=loc('Attachments for') _ " " _ page.name %]
<div id="content">

  [% IF c.req.params.plain || ! c.user.obj %]
   [% IF c.user.obj %]
    <p>(<a href="[% c.uri_for('attachments', {plain=>0}) %]">[% loc('Switch to flash uploader') %]</a>)
    
    <form action="[% c.uri_for('plain_upload') %]" enctype="multipart/form-data" method="post">
        <input type="hidden" name="plain" value="1"/>
        <input type="file" name="file"/>
        <input type="submit" name="submit" value="[% loc('Upload') %]"/>
    </form>
    
   [% END %]
    <br />
    
   [% ELSE %]
    <a href="#" id="do_upload">[% loc('Choose attachments') %]</a>
    <p>[% loc('Please select a file to attach to this page. To upload multiple files, hold CTRL while selecting multiple files in the file selection pop up window.') %] </p>
    <p>[% loc('If the flash uploader gives you problems, switch to the')%] <a href="[%c.uri_for('attachments',{plain=>1}) %]">[%loc('plain uploader')%]</a></p>
    
    <a href="[% c.uri_for('attachment/list') %]" id="list_link"></a>
    <a href="[% c.uri_for('attachment/flash_upload', {id => c.user.obj.id, verify => c.user.obj.hashed(c.pref('entropy'))}) %]" id="upload_link"></a>
    
    <div id="progressbar"><div id="progress"></div></div>
    
    <h3 id="progress_status"></h3>
    
   [% END -%]
    
    <div id="attachments">
    [%+ PROCESS attachments/list.tt | indent 4 IF page.attachments.size %]
    </div>

</div>
[% END # End WRAPPER %]
