Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
5695bcdda9
|
@ -325,27 +325,11 @@ update
|
|||
end
|
||||
end
|
||||
|
||||
# unless @repository.gitlab?
|
||||
# # redirect_to to_gitlab_project_repository_path(@project, @repository)
|
||||
# render :to_gitlab
|
||||
# return
|
||||
# end
|
||||
|
||||
#if( !User.current.member_of?(@project) || @project.hidden_repo)
|
||||
# @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
||||
|
||||
# :name, :path, :kind, :size, :lastrev, :changeset
|
||||
@entries = @repository.entries(@path, @rev)
|
||||
# @trees = g.trees(project, @path)
|
||||
@changeset = @repository.find_changeset_by_name(@rev)
|
||||
#@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
#@ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
|
||||
if request.xhr?
|
||||
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
||||
else
|
||||
#Modified by young
|
||||
# (show_error_not_found; return) unless @entries
|
||||
g = Gitlab.client
|
||||
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
||||
g_project = g.project(@project.gpid)
|
||||
|
@ -360,17 +344,16 @@ update
|
|||
if @changesets_all_count != @project.project_score.changeset_num && @changesets_all_count != 0
|
||||
update_commits_count(@project, @changesets_all_count)
|
||||
end
|
||||
# end
|
||||
# 最近一次提交
|
||||
@changesets_latest_coimmit = @changesets[0]
|
||||
unless @changesets[0].blank?
|
||||
update_commits_date(@project, @changesets_latest_coimmit)
|
||||
end
|
||||
@creator = User.where("id =?", @project.user_id).first.try(:login)
|
||||
@properties = @repository.properties(@path, @rev)
|
||||
@repositories = @project.repositories
|
||||
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
# @properties = @repository.properties(@path, @rev)
|
||||
# @repositories = @project.repositories
|
||||
# project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||
# ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
if @repository.type.to_s == "Repository::Gitlab"
|
||||
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
|
||||
|
|
|
@ -261,7 +261,7 @@ class Message < ActiveRecord::Base
|
|||
ws = WechatService.new
|
||||
if self.course
|
||||
if self.parent_id.nil? # 主贴
|
||||
self.course.members.each do |m|
|
||||
self.course.members.includes(:user).each do |m|
|
||||
if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
|
||||
content = strip_html self.subject, 200
|
||||
|
@ -269,7 +269,7 @@ class Message < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
else # 回帖
|
||||
self.course.members.each do |m|
|
||||
self.course.members.includes(:user).each do |m|
|
||||
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
|
||||
content = strip_html self.content.html_safe, 200
|
||||
|
@ -279,7 +279,7 @@ class Message < ActiveRecord::Base
|
|||
end
|
||||
elsif self.project # 项目相关
|
||||
if self.parent_id.nil? # 主贴
|
||||
self.project.members.each do |m|
|
||||
self.project.members.includes(:user).each do |m|
|
||||
if m.user_id != self.author_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
|
||||
content = strip_html self.subject, 200
|
||||
|
@ -287,7 +287,7 @@ class Message < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
else # 回帖
|
||||
self.project.members.each do |m|
|
||||
self.project.members.includes(:user).each do |m|
|
||||
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
|
||||
content = strip_html self.content.html_safe, 200
|
||||
|
|
|
@ -44,7 +44,7 @@ class Repository < ActiveRecord::Base
|
|||
# validates_uniqueness_of :identifier, :allow_blank => true
|
||||
validates_exclusion_of :identifier, :in => %w(show entry raw changes annotate diff show stats graph)
|
||||
# donwcase letters, digits, dashes, underscores but not digits only
|
||||
validates_format_of :identifier, :with => /^[a-z0-9_\-]+$/, :allow_blank => true
|
||||
validates_format_of :identifier, :with => /^[a-zA-Z0-9_\-]*[a-zA-Z_\-]+[a-zA-Z0-9_\-]*$/, :allow_blank => true
|
||||
# Checks if the SCM is enabled when creating a repository
|
||||
validate :repo_create_validation, :on => :create
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a>
|
||||
<% if @is_test %>
|
||||
<%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6' %>
|
||||
<%=link_to '返 回',homework_common_index_path(:course => @course.id),:class=>'fr mt6',:style =>'line-height:30px;' %>
|
||||
<% else @is_test %>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fr" id="commit-program-work-btn">提交代码</a>
|
||||
<% end %>
|
||||
|
|
|
@ -89,11 +89,10 @@ zh:
|
|||
project_module_repository: 版本库
|
||||
project_module_create_repository: 创建版本库
|
||||
project_gitlab_create_repository: 新版本库
|
||||
project_gitlab_create_double_message: 亲,您已经创建了一个同名的版本库,换个特别点的名字同名的概率就会变小哦~
|
||||
project_gitlab_create_double_message: 温馨提示:您已经创建了一个同名的版本库!
|
||||
project_gitlab_fork_double_message: 亲,您已经有了一个相同名字的版本库,所以不能fork改版本库~
|
||||
project_gitlab_fork_own: 您好,您当前所fork的项目为您自己创建的项目,平台暂时不提供fork自己项目的功能,敬请谅解!
|
||||
|
||||
|
||||
label_project_more: 更多
|
||||
project_module_news: 新闻
|
||||
project_module_wiki: Wiki
|
||||
|
|
|
@ -22,6 +22,7 @@ $(function(){
|
|||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
$('#test-program-btn').hide();
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||
var src = $('#program-src').val();
|
||||
|
@ -29,6 +30,7 @@ $(function(){
|
|||
var is_test = $('input[name=is_test]').val();
|
||||
|
||||
if(!valid_form()){
|
||||
$('#test-program-btn').show();
|
||||
return;
|
||||
}
|
||||
/*
|
||||
|
@ -78,17 +80,19 @@ $(function(){
|
|||
$('.ProResult').prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;}
|
||||
var r=confirm("答题正确,是否立刻提交?");
|
||||
if (r) {
|
||||
$(".HomeWorkCon form").submit();
|
||||
}
|
||||
$('#test-program-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
//2 超时 -2 编译错误 测试结束
|
||||
if (data.status == 2 || data.status == -2 || tSeq >= tCount ){
|
||||
if (typeof cb == 'function') {cb(data); return;}
|
||||
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show(); return;}
|
||||
$('#test-program-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,6 +104,7 @@ $(function(){
|
|||
} else {
|
||||
alert("对不起,服务器繁忙请稍后再试!");
|
||||
}
|
||||
$('#test-program-btn').show();
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue