From afc4e0b39da2151c39a62e1fddbd36bffed5abe8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 31 Jan 2016 11:02:47 +0000 Subject: [PATCH] Adds changeset comments to diff view (#4266). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15139 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/repositories/_changeset.html.erb | 45 +++++++++++++++++++++ app/views/repositories/diff.html.erb | 2 +- app/views/repositories/revision.html.erb | 46 +--------------------- 3 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 app/views/repositories/_changeset.html.erb diff --git a/app/views/repositories/_changeset.html.erb b/app/views/repositories/_changeset.html.erb new file mode 100644 index 000000000..3c2c1c09d --- /dev/null +++ b/app/views/repositories/_changeset.html.erb @@ -0,0 +1,45 @@ +

<%= avatar(@changeset.user, :size => "24") %><%= l(:label_revision) %> <%= format_revision(@changeset) %>

+ +
+ <% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %> + + <% if @changeset.scmid.present? %> + + + + <% end %> + <% if @changeset.parents.present? %> + + + + + <% end %> + <% if @changeset.children.present? %> + + + + + <% end %> +
ID<%= @changeset.scmid %>
<%= l(:label_parent_revision) %> + <%= @changeset.parents.collect{ + |p| link_to_revision(p, @repository, :text => format_revision(p)) + }.join(", ").html_safe %> +
<%= l(:label_child_revision) %> + <%= @changeset.children.collect{ + |p| link_to_revision(p, @repository, :text => format_revision(p)) + }.join(", ").html_safe %> +
+ <% end %> + +

+ + <%= authoring(@changeset.committed_on, @changeset.author) %> + +

+
+ +<%= textilizable @changeset.comments %> + +<% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %> + <%= render :partial => 'related_issues' %> +<% end %> diff --git a/app/views/repositories/diff.html.erb b/app/views/repositories/diff.html.erb index 6a366b4e7..f4f66ade2 100644 --- a/app/views/repositories/diff.html.erb +++ b/app/views/repositories/diff.html.erb @@ -1,4 +1,4 @@ -

<%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %>

+<%= render :partial => 'changeset', :locals => {:repository => @repository, :changeset => @changeset} %> <%= form_tag({:action => 'diff', :id => @project, diff --git a/app/views/repositories/revision.html.erb b/app/views/repositories/revision.html.erb index 91c7d3b93..5c1a10e78 100644 --- a/app/views/repositories/revision.html.erb +++ b/app/views/repositories/revision.html.erb @@ -26,51 +26,7 @@ <% end %> -

<%= avatar(@changeset.user, :size => "24") %><%= l(:label_revision) %> <%= format_revision(@changeset) %>

- -
- <% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %> - - <% if @changeset.scmid.present? %> - - - - <% end %> - <% if @changeset.parents.present? %> - - - - - <% end %> - <% if @changeset.children.present? %> - - - - - <% end %> -
ID<%= @changeset.scmid %>
<%= l(:label_parent_revision) %> - <%= @changeset.parents.collect{ - |p| link_to_revision(p, @repository, :text => format_revision(p)) - }.join(", ").html_safe %> -
<%= l(:label_child_revision) %> - <%= @changeset.children.collect{ - |p| link_to_revision(p, @repository, :text => format_revision(p)) - }.join(", ").html_safe %> -
- <% end %> - -

- - <%= authoring(@changeset.committed_on, @changeset.author) %> - -

-
- -<%= textilizable @changeset.comments %> - -<% if @changeset.issues.visible.any? || User.current.allowed_to?(:manage_related_issues, @repository.project) %> - <%= render :partial => 'related_issues' %> -<% end %> +<%= render :partial => 'changeset', :locals => {:repository => @repository, :changeset => @changeset} %> <% if User.current.allowed_to?(:browse_repository, @project) %>

<%= l(:label_attachment_plural) %>

-- 2.39.5