diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index c79ce37..7f72766 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -212,12 +212,12 @@ class CmsController < MyProfileController def media_listing if params[:image_folder_id] folder = profile.articles.find(params[:image_folder_id]) if !params[:image_folder_id].blank? - @images = (folder ? folder.children : UploadedFile.find(:all, :conditions => ["profile_id = ? AND parent_id is NULL", profile ])).select { |c| c.image? } + @images = (folder ? folder.children : UploadedFile.find(:all, :order => 'created_at desc', :conditions => ["profile_id = ? AND parent_id is NULL", profile ])).select { |c| c.image? } elsif params[:document_folder_id] folder = profile.articles.find(params[:document_folder_id]) if !params[:document_folder_id].blank? - @documents = (folder ? folder.children : UploadedFile.find(:all, :conditions => ["profile_id = ? AND parent_id is NULL", profile ])).select { |c| c.kind_of?(UploadedFile) && !c.image? } + @documents = (folder ? folder.children : UploadedFile.find(:all, :order => 'created_at desc', :conditions => ["profile_id = ? AND parent_id is NULL", profile ])).select { |c| c.kind_of?(UploadedFile) && !c.image? } else - @documents = UploadedFile.find(:all, :conditions => ["profile_id = ? AND parent_id is NULL", profile ]) + @documents = UploadedFile.find(:all, :order => 'created_at desc', :conditions => ["profile_id = ? AND parent_id is NULL", profile ]) @images = @documents.select(&:image?) @documents -= @images end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a96b35b..1509efa 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -519,8 +519,8 @@ module ApplicationHelper content_tag('div', result) end - def select_folder(object, method, collection, html_options = {}, js_options = {}) - labelled_form_field(_('Folder'), select(object, method, collection.map {|f| [ profile.identifier + '/' + f.full_name, f.id ] }, html_options.merge({:include_blank => "#{profile.identifier}"}), js_options)) + def select_folder(label, object, method, collection, html_options = {}, js_options = {}) + labelled_form_field(label, select(object, method, collection.map {|f| [ profile.identifier + '/' + f.full_name, f.id ] }, html_options.merge({:include_blank => "#{profile.identifier}"}), js_options)) end def theme_option(opt = nil) diff --git a/app/views/cms/media_listing.rhtml b/app/views/cms/media_listing.rhtml index 81cc965..d5cb1f1 100644 --- a/app/views/cms/media_listing.rhtml +++ b/app/views/cms/media_listing.rhtml @@ -30,22 +30,9 @@ } registerDocumentSize(); -
<%= _('Drag images and documents to add them to the text.') %>
-<%= _("Include files in some folder or select from the list below to add images and documents to the text editor beside (max size %s)") % UploadedFile.max_size.to_humanreadable %>
+ +<%= _('Drag images and documents to add them to the text. If needed, resize images by clicking the tree icon on editor.') %>
+ +