From 57f37acecc449522542e156bfbdec5a9b6026d27 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 29 Oct 2015 17:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=83=85=E5=86=B5=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++- app/views/repositories/_revisions.html.erb | 30 +++++++++++----------- app/views/repositories/show.html.erb | 10 +------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 72314cad9..f41dbe6c7 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -283,7 +283,9 @@ update def changes @entry = @repository.entry(@path, @rev) (show_error_not_found; return) unless @entry - @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) + g = Gitlab.client + @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}") + #@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) render :layout => 'base_projects' diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index 3da718484..fe60f8933 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -1,35 +1,35 @@ - <%= form_tag( {:controller => 'repositories', :action => 'diff', :id => project, :repository_id => @repository.identifier_param, :path => to_path_param(path)}, :method => :get ) do %> - - - - - - - - + + + + + + + + <% show_diff = revisions.size > 1 %> <% line_num = 1 %> <% revisions.each do |changeset| %> - - - - - + + + + + <% line_num += 1 %> <% end %>
#<%= l(:label_date) %><%= l(:field_author) %><%= l(:field_comments) %>
<%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %><%= format_time(changeset.committed_on) %><%= h truncate(changeset.author.to_s, :length => 30) %><%= textilizable(truncate_at_line_break(changeset.comments)) %><%= h truncate(changeset.id.to_s, :length => 20) %><%= format_time(changeset.created_at) %><%= h truncate(changeset.author_name.to_s, :length => 30) %><%= textilizable(truncate_at_line_break(changeset.message)) %>

- <%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> + <%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>

+ <% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 132d915f2..7f9f675d2 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -59,15 +59,7 @@ <%= render_properties(@properties) %> -<% if authorize_for('repositories', 'revisions') %> - <% if @changesets && !@changesets.empty? %> - <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) - sep = '' %> - <% if @repository.supports_all_revisions? && @path.blank? %> - <%= link_to l(:label_view_all_revisions_commits), :action => 'revisions', :id => @project, :repository_id => @repository.identifier_param %> - <% end %> | - <% end %> -<% end %> + 如何提交代码 <% content_for :header_tags do %>