Feature #15900 » 15900_attachment_icon_on_the_issue_list.patch
| app/models/issue.rb (working copy) | ||
|---|---|---|
| 208 | 208 |
@spent_hours = nil |
| 209 | 209 |
@total_spent_hours = nil |
| 210 | 210 |
@total_estimated_hours = nil |
| 211 |
@attachment_count = nil |
|
| 211 | 212 |
base_reload(*args) |
| 212 | 213 |
end |
| 213 | 214 |
|
| ... | ... | |
| 1007 | 1008 |
end |
| 1008 | 1009 |
end |
| 1009 | 1010 |
|
| 1011 |
def self.load_attachment_counts(issues) |
|
| 1012 |
if issues.any? |
|
| 1013 |
issue_ids = issues.map(&:id) |
|
| 1014 |
attachment_counts = Attachment.where(:container_type => 'Issue', :container_id => issue_ids).group(:container_id).count |
|
| 1015 |
issues.each do |issue| |
|
| 1016 |
issue.instance_variable_set("@attachment_count", attachment_counts[issue.id] || 0)
|
|
| 1017 |
end |
|
| 1018 |
end |
|
| 1019 |
end |
|
| 1020 |
|
|
| 1010 | 1021 |
# Finds an issue relation given its id. |
| 1011 | 1022 |
def find_relation(relation_id) |
| 1012 | 1023 |
IssueRelation.where("issue_to_id = ? OR issue_from_id = ?", id, id).find(relation_id)
|
| ... | ... | |
| 1389 | 1400 |
Project.where(condition).having_trackers |
| 1390 | 1401 |
end |
| 1391 | 1402 |
|
| 1403 |
def attachment_count |
|
| 1404 |
@attachment_count ||= attachments.count |
|
| 1405 |
end |
|
| 1406 |
|
|
| 1392 | 1407 |
private |
| 1393 | 1408 |
|
| 1394 | 1409 |
def after_project_change |
| app/models/issue_query.rb (working copy) | ||
|---|---|---|
| 359 | 359 |
end |
| 360 | 360 |
|
| 361 | 361 |
issues = scope.to_a |
| 362 |
Issue.load_attachment_counts(issues) |
|
| 362 | 363 |
|
| 363 | 364 |
if has_column?(:spent_hours) |
| 364 | 365 |
Issue.load_visible_spent_hours(issues) |
| app/views/issues/_list.html.erb (working copy) | ||
|---|---|---|
| 27 | 27 |
</td> |
| 28 | 28 |
</tr> |
| 29 | 29 |
<% end %> |
| 30 |
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
|
| 30 |
<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 %>">
|
|
| 31 | 31 |
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
|
| 32 | 32 |
<%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
|
| 33 | 33 |
</tr> |
| public/stylesheets/application.css (working copy) | ||
|---|---|---|
| 171 | 171 |
tr.issue.idnt-8 td.subject {padding-left: 11em;}
|
| 172 | 172 |
tr.issue.idnt-9 td.subject {padding-left: 12.5em;}
|
| 173 | 173 |
|
| 174 |
tr.issue td.id {padding-left: 16px;}
|
|
| 175 |
tr.issue.has_attachments td.id {background: url(../images/attachment.png) no-repeat 0 3px;}
|
|
| 176 |
|
|
| 174 | 177 |
table.issue-report {table-layout:fixed;}
|
| 175 | 178 |
|
| 176 | 179 |
tr.entry { border: 1px solid #f8f8f8; }
|
- « Previous
- 1
- …
- 5
- 6
- 7
- Next »