summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-01 12:13:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-01 12:13:17 +0000
commit5b975706932d269a0eceee924558f428bf1cd16c (patch)
tree6e57b1c0989ce3bd5be00eb54ed29c386108e499 /app
parent71abeb5898f1ee1be88fb3071c2d7e5ea8e8028b (diff)
downloadredmine-5b975706932d269a0eceee924558f428bf1cd16c.tar.gz
redmine-5b975706932d269a0eceee924558f428bf1cd16c.zip
SCM:
* add latest changesets for the current directory when browsing the repository and a link to the full log * ability to diff a directory (#3575) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2849 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/repositories_controller.rb4
-rw-r--r--app/views/repositories/_link_to_functions.rhtml4
-rw-r--r--app/views/repositories/_revisions.rhtml2
-rw-r--r--app/views/repositories/diff.rhtml2
-rw-r--r--app/views/repositories/show.rhtml10
5 files changed, 15 insertions, 7 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index d5e1352a1..938ace9ba 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -72,9 +72,7 @@ class RepositoriesController < ApplicationController
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
else
show_error_not_found and return unless @entries
- if @path.blank?
- @changesets = @repository.latest_changesets(@path, @rev)
- end
+ @changesets = @repository.latest_changesets(@path, @rev)
@properties = @repository.properties(@path, @rev)
render :action => 'show'
end
diff --git a/app/views/repositories/_link_to_functions.rhtml b/app/views/repositories/_link_to_functions.rhtml
index a699938de..412d5f86f 100644
--- a/app/views/repositories/_link_to_functions.rhtml
+++ b/app/views/repositories/_link_to_functions.rhtml
@@ -1,3 +1,5 @@
+<% if @entry && @entry.kind == 'file' %>
+
<p>
<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
<% if @repository.supports_cat? %>
@@ -9,3 +11,5 @@
<%= 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>
+
+<% end %>
diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml
index fb0131c82..8fb15525f 100644
--- a/app/views/repositories/_revisions.rhtml
+++ b/app/views/repositories/_revisions.rhtml
@@ -9,7 +9,7 @@
<th><%= l(:field_comments) %></th>
</tr></thead>
<tbody>
-<% show_diff = entry && entry.is_file? && revisions.size > 1 %>
+<% show_diff = revisions.size > 1 %>
<% line_num = 1 %>
<% revisions.each do |changeset| %>
<tr class="changeset <%= cycle 'odd', 'even' %>">
diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml
index 8538f30de..73e13abf4 100644
--- a/app/views/repositories/diff.rhtml
+++ b/app/views/repositories/diff.rhtml
@@ -1,4 +1,4 @@
-<h2><%= l(:label_revision) %> <%= format_revision(@rev) %> <%= @path.gsub(/^.*\//, '') %></h2>
+<h2><%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %></h2>
<!-- Choose view type -->
<% form_tag({}, :method => 'get') do %>
diff --git a/app/views/repositories/show.rhtml b/app/views/repositories/show.rhtml
index a3057ddaa..35106fe6f 100644
--- a/app/views/repositories/show.rhtml
+++ b/app/views/repositories/show.rhtml
@@ -14,8 +14,14 @@
<% if @changesets && !@changesets.empty? && authorize_for('repositories', 'revisions') %>
<h3><%= l(:label_latest_revision_plural) %></h3>
-<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%>
-<p><%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %></p>
+<%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => nil }%>
+
+<% if @path.blank? %>
+ <p><%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %></p>
+<% else %>
+ <p><%= link_to l(:label_view_revisions), :action => 'changes', :path => to_path_param(@path), :id => @project %></p>
+<% end %>
+
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>