diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-08 18:26:39 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-08 18:26:39 +0000 |
commit | d77c1d2829f985c418442940c623ec6ec5d5457b (patch) | |
tree | 306c57c239f36e81c78a2642a911ccf3bed280ef /app/views | |
parent | e833cab30e19b5c9d17db405660f081923482f11 (diff) | |
download | redmine-d77c1d2829f985c418442940c623ec6ec5d5457b.tar.gz redmine-d77c1d2829f985c418442940c623ec6ec5d5457b.zip |
Unified diff viewer for attached files with .patch or .diff extension (#1403).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1516 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/attachments/_links.rhtml | 2 | ||||
-rw-r--r-- | app/views/attachments/diff.rhtml | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/app/views/attachments/_links.rhtml b/app/views/attachments/_links.rhtml index 4d485548b..9e3ac747c 100644 --- a/app/views/attachments/_links.rhtml +++ b/app/views/attachments/_links.rhtml @@ -1,6 +1,6 @@ <div class="attachments"> <% for attachment in attachments %> -<p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'download', :id => attachment }, :class => 'icon icon-attachment' -%> +<p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'show', :id => attachment }, :class => 'icon icon-attachment' -%> <%= h(" - #{attachment.description}") unless attachment.description.blank? %> <span class="size">(<%= number_to_human_size attachment.filesize %>)</span> <% if options[:delete_url] %> diff --git a/app/views/attachments/diff.rhtml b/app/views/attachments/diff.rhtml new file mode 100644 index 000000000..4a9f5c9bd --- /dev/null +++ b/app/views/attachments/diff.rhtml @@ -0,0 +1,15 @@ +<h2><%=h @attachment.filename %></h2> + +<div class="attachments"> +<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %> + <span class="author"><%= @attachment.author %>, <%= format_time(@attachment.created_on) %></span></p> +<p><%= link_to l(:button_download), {:controller => 'attachments', :action => 'download', :id => @attachment } -%> + <span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p> + +</div> + +<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %> + +<% content_for :header_tags do -%> + <%= stylesheet_link_tag "scm" -%> +<% end -%> |