1 <% @folder = Folder.find(controller.folder_id)%>
\r
2 <p class="title">Upload file</p>
\r
3 <% if flash[:folder_error] %>
\r
4 <div id="error"><%= flash[:folder_error] %></div>
\r
7 <% form_tag({:action => 'do_the_upload', :folder_id => controller.folder_id}, {:multipart => true, :name => 'upload_form'}) do %>
\r
8 <%= myfile_to_file(error_messages_for('myfile')) %>
\r
9 <% if @folder.note_upload_inherited %>
\r
10 <div id="note"><%= @folder.note_upload_inherited %></div>
\r
13 <label for="myfile_name">Select file to upload:</label><br/>
\r
14 <%= file_field 'myfile', 'myfile', :onchange => 'if (document.upload_form.myfile_myfile.value.match(/\.zip$/i)) {Element.show("zip_file");} else {Element.hide("zip_file"); Element.hide("zip_help");}
\r
15 var m = document.upload_form.myfile_myfile.value.match(/(.*)[\\/\\\\]([^\\/\\\\]+\\.\\w+)$/);
\r
16 document.upload_form.myfile_newname.value = m[2];'
\r
19 <div id='newfilename'><br> New filename: <br>
\r
20 <input type='text' id='myfile_newname' name='myfile_newname' style="width:330px"/> <br> </div>
\r
23 <div id="zip_file" style="display:none;position:relative;">
\r
24 <%= check_box :zip, :yes, :onchange => "if (document.upload_form.zip_yes.checked) {document.upload_form.zip_folders_yes.checked = false; Element.hide('newfilename');} if (document.upload_form.zip_yes.checked == false && document.upload_form.zip_folders_yes.checked == false) {Element.show('newfilename')}" %>
\r
25 Extract zip file and put all files into current directory
\r
26 <a href=# onclick="Element.show('zip_help')">(help)</a><br><br>
\r
28 <%= check_box(:zip_folders, :yes, :onchange => "if (document.upload_form.zip_folders_yes.checked) {document.upload_form.zip_yes.checked = false; ; Element.hide('newfilename');} if (document.upload_form.zip_yes.checked == false && document.upload_form.zip_folders_yes.checked == false) {Element.show('newfilename')}") %>
\r
29 Extract zip files and create new directories
\r
30 <a href=# onclick="Element.show(zip_help)">(help)</a><br>
\r
33 <div id="zip_help" style="display:none;position:relative;"><font size=small><i><hr>If you choose to put all files into the current directory, they will all be extracted into the directory you are in now. However, if you choose the second option, it will replicate the directory structure of the zip file in boxroom. So, if the zip file has files with paths like MIS/Accounting/Report.doc, the new folders MIS and Accounting will be created in the current folder. Make sure the paths are correct before you upload the zip file with this option.</font></i></div>
\r
35 <%= submit_tag 'Upload' %>
\r
39 <%= link_to 'Back', :controller => 'folder', :action => 'list', :id => controller.folder_id %>
\r