summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-22 20:33:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-12-22 20:33:01 +0000
commit3f80a89a69b2a6f3290c4ebec3a693c86eccee6a (patch)
tree71c1d95710294a3e59f344a4559cc0b2bccdb7d3 /app
parent4fd2e4aa900d170a49e42a173bc9fb0f3bfbf392 (diff)
downloadredmine-3f80a89a69b2a6f3290c4ebec3a693c86eccee6a.tar.gz
redmine-3f80a89a69b2a6f3290c4ebec3a693c86eccee6a.zip
Show view/annotate/download links on repositories/entries and repositories/annotate views (#2367).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2167 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/repositories_controller.rb3
-rw-r--r--app/views/repositories/_link_to_functions.rhtml10
-rw-r--r--app/views/repositories/annotate.rhtml2
-rw-r--r--app/views/repositories/changes.rhtml11
-rw-r--r--app/views/repositories/entry.rhtml2
5 files changed, 18 insertions, 10 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index dc2acee3a..3cec2e8e5 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -127,6 +127,9 @@ class RepositoriesController < ApplicationController
end
def annotate
+ @entry = @repository.entry(@path, @rev)
+ show_error_not_found and return unless @entry
+
@annotate = @repository.scm.annotate(@path, @rev)
render_error l(:error_scm_annotate) and return if @annotate.nil? || @annotate.empty?
end
diff --git a/app/views/repositories/_link_to_functions.rhtml b/app/views/repositories/_link_to_functions.rhtml
new file mode 100644
index 000000000..9461c99a8
--- /dev/null
+++ b/app/views/repositories/_link_to_functions.rhtml
@@ -0,0 +1,10 @@
+<p>
+<% if @repository.supports_cat? %>
+ <%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
+<% end %>
+<% if @repository.supports_annotate? %>
+ <%= link_to l(:button_annotate), {:action => 'annotate', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
+<% end %>
+<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
+<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
+</p>
diff --git a/app/views/repositories/annotate.rhtml b/app/views/repositories/annotate.rhtml
index b5669ef76..44b5a81a6 100644
--- a/app/views/repositories/annotate.rhtml
+++ b/app/views/repositories/annotate.rhtml
@@ -1,5 +1,7 @@
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
+<p><%= render :partial => 'link_to_functions' %></p>
+
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
<div class="autoscroll">
diff --git a/app/views/repositories/changes.rhtml b/app/views/repositories/changes.rhtml
index ca5c58328..aa359ef4d 100644
--- a/app/views/repositories/changes.rhtml
+++ b/app/views/repositories/changes.rhtml
@@ -1,15 +1,6 @@
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
-<p>
-<% if @repository.supports_cat? %>
- <%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
-<% end %>
-<% if @repository.supports_annotate? %>
- <%= link_to l(:button_annotate), {:action => 'annotate', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
-<% end %>
-<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
-<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
-</p>
+<p><%= render :partial => 'link_to_functions' %></p>
<%= render_properties(@properties) %>
diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml
index 8e1e1992c..12ba9f428 100644
--- a/app/views/repositories/entry.rhtml
+++ b/app/views/repositories/entry.rhtml
@@ -1,5 +1,7 @@
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
+<p><%= render :partial => 'link_to_functions' %></p>
+
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% content_for :header_tags do %>