Project

General

Profile

Feature #15340 ยป ISSUE_TYPE_CUSTOM_FIELDS.diff

Auto-format text fields to links to issues - Pierre Luce, 2014-01-08 19:22

View differences:

app/helpers/issues_helper.rb (copie de travail)
172 172
    n = 0
173 173
    ordered_values.compact.each do |value|
174 174
      css = "cf_#{value.custom_field.id}"
175
	  val = show_value(value)
175 176
      s << "</tr>\n<tr>\n" if n > 0 && (n % 2) == 0
176
      s << "\t<th class=\"#{css}\">#{ h(value.custom_field.name) }:</th><td class=\"#{css}\">#{ h(show_value(value)) }</td>\n"
177
	  s << "\t<th class=\"#{css}\">#{ h(value.custom_field.name) }:</th><td class=\"#{css}\">" 
178
	  if val[0,1] == "#"
179
		if val.include? ","
180
		  s << "<ul style=\"margin:0; padding-left: 10px\">"
181
		  val.split(',').each do |theVal|
182
			s << "<li>" << link_to_issue(Issue.find_by_id(theVal[1,theVal.length]), :truncate => 60) << "</li>"
183
		  end
184
		  s << "</ul>"
185
		else	
186
		  s << link_to_issue(Issue.find_by_id(val[1,val.length]), :truncate => 60)
187
		end
188
	  else
189
	    s << "#{ h(val) }"
190
	  end
191
	  s << "</td>\n"
177 192
      n += 1
178 193
    end
179 194
    s << "</tr>\n"
    (1-1/1)