From 831bebc3090194e7030d2726335b2e5ddf872f61 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Tue, 22 Feb 2011 11:26:49 -0300 Subject: [PATCH] Added WYSIWYG editor on header/footer edition --- app/views/profile_editor/header_footer.rhtml | 4 ++-- test/functional/profile_editor_controller_test.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/profile_editor/header_footer.rhtml b/app/views/profile_editor/header_footer.rhtml index 469e9a2..6ee70c7 100644 --- a/app/views/profile_editor/header_footer.rhtml +++ b/app/views/profile_editor/header_footer.rhtml @@ -21,9 +21,9 @@ <% end %>

<%= _('Content for header ') %>

- <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;') %> + <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %>

<%= _('Content for footer') %>

- <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;') %> + <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %> <% button_bar do %> <%= submit_button(:save, _('Save')) %> <%= button(:cancel, _('Cancel'), :action => 'index') %> diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 9cbfdf1..31411a3 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -498,6 +498,12 @@ class ProfileEditorControllerTest < Test::Unit::TestCase assert_tag :tag => 'textarea', :content => 'my custom footer' end + should 'render TinyMce Editor for header and footer' do + get :header_footer, :profile => profile.identifier + assert_tag :tag => 'textarea', :attributes => { :id => 'custom_header', :class => 'mceEditor' } + assert_tag :tag => 'textarea', :attributes => { :id => 'custom_footer', :class => 'mceEditor' } + end + should 'save footer and header' do person = profile post :header_footer, :profile => profile.identifier, :custom_header => 'new header', :custom_footer => 'new footer' -- libgit2 0.21.2