Commit 8bf75114c07289cadf0ebadbfbe5ea5e1252693e
1 parent
fae9f463
Exists in
master
and in
29 other branches
[media-panel-improvements] Multiple files upload
Showing
2 changed files
with
2 additions
and
5 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
... | ... | @@ -320,9 +320,8 @@ class CmsController < MyProfileController |
320 | 320 | def media_upload |
321 | 321 | files_uploaded = [] |
322 | 322 | parent = check_parent(params[:parent_id]) |
323 | - files = [:file1,:file2, :file3].map { |f| params[f] }.compact | |
324 | 323 | if request.post? |
325 | - files.each do |file| | |
324 | + params[:images].each do |file| | |
326 | 325 | files_uploaded << UploadedFile.create(:uploaded_data => file, :profile => profile, :parent => parent) unless file == '' |
327 | 326 | end |
328 | 327 | end | ... | ... |
app/views/cms/_text_editor_sidebar.html.erb
... | ... | @@ -16,9 +16,7 @@ |
16 | 16 | "type='Folder' or type='Gallery'" |
17 | 17 | ) %> |
18 | 18 | </div> |
19 | - <p><%= file_field_tag('file1') %></p> | |
20 | - <p><%= file_field_tag('file2') %></p> | |
21 | - <p><%= file_field_tag('file3') %></p> | |
19 | + <p><%= file_field_tag('images[]', :multiple => true) %></p> | |
22 | 20 | <% button_bar do %> |
23 | 21 | <%= submit_button(:save, _('Upload')) %> |
24 | 22 | <% end %> | ... | ... |