##// END OF EJS Templates
Pretty URL for the repository browser (Cyril Mougel)...
Jean-Philippe Lang -
r867:d46e3a501e7b
parent child
Show More
@@ -110,7 +110,7 class RepositoriesController < ApplicationController
110
110
111 @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
111 @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
112 unless read_fragment(@cache_key)
112 unless read_fragment(@cache_key)
113 @diff = @repository.diff(@path, @rev, @rev_to, type)
113 @diff = @repository.diff(@path, @rev, @rev_to, @diff_type)
114 show_error and return unless @diff
114 show_error and return unless @diff
115 end
115 end
116 end
116 end
@@ -145,7 +145,7 private
145 @project = Project.find(params[:id])
145 @project = Project.find(params[:id])
146 @repository = @project.repository
146 @repository = @project.repository
147 render_404 and return false unless @repository
147 render_404 and return false unless @repository
148 @path = params[:path].squeeze('/') if params[:path]
148 @path = params[:path].join('/') unless params[:path].nil?
149 @path ||= ''
149 @path ||= ''
150 @rev = params[:rev].to_i if params[:rev]
150 @rev = params[:rev].to_i if params[:rev]
151 rescue ActiveRecord::RecordNotFound
151 rescue ActiveRecord::RecordNotFound
@@ -1,4 +1,4
1 <% form_tag({:controller => 'repositories', :action => 'diff', :id => @project}, :method => :get) do %>
1 <% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :path => path}, :method => :get) do %>
2 <table class="list">
2 <table class="list">
3 <thead><tr>
3 <thead><tr>
4 <th>#</th>
4 <th>#</th>
@@ -24,6 +24,5
24 <% end %>
24 <% end %>
25 </tbody>
25 </tbody>
26 </table>
26 </table>
27 <%= hidden_field_tag 'path', path %>
28 <%= submit_tag(l(:label_view_diff), :class => 'small', :name => nil) if show_diff %>
27 <%= submit_tag(l(:label_view_diff), :class => 'small', :name => nil) if show_diff %>
29 <% end %>
28 <% end %>
@@ -17,6 +17,13 ActionController::Routing::Routes.draw do |map|
17 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
17 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
18 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
18 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
19
19
20 map.with_options :controller => 'repositories' do |omap|
21 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
22 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
23 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
24 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
25 end
26
20 # Allow downloading Web Service WSDL as a file with an extension
27 # Allow downloading Web Service WSDL as a file with an extension
21 # instead of a file named 'wsdl'
28 # instead of a file named 'wsdl'
22 map.connect ':controller/service.wsdl', :action => 'wsdl'
29 map.connect ':controller/service.wsdl', :action => 'wsdl'
General Comments 0
You need to be logged in to leave comments. Login now