[BUILD STILL BROKEN] File uploads roughly speaking work (to about same extent as in 0.10)

This commit is contained in:
Alexey Verkhovsky 2005-11-14 08:38:37 +00:00
parent ac72f9b807
commit 0b1a80a852
13 changed files with 172 additions and 297 deletions

View file

@ -48,9 +48,6 @@
<input type="checkbox" name="count_pages" <%= 'checked="on"' if @web.count_pages %> />
Count pages
<br/>
<!--
File uploads are not ready for gfeneral use, and therefore are disabled in release 0.10
TODO Enable these input elements again after release 0.10
<input type="checkbox" name="allow_uploads" <%= 'checked="on"' if @web.allow_uploads %> />
Allow uploads of no more than
@ -61,7 +58,6 @@ TODO Enable these input elements again after release 0.10
allow users to upload pictures and other files and include them on wiki pages
</em>
<br/>
-->
</small>
</p>

View file

@ -1,19 +1,32 @@
<%
@title = "Upload #{@file_name}"
@title = "Upload #{h @file_name}"
@hide_navigation = false
%>
<p>
<%= error_messages_for 'file' %>
<%= form_tag({:controller => 'file', :web => @web_name, :action => 'file'}, {:multipart => true}) %>
<p>
File to upload:
<%= hidden_field 'file', 'file_name' %>
<div class="inputFieldWithPrompt">
<b>Content of <%= h @file_name %> to upload <small>(required)</small>:</b>
<br/>
<input type="file" name="file" size="40" />
</p>
<p>
<input type="submit" value="Update" /> as
<input type="text" name="author" id="authorName" value="<%= @author %>"
onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
</p>
<%= end_form_tag %>
</p>
<input type="file" name="file[content]" size="40" />
<br/>
<small>
Please note that the file you are uploadng will be named <%= h @file_name %> on the wiki -
regardless of how it is named on your computer. To change the wiki name of the file, please go
<%= link_to :back %> and edit the wiki page that refers to the file.
</small>
</div>
<div class="inputFieldWithPrompt">
<b>Description <small>(optional)</small>:</b>
<br/>
<%= text_field "file", "description", "size" => 40 %>
</div>
<div>
<input type="submit" value="Upload" /> as
<%= text_field_tag :author, @author,
:onfocus => "this.value == 'AnonymousCoward' ? this.value = '' : true;",
:onblur => "this.value == '' ? this.value = 'AnonymousCoward' : true" %>
</div>
<%= end_form_tag %>

View file

@ -55,15 +55,16 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<% end %>
</h1>
<% if @error or @flash[:error] %> <div id="error">
<hr/><p><%= escape_preserving_linefeeds(@error || @flash[:error]) %></p><hr/></div>
<% end %>
<% if @flash[:info] %> <div id="info">
<hr/><p><%= escape_preserving_linefeeds @flash[:info] %></p><hr/></div>
<% end %>
<%= render 'navigation' unless @web.nil? || @hide_navigation %>
<% if @error or @flash[:error] %>
<div class="errorExplanation"><%= escape_preserving_linefeeds(@error || @flash[:error]) %></div>
<% end %>
<%= @content_for_layout %>
<% if @show_footer %>