Defect #41217 » fixes-project-list-when-scheduled-for-deletion.patch
app/views/projects/_list.html.erb | ||
---|---|---|
41 | 41 |
</tr> |
42 | 42 |
<% end %> |
43 | 43 |
<tr id="project-<%= entry.id %>" class="<%= cycle('odd', 'even') %> hascontextmenu <%= entry.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> |
44 |
<% if @admin_list && !entry.scheduled_for_deletion? %> |
|
45 |
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> |
|
44 |
<% if @admin_list %> |
|
45 |
<% if !entry.scheduled_for_deletion? %> |
|
46 |
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td> |
|
47 |
<% else %> |
|
48 |
<td class="checkbox hide-when-print"></td> |
|
49 |
<% end %> |
|
46 | 50 |
<% end %> |
47 | 51 |
<% @query.inline_columns.each do |column| %> |
48 | 52 |
<%= content_tag('td', column_content(column, entry), :class => column.css_classes) %> |
49 | 53 |
<% end %> |
50 |
<% if @admin_list && !entry.scheduled_for_deletion? %> |
|
51 |
<td class="buttons"><%= link_to_context_menu %></td> |
|
54 |
<% if @admin_list %> |
|
55 |
<% if !entry.scheduled_for_deletion? %> |
|
56 |
<td class="buttons"><%= link_to_context_menu %></td> |
|
57 |
<% else %> |
|
58 |
<td></td> |
|
59 |
<% end %> |
|
52 | 60 |
<% end %> |
53 | 61 |
</tr> |
54 | 62 |
<% end -%> |
test/integration/projects_test.rb | ||
---|---|---|
52 | 52 |
assert_response 404 |
53 | 53 |
end |
54 | 54 |
end |
55 | ||
56 |
def test_list_layout_when_show_projects_scheduled_for_deletion |
|
57 |
project = Project.find(1) |
|
58 |
project.status = 10 |
|
59 |
project.save! |
|
60 | ||
61 |
log_user("admin", "admin") |
|
62 | ||
63 |
get '/admin/projects', :params => { :f => ['status'], :v =>{ 'status' => ['10'] } } |
|
64 |
assert_response :success |
|
65 | ||
66 |
assert_select '#project-1' do |
|
67 |
assert_select 'td', 5 |
|
68 |
assert_select 'td.checkbox.hide-when-print' |
|
69 |
assert_select 'td.name' |
|
70 |
assert_select 'td.identifier' |
|
71 |
assert_select 'td.short_description' |
|
72 |
end |
|
73 |
end |
|
55 | 74 |
end |