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
This commit is contained in:
Jean-Philippe Lang 2007-08-12 13:57:29 +00:00
parent 64e91b2e13
commit 6862b97909
4 changed files with 8 additions and 22 deletions

View File

@ -37,13 +37,7 @@ class IssuesController < ApplicationController
def show def show
@status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user @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) @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 = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on desc")
@journals_count = @journals.length
end end
def export_pdf def export_pdf

View File

@ -1,11 +1,13 @@
<% note_id = journals.length %>
<% for journal in journals %> <% for journal in journals %>
<h4><%= format_time(journal.created_on) %> - <%= journal.user.name %></h4> <h4><div style="float:right;"><%= link_to "##{note_id}", :anchor => "note-#{note_id}" %></div>
<%= content_tag('a', '', :name => "note-#{note_id}")%>
<%= format_time(journal.created_on) %> - <%= journal.user.name %></h4>
<ul> <ul>
<% for detail in journal.details %> <% for detail in journal.details %>
<li><%= show_detail(detail) %></li> <li><%= show_detail(detail) %></li>
<% end %> <% end %>
</ul> </ul>
<% if journal.notes? %> <%= textilizable(journal.notes) unless journal.notes.blank? %>
<%= textilizable(journal.notes) %> <% note_id -= 1 %>
<% end %>
<% end %> <% end %>

View File

@ -1,6 +0,0 @@
<h3><%=l(:label_history)%></h3>
<div id="history">
<%= render :partial => 'history', :locals => { :journals => @journals } %>
</div>
<br />
<p><%= link_to l(:button_back), :action => 'show', :id => @issue %></p>

View File

@ -81,14 +81,10 @@ end %>
</div> </div>
<% end %> <% end %>
<% if @journals_count > 0 %> <% if @journals.any? %>
<div id="history" class="box"> <div id="history" class="box">
<h3><%=l(:label_history)%> <h3><%=l(:label_history)%></h3>
<% if @journals_count > @journals.length %>(<%= l(:label_last_changes, @journals.length) %>)<% end %></h3>
<%= render :partial => 'history', :locals => { :journals => @journals } %> <%= render :partial => 'history', :locals => { :journals => @journals } %>
<% if @journals_count > @journals.length %>
<p><center><small><%= link_to l(:label_change_view_all), :action => 'history', :id => @issue %></small></center></p>
<% end %>
</div> </div>
<% end %> <% end %>