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 @@ -

<%=h @attachment.filename %>

- -
-

<%= "#{@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 %>)

-
+<%= render :layout => 'layouts/file' do %> <%= form_tag({}, :method => 'get') do %>

<%= l(:label_view_diff) %>: @@ -14,9 +7,4 @@

<% 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 @@ -

<%=h @attachment.filename %>

- -
-

<%= "#{@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 %>)

- -
+<%= 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 %> diff --git a/app/views/layouts/_file.html.erb b/app/views/layouts/_file.html.erb new file mode 100644 index 000000000..7bb939a4c --- /dev/null +++ b/app/views/layouts/_file.html.erb @@ -0,0 +1,15 @@ +

<%=h @attachment.filename %>

+ +
+

<%= "#{@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 %>)

+
+<%= yield %> + +<% html_title @attachment.filename %> + +<% content_for :header_tags do -%> + <%= stylesheet_link_tag "scm" -%> +<% end -%>