Class: Redmine::FieldFormat::TextFormat

Inherits:
Unbounded show all
Defined in:
lib/redmine/field_format.rb

Instance Method Summary collapse

Methods inherited from Unbounded

#validate_single_value

Methods inherited from Base

#before_custom_field_save, #cast_custom_value, #cast_single_value, #cast_value, field_attributes, #formatted_custom_value, #group_statement, #join_for_order_statement, #label, #name, #order_statement, #possible_custom_value_options, #possible_values_options, #target_class, #validate_custom_field, #validate_custom_value, #validate_single_value

Methods included from I18n

#current_language, #day_letter, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #languages_options, #ll, #month_name, #set_language_if_valid, #valid_languages

Instance Method Details

#bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options = {}) ⇒ Object


313
314
315
316
317
# File 'lib/redmine/field_format.rb', line 313

def bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options={})
  view.text_area_tag(tag_name, value, options.merge(:id => tag_id, :rows => 3)) +
    '<br />'.html_safe +
    bulk_clear_tag(view, tag_id, tag_name, custom_field, value)
end

#edit_tag(view, tag_id, tag_name, custom_value, options = {}) ⇒ Object


309
310
311
# File 'lib/redmine/field_format.rb', line 309

def edit_tag(view, tag_id, tag_name, custom_value, options={})
  view.text_area_tag(tag_name, custom_value.value, options.merge(:id => tag_id, :rows => 3))
end

#formatted_value(view, custom_field, value, customized = nil, html = false) ⇒ Object


297
298
299
300
301
302
303
304
305
306
307
# File 'lib/redmine/field_format.rb', line 297

def formatted_value(view, custom_field, value, customized=nil, html=false)
  if html
    if custom_field.text_formatting == 'full'
      view.textilizable(value, :object => customized)
    else
      view.simple_format(html_escape(value))
    end
  else
    value.to_s
  end
end

#query_filter_options(custom_field, query) ⇒ Object


319
320
321
# File 'lib/redmine/field_format.rb', line 319

def query_filter_options(custom_field, query)
  {:type => :text}
end