Project

General

Profile

Feature #12766 » column_content_add_array_and_watcher_RM_V1.2.1.diff

Jérôme BATAILLE, 2013-01-08 14:36

View differences:

app/helpers/queries_helper.rb (copie de travail)
29 29
  
30 30
  def column_content(column, issue)
31 31
    value = column.value(issue)
32
    
32

  
33
    column_content_value(column.name, value, issue)
34
  end
35

  
36
  def column_content_value(column_name, value, issue)
33 37
    case value.class.name
34 38
    when 'String'
35
      if column.name == :subject
39
      if column_name == :subject
36 40
        link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
37 41
      else
38 42
        h(value)
......
42 46
    when 'Date'
43 47
      format_date(value)
44 48
    when 'Fixnum', 'Float'
45
      if column.name == :done_ratio
49
      if column_name == :done_ratio
46 50
        progress_bar(value, :width => '80px')
47 51
      else
48 52
        value.to_s
49 53
      end
50 54
    when 'User'
51 55
      link_to_user value
56
    when 'Watcher'
57
      link_to_user value.user
52 58
    when 'Project'
53 59
      link_to_project value
54 60
    when 'Version'
......
59 65
      l(:general_text_No)
60 66
    when 'Issue'
61 67
      link_to_issue(value, :subject => false)
68
    when 'Array'
69
      value.collect{ |v|
70
        column_content_value(column_name, v, issue)
71
      }.join('<br/>')
62 72
    else
63 73
      h(value)
64 74
    end
    (1-1/1)