rename_issue_to_item.patch

Marius BALTEANU, 2016-12-19 01:14

Download (2.69 KB)

View differences:

app/helpers/queries_helper.rb
43 43
      end
44 44
    end
45 45
    # Don't group dates if there's only one (eg. time entries filters)
46
    if grouped[:label_date].try(:size) == 1 
46
    if grouped[:label_date].try(:size) == 1
47 47
      ungrouped << grouped.delete(:label_date).first
48 48
    end
49 49
    s = options_for_select([[]] + ungrouped)
......
164 164
                      content_tag('th', h(column.caption))
165 165
  end
166 166

  
167
  def column_content(column, issue)
168
    value = column.value_object(issue)
167
  def column_content(column, item)
168
    value = column.value_object(item)
169 169
    if value.is_a?(Array)
170
      value.collect {|v| column_value(column, issue, v)}.compact.join(', ').html_safe
170
      value.collect {|v| column_value(column, item, v)}.compact.join(', ').html_safe
171 171
    else
172
      column_value(column, issue, value)
172
      column_value(column, item, value)
173 173
    end
174 174
  end
175
  
176
  def column_value(column, issue, value)
175

  
176
  def column_value(column, item, value)
177 177
    case column.name
178 178
    when :id
179
      link_to value, issue_path(issue)
179
      link_to value, issue_path(item)
180 180
    when :subject
181
      link_to value, issue_path(issue)
181
      link_to value, issue_path(item)
182 182
    when :parent
183 183
      value ? (value.visible? ? link_to_issue(value, :subject => false) : "##{value.id}") : ''
184 184
    when :description
185
      issue.description? ? content_tag('div', textilizable(issue, :description), :class => "wiki") : ''
185
      item.description? ? content_tag('div', textilizable(item, :description), :class => "wiki") : ''
186 186
    when :done_ratio
187 187
      progress_bar(value)
188 188
    when :relations
189 189
      content_tag('span',
190
        value.to_s(issue) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe,
191
        :class => value.css_classes_for(issue))
190
        value.to_s(item) {|other| link_to_issue(other, :subject => false, :tracker => false)}.html_safe,
191
        :class => value.css_classes_for(item))
192 192
    when :hours, :spent_hours, :total_spent_hours, :estimated_hours
193 193
      format_hours(value)
194 194
    else
......
196 196
    end
197 197
  end
198 198

  
199
  def csv_content(column, issue)
200
    value = column.value_object(issue)
199
  def csv_content(column, item)
200
    value = column.value_object(item)
201 201
    if value.is_a?(Array)
202
      value.collect {|v| csv_value(column, issue, v)}.compact.join(', ')
202
      value.collect {|v| csv_value(column, item, v)}.compact.join(', ')
203 203
    else
204
      csv_value(column, issue, value)
204
      csv_value(column, item, value)
205 205
    end
206 206
  end
207 207