summaryrefslogtreecommitdiffstats
path: root/app/views/attachments
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 19:14:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-11 19:14:52 +0000
commit00e37d5ca735ac035e7932ed33eb894459850920 (patch)
treee6a3aed71af4f8b0e23efb0b760495c0ca06a3dc /app/views/attachments
parent1013e77e165252d9765acc249ad1f09607cf0ced (diff)
downloadredmine-00e37d5ca735ac035e7932ed33eb894459850920.tar.gz
redmine-00e37d5ca735ac035e7932ed33eb894459850920.zip
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
Diffstat (limited to 'app/views/attachments')
-rw-r--r--app/views/attachments/diff.html.erb16
-rw-r--r--app/views/attachments/file.html.erb17
2 files changed, 4 insertions, 29 deletions
diff --git a/app/views/attachments/diff.html.erb b/app/views/attachments/diff.html.erb
index d125f82fd..5f5f4d7eb 100644
--- a/app/views/attachments/diff.html.erb
+++ b/app/views/attachments/diff.html.erb
@@ -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 %>
diff --git a/app/views/attachments/file.html.erb b/app/views/attachments/file.html.erb
index e507ab648..e69124923 100644
--- a/app/views/attachments/file.html.erb
+++ b/app/views/attachments/file.html.erb
@@ -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 %>
&nbsp;
<%= 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 %>