From 854153e69079f5508ed8d773488b1f410e88f9bf Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 9 Aug 2011 11:27:08 -0700 Subject: [PATCH] Using the new media panel for all text editing --- app/views/cms/_text_editor_sidebar.rhtml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/views/cms/_textile_media.rhtml | 65 ----------------------------------------------------------------- app/views/cms/edit.rhtml | 7 ++----- public/stylesheets/application.css | 20 ++++++++++---------- 4 files changed, 79 insertions(+), 80 deletions(-) create mode 100644 app/views/cms/_text_editor_sidebar.rhtml delete mode 100644 app/views/cms/_textile_media.rhtml diff --git a/app/views/cms/_text_editor_sidebar.rhtml b/app/views/cms/_text_editor_sidebar.rhtml new file mode 100644 index 0000000..9c417f8 --- /dev/null +++ b/app/views/cms/_text_editor_sidebar.rhtml @@ -0,0 +1,67 @@ +
+
+

+ <%= _('Textile markup quick reference') %> + <%= link_to(_('(show)'), '#', :id => 'textile-quickref-show') %> + <%= link_to(_('(hide)'), '#', :id => 'textile-quickref-hide', :style => 'display: none') %> +

+ +
+
+

Media upload

+
+ <% form_tag({ :action => 'media_upload' }, :multipart => true) do |f| %> +
+ <%# TODO duplicated from partial upload_file_form %> + <%= labelled_form_field(_('Choose folder to upload files:'), select_tag('parent_id', options_for_select([[profile.identifier, '']] + profile.folders.collect {|f| [ profile.identifier + '/' + f.full_name, f.id ] }))) %> +
+

<%= file_field_tag('file1') %>

+

<%= file_field_tag('file2') %>

+

<%= file_field_tag('file3') %>

+ <% button_bar do %> + <%= submit_button(:save, _('Upload')) %> + <% end %> + <% end %> +
+ +
+
+

Media search

+

+ <% form_tag({ :action => 'search' }) do %> + + + + <%= submit_button :search, _('Search'), :id => 'media-search-button' %> + <% end %> +

+ + +
+
+ + diff --git a/app/views/cms/_textile_media.rhtml b/app/views/cms/_textile_media.rhtml deleted file mode 100644 index 56d94a5..0000000 --- a/app/views/cms/_textile_media.rhtml +++ /dev/null @@ -1,65 +0,0 @@ -
-
-

- <%= _('Textile markup quick reference') %> - <%= link_to(_('(show)'), '#', :id => 'textile-quickref-show') %> - <%= link_to(_('(hide)'), '#', :id => 'textile-quickref-hide', :style => 'display: none') %> -

- -
-
-

Media upload

-
- <% form_tag({ :action => 'media_upload' }, :multipart => true) do |f| %> -
- <%# TODO duplicated from partial upload_file_form %> - <%= labelled_form_field(_('Choose folder to upload files:'), select_tag('parent_id', options_for_select([[profile.identifier, '']] + profile.folders.collect {|f| [ profile.identifier + '/' + f.full_name, f.id ] }))) %> -
-

<%= file_field_tag('file1') %>

-

<%= file_field_tag('file2') %>

-

<%= file_field_tag('file3') %>

- <% button_bar do %> - <%= submit_button(:save, _('Upload')) %> - <% end %> - <% end %> -
- -
-
-

Media search

- <% form_tag({ :action => 'search' }) do %> - - - - <%= submit_button :search, _('Search'), :id => 'media-search-button' %> - <% end %> - - -
-
- - diff --git a/app/views/cms/edit.rhtml b/app/views/cms/edit.rhtml index e5a7806..566ae87 100644 --- a/app/views/cms/edit.rhtml +++ b/app/views/cms/edit.rhtml @@ -49,11 +49,8 @@ <% end %> -<% if environment.enabled?('media_panel') && [TinyMceArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %> - <%= render :partial => 'media_listing' %> -<% end %> -<% if @article.is_a?(TextileArticle) %> - <%= render :partial => 'textile_media' %> +<% if environment.enabled?('media_panel') && [TinyMceArticle, TextileArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %> + <%= render :partial => 'text_editor_sidebar' %> <% end %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index b633527..aa3ae76 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -3371,36 +3371,36 @@ div.with_media_panel .formfield input { /* Textile sidebar */ -.textile-editor-sidebar { +.text-editor-sidebar { position: absolute; width: 380px; right: 20px; top: 70px; } -.textile-editor-sidebar-box { +.text-editor-sidebar-box { background: #eeeeec; border: 1px solid #d3d7cf; padding: 10px 10px 0px 10px; margin-bottom: 10px; } -.textile-editor-sidebar-box p { +.text-editor-sidebar-box p { margin-top: 0px; } -.textile-editor-sidebar code, -.textile-editor-sidebar pre { +.text-editor-sidebar code, +.text-editor-sidebar pre { border: 1px solid #d3d7cf; color: black; padding: 2px; } -.textile-editor-sidebar .icon-loading { +.text-editor-sidebar .icon-loading { background-image: url(../images/loading-small.gif); } -.textile-editor-sidebar .media-list-results ul { +.text-editor-sidebar .media-list-results ul { padding: 0px; list-style: none; } -.textile-editor-sidebar .media-list-results li { +.text-editor-sidebar .media-list-results li { background-repeat: no-repeat; background-position: 0px 0px; padding-left: 20px; @@ -3409,11 +3409,11 @@ div.with_media_panel .formfield input { border: none; margin-bottom: 2px; } -.textile-editor-sidebar .media-list-results li:hover { +.text-editor-sidebar .media-list-results li:hover { background-color: transparent; border: none; } -.textile-editor-sidebar #media-upload-box { +.text-editor-sidebar #media-upload-box { background-repeat: no-repeat; background-position: top right ; } -- libgit2 0.21.2