/
_form.html.erb
41 lines (37 loc) · 1.61 KB
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<% form_for [:admin, @resource], :url => @url_override || @url,
:html => {:multipart => true} do |f| -%>
<%= f.error_messages %>
<div class='field'>
<% if action_name =~ /(edit)|(update)/ -%>
<%= link_to "Download current file", @resource.public_filename, {:title => @resource.title} -%>
<em>or</em>, replace it with this one...
<% end -%>
<%= f.file_field :uploaded_data -%>
</div>
<div class='field'>
<label>The maximum file size is <%= (Resource.attachment_options[:max_size] / 1024 / 1024) %> megabytes.</label>
</div>
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => f,
:continue_editing => false,
:hide_cancel => (@app_dialog or action_name == "insert" or from_dialog?)
} %>
<% if @app_dialog -%>
<input type='hidden' name='app_dialog' value='<%= @app_dialog %>' />
<input type='hidden' name='field' value='<%= @field %>' />
<input type='hidden' name='update_resource' value='<%= @update_resource %>' />
<input type='hidden' name='update_text' value='<%= @update_text %>' />
<input type='hidden' name='thumbnail' value='<%= @thumbnail %>' />
<input type='hidden' name='callback' value='<%= @callback %>' />
<input type='hidden' name='conditions' value='<%= @conditions %>' />
<input type='hidden' name='current_link' value='<%= @current_link %>' />
<% end -%>
<% end -%>
<% content_for :head do %>
<script type='text/javascript'>
$(document).ready(function(){
link_dialog.init();
});
</script>
<% end if from_dialog? %>