diff --git a/app/views/attachments/file.html.erb b/app/views/attachments/file.html.erb index c85cbe32a..37db6f2bc 100644 --- a/app/views/attachments/file.html.erb +++ b/app/views/attachments/file.html.erb @@ -4,14 +4,16 @@

<%= h("#{@attachment.description} - ") unless @attachment.description.blank? %> <%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %>

<%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%> - (<%= number_to_human_size @attachment.filesize %>)    - <%= link = link_to(l(:button_add), {:controller => 'code_review', + (<%= number_to_human_size @attachment.filesize %>)    + + <% if @attachment!=nil&&@attachment.container_type == 'Document' %> + <%= link = link_to(l(:button_add), {:controller => 'code_review', :action => 'assign', :action_type => 'attachment', :id=>@attachment.project, :change_id => '', :attachment_id => @attachment.id, }, :class => 'icon icon-add') %> + <% end %>

-   <%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %> diff --git a/app/views/common/_file.html.erb b/app/views/common/_file.html.erb index 22126b949..d4c0875c2 100644 --- a/app/views/common/_file.html.erb +++ b/app/views/common/_file.html.erb @@ -1,14 +1,14 @@
- +
<% line_num = 1 %> <% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %> - <% line_num += 1 %>
- <%= line_num %> + + <%= line_num %> -
<%= line.html_safe %>
+
<%= line.html_safe %>