1. Andreas Schuh
  2. redmine_code_review

Commits

Andreas Schuh  committed 13ace68

Compatibility with ChiliProject. Fixed display of code review popup dialog.

Slightly modified title of code review view. It now includes the tracker name and review status. This mimics the issue view of both Redmine and ChiliProject.

Open issues when used with ChiliProject:

1) Links to comments are incorrect.
2) Link to quote comment does not work.

Note that both of these features are not available when using the plugin with Redmine. Thus, removing them from the ChiliProject version might be a valid solution. However, the quoting functionality would be a nice to have.

  • Participants
  • Parent commits 67a3dde
  • Branches default

Comments (0)

Files changed (2)

File app/views/code_review/_history.html.erb

View file
+<%
+# Code Review plugin for Redmine
+# Copyright (C) 2009  Haruyuki Iida
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+-%>
+<% for journal in journals %>
+  <%= render_journal issue, journal, :edit_permission => :edit_issue_notes,
+      :edit_own_permission => :edit_own_issue_notes %>
+<% end %>

File app/views/code_review/_show.html.erb

View file
   :html => {:class => 'icon icon-del'}) %>
 <% end -%>
 </div>
-  <h2>
-    <%= link_to '#' + @review.issue.id.to_s, :controller => 'issues', :action => 'show',
-               :id => @review.issue.id %>:
-    <%= l(:label_line_number, :line => @review.line) %>:
-    <%=h @review.subject%>
-  </h2>
- 
+
+<h2>
+  <%= link_to h(@issue.tracker.name) + ' #' +@issue.id.to_s + ' (' + h(@review.issue.status) + ')',
+          :controller => 'issues', :action => 'show', :id => @review.issue.id %>:
+  <br />
+  <%=h @review.subject %>
+</h2>
 <p class="author">
   <%= avatar(@review.user, :size => "64") %>
-        <%= authoring @review.created_at, @review.user %>.
-        <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @review.updated_at)) + '.' if @review.created_at != @review.updated_at %>
+  <br />
+  <%= authoring @review.created_at, @review.user %>.
+  <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @review.updated_at)) + '.' if @review.created_at != @review.updated_at %>
 </p>
 
-
 <table>
 <tr>
     <td style="width:20%; white-space:nowrap;" class="status"><b><%=h l(:field_status) %>:</b>
 </div>
 
 </div>
-<% if @review.issue.journals.length > 0 %>
- <h3>
-    <%=  l(:label_comment) %>
-  </h3>
+
+<% journals = @review.issue.journals.sort {|a, b| a.id <=> b.id } %>
+<% if respond_to?('render_journal') %>
+  <% # ChiliProject -%>
+  <% if journals.length > 0 %>
+    <div id="history">
+      <h3 class="rounded-background"><%= l(:label_history) %></h3>
+      <%= render :partial => 'history', :locals => { :issue => @review.issue, :journals => journals } %>
+    </div>
+  <% end %>
+<% else %>
+  <% # Redmine -%>
+  <% if journals.length > 0 %>
+    <h3><%= l(:label_comment) %></h3>
+  <% end %>
+  <%= render :partial => 'reply', :collection => journals %>
 <% end %>
 
-<%= render :partial => 'reply', :collection => @review.issue.journals.sort{|a, b| a.id <=> b.id} %>
-
-
 <% if authorize_for('code_review', 'reply') -%>
 <p><%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %></p>
 <div id="reply_<%= @review.id  %>" style="display:none;" class="box">