From 3ca935240ee08d5d5d650f9d54b74d530d421674 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 16 Jul 2014 15:20:29 -0300 Subject: [PATCH] [media-panel-improvements] Published media box --- app/controllers/my_profile/cms_controller.rb | 2 +- app/views/cms/_text_editor_sidebar.html.erb | 16 ++++++++++++---- app/views/cms/media_panel/_generic.html.erb | 5 +++++ app/views/cms/media_panel/_image.html.erb | 9 +++++++++ app/views/cms/media_upload.js.erb | 7 +++++++ public/stylesheets/application.css | 21 +++++++++++++++------ 6 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 app/views/cms/media_panel/_generic.html.erb create mode 100644 app/views/cms/media_panel/_image.html.erb create mode 100644 app/views/cms/media_upload.js.erb diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 9da564e..a1dbeae 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -322,8 +322,8 @@ class CmsController < MyProfileController if request.post? @file = UploadedFile.create(:uploaded_data => params[:file], :profile => profile, :parent => parent) unless params[:file] == '' end + @file = FilePresenter.for(@file) #render :text => article_list_to_json([file]), :content_type => 'text/plain' - render :text => '' end protected diff --git a/app/views/cms/_text_editor_sidebar.html.erb b/app/views/cms/_text_editor_sidebar.html.erb index 389e09b..edb3499 100644 --- a/app/views/cms/_text_editor_sidebar.html.erb +++ b/app/views/cms/_text_editor_sidebar.html.erb @@ -19,13 +19,21 @@

<%= file_field_tag('file', :multiple => true) %>

<% end %> -