Commit 831bebc3090194e7030d2726335b2e5ddf872f61

Authored by Daniela Feitosa
1 parent 91b62197

Added WYSIWYG editor on header/footer edition

(ActionItem1895)
app/views/profile_editor/header_footer.rhtml
@@ -21,9 +21,9 @@ @@ -21,9 +21,9 @@
21 </div> 21 </div>
22 <% end %> 22 <% end %>
23 <h2><%= _('Content for header ') %></h2> 23 <h2><%= _('Content for header ') %></h2>
24 - <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;') %> 24 + <%= text_area_tag(:custom_header, @header, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %>
25 <h2><%= _('Content for footer') %></h2> 25 <h2><%= _('Content for footer') %></h2>
26 - <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;') %> 26 + <%= text_area_tag(:custom_footer, @footer, :style => 'width: 100%; height: 150px;', :class => 'mceEditor') %>
27 <% button_bar do %> 27 <% button_bar do %>
28 <%= submit_button(:save, _('Save')) %> 28 <%= submit_button(:save, _('Save')) %>
29 <%= button(:cancel, _('Cancel'), :action => 'index') %> 29 <%= button(:cancel, _('Cancel'), :action => 'index') %>
test/functional/profile_editor_controller_test.rb
@@ -498,6 +498,12 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase @@ -498,6 +498,12 @@ class ProfileEditorControllerTest &lt; Test::Unit::TestCase
498 assert_tag :tag => 'textarea', :content => 'my custom footer' 498 assert_tag :tag => 'textarea', :content => 'my custom footer'
499 end 499 end
500 500
  501 + should 'render TinyMce Editor for header and footer' do
  502 + get :header_footer, :profile => profile.identifier
  503 + assert_tag :tag => 'textarea', :attributes => { :id => 'custom_header', :class => 'mceEditor' }
  504 + assert_tag :tag => 'textarea', :attributes => { :id => 'custom_footer', :class => 'mceEditor' }
  505 + end
  506 +
501 should 'save footer and header' do 507 should 'save footer and header' do
502 person = profile 508 person = profile
503 post :header_footer, :profile => profile.identifier, :custom_header => 'new header', :custom_footer => 'new footer' 509 post :header_footer, :profile => profile.identifier, :custom_header => 'new header', :custom_footer => 'new footer'