解决查看文本页面内容未换行Bug

修改文本页面行号样式居上
修改新增评审在没有的时候引发的Bug
This commit is contained in:
linhk 2014-08-22 11:04:32 +08:00
parent 08cde8a142
commit e900e6d6fd
2 changed files with 9 additions and 7 deletions

View File

@ -4,14 +4,16 @@
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp<span class="size">
<%= link = link_to(l(:button_add), {:controller => 'code_review',
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size">
<% 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 %>
</span></p>
</div>
&nbsp;
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>

View File

@ -1,14 +1,14 @@
<div class="autoscroll">
<table class="filecontent syntaxhl">
<table class="filecontent syntaxhl" >
<tbody>
<% line_num = 1 %>
<% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>
<tr>
<th class="line-num" id="L<%= line_num %>">
<a href="#L<%= line_num %>"><%= line_num %></a>
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;">
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a>
</th>
<td class="line-code">
<pre><%= line.html_safe %></pre>
<pre style="width:880px;word-wrap: break-word; word-break: normal; "><%= line.html_safe %></pre>
</td>
</tr>
<% line_num += 1 %>