instiki/app/views/file/file.rhtml
Jacques Distler 7f2b16e78d File Upload Fixes
Dunno why this was buggered again. ":back" doesn't seem to function as it used to.
Also, when uploading a file from page "foo", it's important to return to "foo" after
a successful upload, rather than redirecting to the HomePage.

Finally, a favicon tweak.
2009-02-18 01:40:11 -06:00

33 lines
1.4 KiB
Text

<%-
@title = "Upload #{h @file_name}"
@hide_navigation = false
@referring_page ||= request.env["HTTP_REFERER"]
-%>
<%= error_messages_for 'file' %>
<% form_tag({ :controller => 'file', :web => @web_name, :action => 'file' },
{ 'multipart' => true , 'accept-charset' => 'utf-8' }) do %>
<div class="inputFieldWithPrompt">
<input type="hidden" name="referring_page" value="<%= h @referring_page %>" />
<%= hidden_field 'file', 'file_name' %>
<label for="file_content"><b>Content of <%= h @file_name %> to upload</b>:</label>
<br />
<input type="file" id="file_content" name="file[content]" size="40" />
<br />
Please note that the file you are uploading 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", @referring_page) %> and edit the wiki page that refers to the file.
</div>
<div class="inputFieldWithPrompt">
<label for="file_description"><b>Description</b>:</label>
<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 -%>