]> source.dussan.org Git - redmine.git/commitdiff
Adds a helper for issue heading (#7647).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Apr 2011 19:53:14 +0000 (19:53 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Apr 2011 19:53:14 +0000 (19:53 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5447 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/issues_helper.rb
app/views/issues/show.rhtml
test/unit/helpers/issues_helper_test.rb

index e4d35c217d93cd406763fdab1a37f7c38df71e99..d47b6e7fe42ac886144d57de09b94acf4ca4a4e5 100644 (file)
@@ -54,6 +54,10 @@ module IssuesHelper
       "<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
       "<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
   end
+  
+  def issue_heading(issue)
+    h("#{issue.tracker} ##{issue.id}")
+  end
     
   def render_issue_subject_with_tree(issue)
     s = ''
index 166c85e0d06af02594bde416d4f3496634396f57..9cdf3f64f15ba4081ee47994ec9d393b73182f73 100644 (file)
@@ -1,6 +1,6 @@
 <%= render :partial => 'action_menu' %>
 
-<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
+<h2><%= issue_heading(@issue) %></h2>
 
 <div class="<%= @issue.css_classes %> details">
         <%= avatar(@issue.author, :size => "50") %>
index 617cc1d60fd8fe028eeb8f30558fd3065113f48f..dcb1aed85a16e079d547ff871b3ec01cecbcdc69 100644 (file)
@@ -1,5 +1,5 @@
 # Redmine - project management software
-# Copyright (C) 2006-2010  Jean-Philippe Lang
+# Copyright (C) 2006-2011  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -43,6 +43,10 @@ class IssuesHelperTest < HelperTestCase
   def request
     @request ||= ActionController::TestRequest.new
   end
+  
+  def test_issue_heading
+    assert_equal "Bug #1", issue_heading(Issue.find(1))
+  end
 
   context "IssuesHelper#show_detail" do
     context "with no_html" do