Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
3b6ac1bef8
|
@ -252,9 +252,12 @@ update
|
||||||
else
|
else
|
||||||
#Modified by young
|
#Modified by young
|
||||||
# (show_error_not_found; return) unless @entries
|
# (show_error_not_found; return) unless @entries
|
||||||
@changesets = @repository.latest_changesets(@path, @rev)
|
g = Gitlab.client
|
||||||
@changesets_count = @repository.latest_changesets(@path, @rev).count
|
@changesets = g.get ("/projects/#{@project.gpid}/repository/commits")
|
||||||
@changesets_latest_coimmit = @changesets.first
|
# @changesets = @repository.latest_changesets(@path, @rev)
|
||||||
|
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
||||||
|
@changesets_count = @changesets.count
|
||||||
|
@changesets_latest_coimmit = @changesets[0]
|
||||||
@properties = @repository.properties(@path, @rev)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@repositories = @project.repositories
|
@repositories = @project.repositories
|
||||||
@course_tag = params[:course]
|
@course_tag = params[:course]
|
||||||
|
@ -280,7 +283,9 @@ update
|
||||||
def changes
|
def changes
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(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)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@changeset = @repository.find_changeset_by_name(@rev)
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
render :layout => 'base_projects'
|
render :layout => 'base_projects'
|
||||||
|
|
|
@ -23,4 +23,6 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
alert("未知错误,请稍后再试");
|
alert("未知错误,请稍后再试");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
location.reload();
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,53 +1,35 @@
|
||||||
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
|
|
||||||
<%= if show_revision_graph && revisions && revisions.any?
|
|
||||||
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
|
|
||||||
url_for(
|
|
||||||
:controller => 'repositories',
|
|
||||||
:action => 'revision',
|
|
||||||
:id => project,
|
|
||||||
:repository_id => @repository.identifier_param,
|
|
||||||
:rev => scmid)
|
|
||||||
end
|
|
||||||
render :partial => 'revision_graph',
|
|
||||||
:locals => {
|
|
||||||
:commits => indexed_commits,
|
|
||||||
:space => graph_space
|
|
||||||
}
|
|
||||||
end %>
|
|
||||||
<%= form_tag(
|
<%= form_tag(
|
||||||
{:controller => 'repositories', :action => 'diff', :id => project,
|
{:controller => 'repositories', :action => 'diff', :id => project,
|
||||||
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
||||||
:method => :get
|
:method => :get
|
||||||
) do %>
|
) do %>
|
||||||
<table class="list changesets">
|
<table class="list changesets">
|
||||||
<thead><tr>
|
<!--<thead><tr>-->
|
||||||
<th>#</th>
|
<!--<th>#</th>-->
|
||||||
<th></th>
|
<!--<th></th>-->
|
||||||
<th></th>
|
<!--<th></th>-->
|
||||||
<th><%= l(:label_date) %></th>
|
<!--<th><%= l(:label_date) %></th>-->
|
||||||
<th><%= l(:field_author) %></th>
|
<!--<th><%= l(:field_author) %></th>-->
|
||||||
<th><%= l(:field_comments) %></th>
|
<!--<th><%= l(:field_comments) %></th>-->
|
||||||
</tr></thead>
|
<!--</tr></thead>-->
|
||||||
<tbody>
|
<tbody>
|
||||||
<% show_diff = revisions.size > 1 %>
|
<% show_diff = revisions.size > 1 %>
|
||||||
<% line_num = 1 %>
|
<% line_num = 1 %>
|
||||||
<% revisions.each do |changeset| %>
|
<% revisions.each do |changeset| %>
|
||||||
<tr class="changeset <%= cycle 'odd', 'even' %>">
|
<tr class="changeset <%= cycle 'odd', 'even' %>">
|
||||||
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
|
|
||||||
<%= content_tag(:td, :class => 'id', :style => id_style) do %>
|
<td class="id"><%= h truncate(changeset.id.to_s, :length => 20) %></td>
|
||||||
<%= link_to_revision(changeset, @repository) %>
|
<!--<td class="checkbox"><%#= radio_button_tag('rev_to', changeset.id, (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) %></td>-->
|
||||||
<% end %>
|
<td class="committed_on"><%= format_time(changeset.created_at) %></td>
|
||||||
<td class="checkbox"><%= 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) %></td>
|
<td class="author"><%= h truncate(changeset.author_name.to_s, :length => 30) %></td>
|
||||||
<td class="checkbox"><%= 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) %></td>
|
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.message)) %></td>
|
||||||
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
|
|
||||||
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
|
|
||||||
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% line_num += 1 %>
|
<% line_num += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="padding-top: 10px;">
|
<p style="padding-top: 10px;">
|
||||||
<%= 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 %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="recordBanner mt10">
|
<div class="recordBanner mt10">
|
||||||
<% if @changesets && !@changesets.empty? %>
|
<% if @changesets && !@changesets.empty? %>
|
||||||
<%= image_tag(url_to_avatar(@changesets_latest_coimmit.user), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
<%= image_tag(url_to_avatar(@changesets_latest_coimmit.author_name), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||||
<span class="fl"><div class="fb fontGrey3 mr5 fl"><%=link_to @changesets_latest_coimmit.user, user_path(@changesets_latest_coimmit.user) %></div>
|
<span class="fl"><div class="fb fontGrey3 mr5 fl"><%=link_to @changesets_latest_coimmit.author_name, user_path(@changesets_latest_coimmit.author_name) %></div>
|
||||||
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.committed_on) %>:</div>
|
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:</div>
|
||||||
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.comments %></div>
|
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
|
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
|
||||||
|
@ -59,15 +59,7 @@
|
||||||
<!-- 代码修订 -->
|
<!-- 代码修订 -->
|
||||||
<%= render_properties(@properties) %>
|
<%= 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 %>
|
|
||||||
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
|
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
|
|
|
@ -375,7 +375,7 @@ zh:
|
||||||
#
|
#
|
||||||
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
|
label_project_new_description: '项目可以是软件开发项目,也可以是协作研究项目。'
|
||||||
field_name: 名称
|
field_name: 名称
|
||||||
field_identifier: 标识
|
field_identifier: 版本库名
|
||||||
field_enterprise_name: 组织名称
|
field_enterprise_name: 组织名称
|
||||||
label_organization_choose: --请选择组织--
|
label_organization_choose: --请选择组织--
|
||||||
text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。"
|
text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。"
|
||||||
|
|
|
@ -22,7 +22,10 @@ module Trustie
|
||||||
|
|
||||||
def sync_user(user)
|
def sync_user(user)
|
||||||
u = add_user(user)
|
u = add_user(user)
|
||||||
user.save! if u
|
if (!("day,none,all".include? user.mail_notification) or user.mail_notification.blank?)
|
||||||
|
user.mail_notification = "day"
|
||||||
|
end
|
||||||
|
user.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
def sync_project(project, opt={})
|
def sync_project(project, opt={})
|
||||||
|
|
Loading…
Reference in New Issue