From 6862b979090482785f336130952dcf5a7e97db8c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 12 Aug 2007 13:57:29 +0000 Subject: [PATCH] Removed IssuesController#history, all changes are now displayed on issues/show (not only the last 15). Added anchor links to issue notes, eg: /issues/show/1#note-3 git-svn-id: http://redmine.rubyforge.org/svn/trunk@613 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 6 ------ app/views/issues/_history.rhtml | 10 ++++++---- app/views/issues/history.rhtml | 6 ------ app/views/issues/show.rhtml | 8 ++------ 4 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 app/views/issues/history.rhtml diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 86c6bacf5..6268cd3cc 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -37,13 +37,7 @@ class IssuesController < ApplicationController def show @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user @custom_values = @issue.custom_values.find(:all, :include => :custom_field) - @journals_count = @issue.journals.count - @journals = @issue.journals.find(:all, :include => [:user, :details], :limit => 15, :order => "#{Journal.table_name}.created_on desc") - end - - def history @journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on desc") - @journals_count = @journals.length end def export_pdf diff --git a/app/views/issues/_history.rhtml b/app/views/issues/_history.rhtml index ad5141581..1ad0c235d 100644 --- a/app/views/issues/_history.rhtml +++ b/app/views/issues/_history.rhtml @@ -1,11 +1,13 @@ +<% note_id = journals.length %> <% for journal in journals %> -

<%= format_time(journal.created_on) %> - <%= journal.user.name %>

+

<%= link_to "##{note_id}", :anchor => "note-#{note_id}" %>
+ <%= content_tag('a', '', :name => "note-#{note_id}")%> + <%= format_time(journal.created_on) %> - <%= journal.user.name %>

- <% if journal.notes? %> - <%= textilizable(journal.notes) %> - <% end %> + <%= textilizable(journal.notes) unless journal.notes.blank? %> + <% note_id -= 1 %> <% end %> diff --git a/app/views/issues/history.rhtml b/app/views/issues/history.rhtml deleted file mode 100644 index 830e1fc8e..000000000 --- a/app/views/issues/history.rhtml +++ /dev/null @@ -1,6 +0,0 @@ -

<%=l(:label_history)%>

-
-<%= render :partial => 'history', :locals => { :journals => @journals } %> -
-
-

<%= link_to l(:button_back), :action => 'show', :id => @issue %>

\ No newline at end of file diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 4e5bf7b43..078ecd1f5 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -81,14 +81,10 @@ end %> <% end %> -<% if @journals_count > 0 %> +<% if @journals.any? %>
-

<%=l(:label_history)%> -<% if @journals_count > @journals.length %>(<%= l(:label_last_changes, @journals.length) %>)<% end %>

+

<%=l(:label_history)%>

<%= render :partial => 'history', :locals => { :journals => @journals } %> -<% if @journals_count > @journals.length %> -

<%= link_to l(:label_change_view_all), :action => 'history', :id => @issue %>

-<% end %>
<% end %>