mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-23 12:01:46 +00:00
Reduce view code duplication by using a nested layout for file rendering (#22058).
Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@15322 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
1013e77e16
commit
00e37d5ca7
@ -1,11 +1,4 @@
|
||||
<h2><%=h @attachment.filename %></h2>
|
||||
|
||||
<div class="attachments">
|
||||
<p><%= "#{@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></p>
|
||||
</div>
|
||||
<%= render :layout => 'layouts/file' do %>
|
||||
<%= form_tag({}, :method => 'get') do %>
|
||||
<p>
|
||||
<%= l(:label_view_diff) %>:
|
||||
@ -14,9 +7,4 @@
|
||||
</p>
|
||||
<% end %>
|
||||
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type, :diff_style => nil} %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
<% content_for :header_tags do -%>
|
||||
<%= stylesheet_link_tag "scm" -%>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
@ -1,17 +1,4 @@
|
||||
<h2><%=h @attachment.filename %></h2>
|
||||
|
||||
<div class="attachments">
|
||||
<p><%= "#{@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></p>
|
||||
|
||||
</div>
|
||||
<%= render :layout => 'layouts/file' do %>
|
||||
|
||||
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
<% content_for :header_tags do -%>
|
||||
<%= stylesheet_link_tag "scm" -%>
|
||||
<% end -%>
|
||||
<% end %>
|
||||
|
||||
15
app/views/layouts/_file.html.erb
Normal file
15
app/views/layouts/_file.html.erb
Normal file
@ -0,0 +1,15 @@
|
||||
<h2><%=h @attachment.filename %></h2>
|
||||
|
||||
<div class="attachments">
|
||||
<p><%= "#{@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></p>
|
||||
</div>
|
||||
<%= yield %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
<% content_for :header_tags do -%>
|
||||
<%= stylesheet_link_tag "scm" -%>
|
||||
<% end -%>
|
||||
Loading…
x
Reference in New Issue
Block a user