]> source.dussan.org Git - redmine.git/commitdiff
Different icon for closed issues in search result (#992).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Jan 2009 11:01:35 +0000 (11:01 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 11 Jan 2009 11:01:35 +0000 (11:01 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2256 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
public/stylesheets/application.css
test/fixtures/issues.yml
test/functional/search_controller_test.rb

index e3a9e17ee12eac2efe8e21df12a8e934d77b6191..fa059cbd97af589e540690c5533cc5a1aff23eb5 100644 (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
index 824b4cb7bd1a6dcc6b1aac53320d857b636c42dd..e73d0df7768adce357cec1548f10effaf1440b46 100644 (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; }
index 4e1416378cb85a447a43995a8e445d91d11149c0..921ba40c44f12a25882a8a8df5c3f6a698646fb0 100644 (file)
@@ -108,4 +108,21 @@ issues_007:
   start_date: <%= 10.days.ago.to_s(:db) %>\r
   due_date: <%= Date.today.to_s(:db) %>\r
   lock_version: 0\r
+issues_008: \r
+  created_on: <%= 10.days.ago.to_date.to_s(:db) %>\r
+  project_id: 1\r
+  updated_on: <%= 10.days.ago.to_date.to_s(:db) %>\r
+  priority_id: 3\r
+  subject: Closed issue\r
+  id: 8\r
+  fixed_version_id: \r
+  category_id: \r
+  description: This is a closed issue.\r
+  tracker_id: 1\r
+  assigned_to_id: \r
+  author_id: 2\r
+  status_id: 5\r
+  start_date: \r
+  due_date: \r
+  lock_version: 0\r
   
\ No newline at end of file
index ce06ec298523460f19d91209737dc1cc3a3ec464..b804bbd283573ae063185728c51edb7cf96484d2 100644 (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