Project

General

Profile

Patch #1601 ยป consistent_repository_navigation.patch

Bradley Whittington, 2008-07-08 14:22

View differences:

lang/en.yml (working copy)
button_annotate: Annotate
button_update: Update
button_configure: Configure
button_history: History
status_active: active
status_registered: registered
app/controllers/repositories_controller.rb (working copy)
@repository.destroy
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
end
def show
# check if new revisions have been committed in the repository
@repository.fetch_changesets if Setting.autofetch_changesets?
......
end
def browse
@changeset = @repository.changesets.find_by_revision(@rev)
@entries = @repository.entries(@path, @rev)
if request.xhr?
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
......
end
def entry
@changeset = @repository.changesets.find_by_revision(@rev)
@entry = @repository.scm.entry(@path, @rev)
show_error_not_found and return unless @entry
......
end
def annotate
@entry = @repository.scm.entry(@path, @rev)
@annotate = @repository.scm.annotate(@path, @rev)
render_error l(:error_scm_annotate) and return if @annotate.nil? || @annotate.empty?
rescue Redmine::Scm::Adapters::CommandFailed => e
......
end
def diff
@entry = @repository.scm.entry(@path, @rev)
@diff_type = params[:type] || User.current.pref[:diff_type] || 'inline'
@diff_type = 'inline' unless %w(inline sbs).include?(@diff_type)
app/views/repositories/_navigation.rhtml (working copy)
/ <%= link_to h(filename), :action => 'changes', :id => @project, :path => "#{link_path}/#{filename}", :rev => @rev %>
<% end %>
<%= "@ #{revision}" if revision %>
<% if revision %>
@ <%= link_to "#{revision}", :action => 'revision', :id => @project, :rev => @rev %>
<% end %>
<% html_title(with_leading_slash(path)) -%>
app/views/repositories/revision.rhtml (working copy)
<div class="contextual">
&#171;
<% unless @changeset.previous.nil? -%>
<%= link_to l(:label_previous), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.previous.revision %>
<% else -%>
<%= l(:label_previous) %>
<% end -%>
|
<% unless @changeset.next.nil? -%>
<%= link_to l(:label_next), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.next.revision %>
<% else -%>
<%= l(:label_next) %>
<% end -%>
&#187;&nbsp;
<% form_tag do %>
<%= text_field_tag 'rev', @rev, :size => 5 %>
<%= submit_tag 'OK' %>
<% end %>
</div>
<%= render :partial => 'changeset_nav', :locals => {:changeset => @changeset,:rev => @rev, :action => 'revision'} %>
<h2><%= l(:label_revision) %> <%= format_revision(@changeset.revision) %></h2>
......
<tbody>
<% @changes.each do |change| %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><div class="square action_<%= change.action %>"></div> <%= change.path %> <%= "(#{change.revision})" unless change.revision.blank? %></td>
<td><div class="square action_<%= change.action %>"></div> <%= link_to change.path, :action => 'entry', :id => @project, :path => without_leading_slash(change.relative_path) %> <%= "(#{change.revision})" unless change.revision.blank? %></td>
<td align="right">
<% if change.action == "M" %>
<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => without_leading_slash(change.relative_path), :rev => @changeset.revision %>
| <%= link_to l(:button_history), :action => 'changes', :id => @project, :path => without_leading_slash(change.relative_path), :rev => @changeset.revision %>
| <%= link_to l(:button_annotate), :action => 'annotate', :id => @project, :path => without_leading_slash(change.relative_path), :rev => @changeset.revision %>
<% end %>
</td>
</tr>
app/views/repositories/browse.rhtml (working copy)
<div class="contextual">
<% form_tag do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
<% end %>
</div>
<%= render :partial => 'changeset_nav', :locals => {:changeset => @changeset,:rev => @rev, :project => @project, :action => 'browse'} %>
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %></h2>
app/views/repositories/entry.rhtml (working copy)
<div class="contextual">
<% form_tag do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
<% end %>
</div>
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<%= render :partial => 'entry_nav', :locals => {:entry => @entry,:current_view => 'view'} %>
<div class="autoscroll">
<table class="filecontent CodeRay">
<tbody>
app/views/repositories/_entry_nav.rhtml (revision 0)
<h3><%=h @entry.name %></h3>
<p>
<% if current_view != 'history' %><%= link_to l(:button_history), {:action => 'changes', :id => @project, :path => @path, :rev => @rev } %> |<%end%>
<% if current_view != 'view' %>
<% if @repository.supports_cat? %>
<%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => @path, :rev => @rev } %> |
<% end %>
<% end %>
<% if current_view != 'annotate' %>
<% if @repository.supports_annotate? %>
<%= link_to l(:button_annotate), {:action => 'annotate', :id => @project, :path => @path, :rev => @rev } %> |
<% end %>
<% end %>
<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
</p>
app/views/repositories/_changeset_nav.rhtml (revision 0)
<div class="contextual">
<% if @changeset %> &#171;
<% unless @changeset.previous.nil? -%>
<%= link_to l(:label_previous), :controller => 'repositories', :action => action, :id => @project, :rev => @changeset.previous.revision %>
<% else -%>
<%= l(:label_previous) %>
<% end -%>
|
<% unless @changeset.next.nil? -%>
<%= link_to l(:label_next), :controller => 'repositories', :action => action, :id => @project, :rev => @changeset.next.revision %>
<% else -%>
<%= l(:label_next) %>
<% end -%>
&#187;&nbsp;
<% end %>
<% form_tag do %>
<%= text_field_tag 'rev', @rev, :size => 5 %>
<%= submit_tag 'OK' %>
<% end %>
</div>
app/views/repositories/changes.rhtml (working copy)
<div class="contextual">
<% form_tag do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
<% end %>
</div>
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
<h3><%=h @entry.name %></h3>
<%= render :partial => 'entry_nav', :locals => {:entry => @entry,:current_view => 'history'} %>
<p>
<% if @repository.supports_cat? %>
<%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => @path, :rev => @rev } %> |
<% end %>
<% if @repository.supports_annotate? %>
<%= link_to l(:button_annotate), {:action => 'annotate', :id => @project, :path => @path, :rev => @rev } %> |
<% end %>
<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
</p>
<%= render(:partial => 'revisions',
:locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %>
app/views/repositories/diff.rhtml (working copy)
<h2><%= l(:label_revision) %> <%= format_revision(@rev) %> <%= @path.gsub(/^.*\//, '') %></h2>
<div class="contextual">
<% form_tag do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
<% end %>
</div>
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
<%= render :partial => 'entry_nav', :locals => {:entry => @entry} %>
<!-- Choose view type -->
<% form_tag({ :controller => 'repositories', :action => 'diff'}, :method => 'get') do %>
<% params.each do |k, p| %>
app/views/repositories/annotate.rhtml (working copy)
<div class="contextual">
<% form_tag do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %>
<% end %>
</div>
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<%= render :partial => 'entry_nav', :locals => {:entry => @entry,:current_view => 'annotate'} %>
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
<div class="autoscroll">
    (1-1/1)