Different icon for closed issues in search result (#992).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2256 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-01-11 11:01:35 +00:00
parent 212bf1e2bb
commit 1ca69f2af1
4 changed files with 33 additions and 1 deletions

View File

@ -40,7 +40,8 @@ class Issue < ActiveRecord::Base
# sort by id so that limited eager loading doesn't break with postgresql
:order_column => "#{table_name}.id"
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"},
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}},
:type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }
acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]},
:author_key => :author_id

View File

@ -195,6 +195,7 @@ div#activity span.project:after, #search-results span.project:after { content: "
div#activity dd span.description, #search-results dd span.description { display:block; }
#search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; }
div#search-results-counts {float:right;}
div#search-results-counts ul { margin-top: 0.5em; }
div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; }
@ -212,6 +213,8 @@ dt.attachment { background-image: url(../images/attachment.png); }
dt.document { background-image: url(../images/document.png); }
dt.project { background-image: url(../images/projects.png); }
#search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); }
div#roadmap fieldset.related-issues { margin-bottom: 1em; }
div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; }
div#roadmap .wiki h1:first-child { display: none; }

View File

@ -108,4 +108,21 @@ issues_007:
start_date: <%= 10.days.ago.to_s(:db) %>
due_date: <%= Date.today.to_s(:db) %>
lock_version: 0
issues_008:
created_on: <%= 10.days.ago.to_date.to_s(:db) %>
project_id: 1
updated_on: <%= 10.days.ago.to_date.to_s(:db) %>
priority_id: 3
subject: Closed issue
id: 8
fixed_version_id:
category_id:
description: This is a closed issue.
tracker_id: 1
assigned_to_id:
author_id: 2
status_id: 5
start_date:
due_date:
lock_version: 0

View File

@ -45,6 +45,17 @@ class SearchControllerTest < Test::Unit::TestCase
assert_tag :a, :content => 'Changesets (4)'
end
def test_search_issues
get :index, :q => 'issue', :issues => 1
assert_response :success
assert_template 'index'
assert assigns(:results).include?(Issue.find(8))
assert assigns(:results).include?(Issue.find(5))
assert_tag :dt, :attributes => { :class => /issue closed/ },
:child => { :tag => 'a', :content => /Closed/ }
end
def test_search_project_and_subprojects
get :index, :id => 1, :q => 'recipe subproject', :scope => 'subprojects', :submit => 'Search'
assert_response :success