summaryrefslogtreecommitdiffstats
path: root/app/views/repositories
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-30 04:00:57 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-30 04:00:57 +0000
commitd97beec1d4cc773dd8fb8a5245efb040235f86b1 (patch)
treeddbd3486f207256f3072dfacf3598487792cf5de /app/views/repositories
parent24fc9a2a8e1b3f8212db890d7f82baf2d7a4b535 (diff)
downloadredmine-d97beec1d4cc773dd8fb8a5245efb040235f86b1.tar.gz
redmine-d97beec1d4cc773dd8fb8a5245efb040235f86b1.zip
Add "View annotation prior to this change" button in the annotate view of Git (#35432).
Patch by Takenori TAKAKI. git-svn-id: https://svn.redmine.org/redmine/trunk@22217 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/repositories')
-rw-r--r--app/views/repositories/annotate.html.erb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/views/repositories/annotate.html.erb b/app/views/repositories/annotate.html.erb
index de30e7c00..db91ef913 100644
--- a/app/views/repositories/annotate.html.erb
+++ b/app/views/repositories/annotate.html.erb
@@ -16,6 +16,7 @@
<% line_num = 1; previous_revision = nil %>
<% syntax_highlight_lines(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each do |line| %>
<% revision = @annotate.revisions[line_num - 1] %>
+ <% previous_annot = @annotate.previous_annotations[line_num - 1] %>
<tr id="L<%= line_num %>" class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %> <%= previous_revision && revision && revision != previous_revision ? 'bloc-change' : nil%>">
<th class="line-num"><a href="#L<%= line_num %>" data-txt="<%= line_num %>"></a></th>
<td class="revision">
@@ -31,6 +32,13 @@
<%= author.split('<').first %>
<% end %>
</td>
+ <% if @has_previous %>
+ <td class="previous">
+ <% if previous_annot && revision && revision != previous_revision %>
+ <%= link_to '', {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(previous_annot.split[1] || @path), :rev => previous_annot.split[0] }, :title => l(:label_view_previous_annotation), :class => 'icon icon-history' %>
+ <% end %>
+ </td>
+ <% end %>
<% if line == "\n" or line == "\r\n" %>
<td class="line-code"><br></td>
<% else %>