Commit 0f3f61b45605b14d7b586999e821a7e66c7f892b

Authored by AntonioTerceiro
1 parent 38cafc31

ActionItem85: using text_editor instead of text_area and generating a textarea with a better size



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@652 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -199,16 +199,21 @@ module ApplicationHelper
199 199 end
200 200 end
201 201  
202   - def text_editor(object, method, filter_type_method, options = {})
203   - filter_type = instance_variable_get("@#{object}").send(filter_type_method)
  202 + def text_editor(object, method, filter_type_method = nil, options = {})
  203 + filter_type =
  204 + if filter_type_method.blank?
  205 + ''
  206 + else
  207 + instance_variable_get("@#{object}").send(filter_type_method)
  208 + end
204 209 if filter_type == '[No Filter]' || filter_type.blank?
205 210 html_class = "tiny_mce_editor"
206 211 if options[:class]
207 212 html_class << " #{options[:class]}"
208 213 end
209   - text_area(object, method, { :rows => 12, :columns => 72 }.merge(options).merge({:class => html_class}))
  214 + text_area(object, method, { :size => '72x12' }.merge(options).merge({:class => html_class}))
210 215 else
211   - text_area(object, method, { :rows => 12, :columns => 72 }.merge(options))
  216 + text_area(object, method, { :size => '72x12' }.merge(options))
212 217 end
213 218 end
214 219  
... ...
app/views/membership_editor/_form.rhtml
... ... @@ -23,7 +23,7 @@
23 23 <%= text_field 'organization_info', 'economic_activity', 'size' => 20 %></p>
24 24  
25 25 <p><label for="management_information"><%= _('Management Information') %></label><br/>
26   -<%= text_area 'organization_info', 'management_information', 'cols' => 40, 'rows' => 20 %></p>
  26 +<%= text_editor 'organization_info', 'management_information' %></p>
27 27  
28 28 <p><label for="validation_entity"><%= _('Validation Entity') %></label><br/>
29 29 <%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %></p>
... ...