custom field description

Added by gabriel scolan over 8 years ago

Hi there,

I've modified the trunk version of my instance of Redmine to add the following feature: display the custom field description as a "html-title" (<b title="my description of my_field">my_field_name</b>) when the mouse is over the custom field text. This helps the end-user to know what is expected from him for each field.

I've got a dirty solution : for this, I've modified the data model (add a field 'description' to the table custom_fields), modify the appropriate views of custom_fields (edit, show and issues/show), and modify the file custom_fields_helper.rb redefining the method "custom_field_label_tag" as follow:

  # Return custom field label tag
  def custom_field_label_tag(name, custom_value)
    description_text = custom_value.custom_field.description
    content_tag "label", "<b title=\""+ description_text.to_s + "\"> "+ + "</b>" +
    (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
    :for => "#{name}_custom_field_values_#{}",
    :class => (custom_value.errors.empty? ? nil : "error" )

It is not as beautiful as it could be :
  • no text formatting is used
  • when the description field contains multiple lines, every thing is displayed on one

do you think it could be a feature to be added in the official trunk ? if not, how this can be encapsulated in a plugin (to make it cleaner) ?

many thanks


Replies (2)

RE: custom field description - Added by S M over 6 years ago


Is your implementation still avaiable? If so, where can I find it.


RE: custom field description - Added by gabriel scolan over 6 years ago

Sorry Steve, but I have no other solutions than the dirty one presented above, and have no idea if it has been integrated in the trunk. I do not follow this anymore.