Helper method for custom field title.

git-svn-id: http://svn.redmine.org/redmine/trunk@14751 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-10-25 10:54:09 +00:00
parent 25b96457c1
commit 57a22c3464
6 changed files with 15 additions and 11 deletions

View File

@@ -51,6 +51,15 @@ module CustomFieldsHelper
CUSTOM_FIELDS_TABS.map {|h| [l(h[:label]), h[:name]]}
end
def custom_field_title(custom_field)
items = []
items << [l(:label_custom_field_plural), custom_fields_path]
items << [l(custom_field.type_name), custom_fields_path(:tab => custom_field.class.name)] if custom_field
items << (custom_field.nil? || custom_field.new_record? ? l(:label_custom_field_new) : custom_field.name)
title(*items)
end
def render_custom_field_format_partial(form, custom_field)
partial = custom_field.format.form_partial
if partial