Commit 0f3f61b45605b14d7b586999e821a7e66c7f892b
1 parent
38cafc31
Exists in
master
and in
29 other branches
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
Showing
2 changed files
with
10 additions
and
5 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -199,16 +199,21 @@ module ApplicationHelper | @@ -199,16 +199,21 @@ module ApplicationHelper | ||
199 | end | 199 | end |
200 | end | 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 | if filter_type == '[No Filter]' || filter_type.blank? | 209 | if filter_type == '[No Filter]' || filter_type.blank? |
205 | html_class = "tiny_mce_editor" | 210 | html_class = "tiny_mce_editor" |
206 | if options[:class] | 211 | if options[:class] |
207 | html_class << " #{options[:class]}" | 212 | html_class << " #{options[:class]}" |
208 | end | 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 | else | 215 | else |
211 | - text_area(object, method, { :rows => 12, :columns => 72 }.merge(options)) | 216 | + text_area(object, method, { :size => '72x12' }.merge(options)) |
212 | end | 217 | end |
213 | end | 218 | end |
214 | 219 |
app/views/membership_editor/_form.rhtml
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <%= text_field 'organization_info', 'economic_activity', 'size' => 20 %></p> | 23 | <%= text_field 'organization_info', 'economic_activity', 'size' => 20 %></p> |
24 | 24 | ||
25 | <p><label for="management_information"><%= _('Management Information') %></label><br/> | 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 | <p><label for="validation_entity"><%= _('Validation Entity') %></label><br/> | 28 | <p><label for="validation_entity"><%= _('Validation Entity') %></label><br/> |
29 | <%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %></p> | 29 | <%= select 'validation_entity', 'id', @validation_entities.map{|v| [v.name, v.id]}, :include_blank => true %></p> |