upload_files.rhtml
1.36 KB
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
42
<% if @errors %>
<div class="errorExplanation" id="errorExplanation">
<h2><%= n_('This file couldn\'t be saved', 'These %{num} files couldn\'t be saved', @errors.size) % { :num => @errors.size } %></h2>
<p><%= _('There were problems with the following files:') %> </p>
<ul>
<% for file in @uploaded_files %>
<% for msg in file.errors.full_messages %>
<li><strong><%= file.name %></strong> : <%= msg %></li>
<% end %>
<% end %>
</ul>
</div>
<% end %>
<h2><%= _('Publish media') %></h2>
<h3><%= _("Select the files you want to upload (max size %s):") % UploadedFile.max_size.to_humanreadable %></h3>
<h4><%= _('Documents, Images, Videos, Audio') %></h4>
<% form_for('uploaded_file', :url => { :action => 'upload_files' }, :html => {:multipart => true}) do |f| %>
<div id='uploaded_files'>
<% 3.times do %>
<%= render :partial => 'upload_file' %>
<% end %>
</div>
<%= hidden_field_tag('parent_id', @parent.id) if @parent %>
<%= hidden_field_tag('back_to', @back_to) if @back_to %>
<% button_bar do %>
<%= add_upload_file_field _('More files') %>
<% if @back_url %>
<%= submit_button :save, _('Upload'), :cancel => @back_url %>
<% else %>
<%= submit_button :save, _('Upload'), :cancel => {:action => (@parent ? 'view' : 'index'), :id => @parent } %>
<% end %>
<% end %>
<% end %>