Skip to content

Commit

Permalink
#13 can't show review of attachment file.
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Dec 30, 2018
1 parent b337d60 commit 6d1e4ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/code_review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def show
if action_name == 'attachment'
attachment = target.attachment
url = url_for(controller: 'attachments', action: 'show',
id: attachment.id) + '/' + URI.escape_www_form(attachment.filename)
id: attachment.id) + '/' + URI.encode(attachment.filename)
url << '?review_id=' + @review.id.to_s if @review
else
path = nil if target.diff_all
Expand Down
10 changes: 7 additions & 3 deletions app/views/code_review/_issues_show_details_bottom.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<%
unless User.current.allowed_to?({:controller => 'code_review', :action => 'show'}, project)
return
return
end

%>
Expand All @@ -18,15 +18,19 @@ review = issue.code_review
<td><b><%= l(:code_review) %>:</b></td>
<td colspan="3">
<%
label = URI.decode("#{review.repository_identifier + ':' if review.repository_identifier}#{review.path}#{'@' + review.revision if review.revision}:line #{review.line}")
if review.attachment
label = URI.decode("#{review.attachment.filename}#{'@' + review.revision if review.revision}:line #{review.line}")
else
label = URI.decode("#{review.repository_identifier + ':' if review.repository_identifier}#{review.path}#{'@' + review.revision if review.revision}:line #{review.line}")
end
-%>
<%= link_to(label,
:controller => 'code_review', :action => 'show', :id => project, :review_id => review.id, :repository_id => review.repository_identifier) %>
</td>
</tr>
<% end %>
<% if issue.code_review_assignment %>
<%
<%
assignment = issue.code_review_assignment
repository_id = assignment.repository_identifier
%>
Expand Down

0 comments on commit 6d1e4ae

Please sign in to comment.