Feature #15900 » 15900_attachment_icon_on_the_issue_list.patch
| app/models/issue.rb (working copy) | ||
|---|---|---|
|
@spent_hours = nil
|
||
|
@total_spent_hours = nil
|
||
|
@total_estimated_hours = nil
|
||
|
@attachment_count = nil
|
||
|
base_reload(*args)
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
end
|
||
|
end
|
||
|
|
||
|
def self.load_attachment_counts(issues)
|
||
|
if issues.any?
|
||
|
issue_ids = issues.map(&:id)
|
||
|
attachment_counts = Attachment.where(:container_type => 'Issue', :container_id => issue_ids).group(:container_id).count
|
||
|
issues.each do |issue|
|
||
|
issue.instance_variable_set("@attachment_count", attachment_counts[issue.id] || 0)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# Finds an issue relation given its id.
|
||
|
def find_relation(relation_id)
|
||
|
IssueRelation.where("issue_to_id = ? OR issue_from_id = ?", id, id).find(relation_id)
|
||
| ... | ... | |
|
Project.where(condition).having_trackers
|
||
|
end
|
||
|
|
||
|
def attachment_count
|
||
|
@attachment_count ||= attachments.count
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def after_project_change
|
||
| app/models/issue_query.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
|
||
|
issues = scope.to_a
|
||
|
Issue.load_attachment_counts(issues)
|
||
|
|
||
|
if has_column?(:spent_hours)
|
||
|
Issue.load_visible_spent_hours(issues)
|
||
| app/views/issues/_list.html.erb (working copy) | ||
|---|---|---|
|
</td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||
|
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= "has_attachments" if issue.attachment_count > 0 %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
||
|
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
|
||
|
<%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
|
||
|
</tr>
|
||
| public/stylesheets/application.css (working copy) | ||
|---|---|---|
|
tr.issue.idnt-8 td.subject {padding-left: 11em;}
|
||
|
tr.issue.idnt-9 td.subject {padding-left: 12.5em;}
|
||
|
|
||
|
tr.issue td.id {padding-left: 16px;}
|
||
|
tr.issue.has_attachments td.id {background: url(../images/attachment.png) no-repeat 0 3px;}
|
||
|
|
||
|
table.issue-report {table-layout:fixed;}
|
||
|
|
||
|
tr.entry { border: 1px solid #f8f8f8; }
|
||
- « Previous
- 1
- …
- 5
- 6
- 7
- Next »