Project

General

Profile

« Previous | Next » 

Revision 613

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

View differences:

trunk/app/controllers/issues_controller.rb
37 37
  def show
38 38
    @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user
39 39
    @custom_values = @issue.custom_values.find(:all, :include => :custom_field)
40
    @journals_count = @issue.journals.count
41
    @journals = @issue.journals.find(:all, :include => [:user, :details], :limit => 15, :order => "#{Journal.table_name}.created_on desc")
42
  end
43
  
44
  def history
45 40
    @journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on desc")
46
    @journals_count = @journals.length  
47 41
  end
48 42
  
49 43
  def export_pdf
trunk/app/views/issues/history.rhtml
1
<h3><%=l(:label_history)%></h3>
2
<div id="history">
3
<%= render :partial => 'history', :locals => { :journals => @journals } %>
4
</div>
5
<br />
6
<p><%= link_to l(:button_back), :action => 'show', :id => @issue %></p>
7 0

  
trunk/app/views/issues/_history.rhtml
1
<% note_id = journals.length %>
1 2
<% for journal in journals %>
2
	<h4><%= format_time(journal.created_on) %> - <%= journal.user.name %></h4>
3
	<h4><div style="float:right;"><%= link_to "##{note_id}", :anchor => "note-#{note_id}" %></div>
4
	<%= content_tag('a', '', :name => "note-#{note_id}")%>
5
	<%= format_time(journal.created_on) %> - <%= journal.user.name %></h4>
3 6
	<ul>
4 7
	<% for detail in journal.details %>
5 8
	   <li><%= show_detail(detail) %></li>
6 9
	<% end %>
7 10
	</ul>
8
	<% if journal.notes? %>
9
    	<%= textilizable(journal.notes) %>
10
	<% end %>
11
  	<%= textilizable(journal.notes) unless journal.notes.blank? %>
12
  	<% note_id -= 1 %>
11 13
<% end %>
trunk/app/views/issues/show.rhtml
81 81
</div>
82 82
<% end %>
83 83

  
84
<% if @journals_count > 0 %>
84
<% if @journals.any? %>
85 85
<div id="history" class="box">
86
<h3><%=l(:label_history)%>
87
<% if @journals_count > @journals.length %>(<%= l(:label_last_changes, @journals.length) %>)<% end %></h3>
86
<h3><%=l(:label_history)%></h3>
88 87
<%= render :partial => 'history', :locals => { :journals => @journals } %>
89
<% if @journals_count > @journals.length %>
90
    <p><center><small><%= link_to l(:label_change_view_all), :action => 'history', :id => @issue %></small></center></p>
91
<% end %>
92 88
</div>
93 89
<% end %>
94 90

  

Also available in: Unified diff