merge
This commit is contained in:
commit
1d53af36cd
6
Gemfile
6
Gemfile
|
@ -50,16 +50,16 @@ gem 'elasticsearch-model'
|
|||
gem 'elasticsearch-rails'
|
||||
|
||||
#rails 3.2.22.2 bug
|
||||
gem "test-unit", "~>3.0"
|
||||
# gem "test-unit", "~>3.0"
|
||||
|
||||
### profile
|
||||
gem 'oneapm_rpm'
|
||||
# gem 'oneapm_rpm'
|
||||
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
gem 'better_errors', '~> 1.1.0'
|
||||
# gem "query_reviewer"
|
||||
gem 'rack-mini-profiler', '~> 0.9.3'
|
||||
# gem 'rack-mini-profiler', '~> 0.9.3'
|
||||
if RUBY_PLATFORM =~ /w32/
|
||||
gem 'win32console'
|
||||
end
|
||||
|
|
|
@ -54,6 +54,16 @@ module Mobile
|
|||
|
||||
authenticate!
|
||||
|
||||
subscribe = 0 #默认未关注
|
||||
|
||||
#-------------------获取用户是否关注此公众号-----------------------------
|
||||
openid = session[:wechat_openid]
|
||||
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
||||
user_info = Wechat.api.user(openid)
|
||||
Rails.logger.info "user_info!!!!!!!!!"
|
||||
Rails.logger.info user_info
|
||||
subscribe = user_info["subscribe"]
|
||||
|
||||
status = 0
|
||||
tip = 0 #0班级1项目
|
||||
type = params[:type]
|
||||
|
@ -207,6 +217,7 @@ module Mobile
|
|||
present :result, result
|
||||
present :status, status
|
||||
present :tip, tip
|
||||
present :subscribe,subscribe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ module Mobile
|
|||
|
||||
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat
|
||||
|
||||
if uw && !user.real?
|
||||
if uw && !uw.real?
|
||||
uw.migrate_user(user)
|
||||
else
|
||||
UserWechat.create!(
|
||||
|
@ -69,7 +69,8 @@ module Mobile
|
|||
:should_confirmation_password => true)
|
||||
raise user.errors.full_messages.first if user.new_record?
|
||||
|
||||
if uw && !user.real?
|
||||
if uw && !uw.real?
|
||||
user.update_attributes(:lastname=>uw.user[:lastname])
|
||||
uw.migrate_user(user)
|
||||
else
|
||||
UserWechat.create!(
|
||||
|
|
|
@ -61,8 +61,7 @@ class AdminController < ApplicationController
|
|||
if params[:syllabus_id] && params[:course_id]
|
||||
course = Course.where("id = #{params[:course_id].to_i}").first
|
||||
unless course.nil?
|
||||
course.update_column('syllabus_id', params[:syllabus_id].to_i)
|
||||
Rails.logger.error "update_syllabus_id: admin_controller/select_scourse_syllabus"
|
||||
course.update_attribute(:syllabus_id, params[:syllabus_id].to_i)
|
||||
@flag = true
|
||||
end
|
||||
end
|
||||
|
@ -83,8 +82,7 @@ class AdminController < ApplicationController
|
|||
syllabus.update_attributes(:title => params[:title], :eng_name => params[:eng_name], :user_id => @user.id)
|
||||
syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content
|
||||
if syllabus.save
|
||||
course.update_column('syllabus_id', syllabus.id)
|
||||
Rails.logger.error "update_syllabus_id: admin_controller/create_syllabus"
|
||||
course.update_attribute(:syllabus_id, params[:syllabus_id].to_i)
|
||||
@flag = params[:flag].to_i
|
||||
@course = course
|
||||
respond_to do |format|
|
||||
|
|
|
@ -53,7 +53,7 @@ class AppliedProjectController < ApplicationController
|
|||
else
|
||||
@project = Project.find(params[:project_id])
|
||||
end
|
||||
if !@project || params[:invite_code].upcase.to_s != @project.invite_code
|
||||
if !@project || params[:invite_code].strip.upcase.to_s != @project.invite_code
|
||||
@flag = 1
|
||||
elsif User.current.member_of?(@project)
|
||||
@flag = 2
|
||||
|
|
|
@ -77,19 +77,25 @@ class FilesController < ApplicationController
|
|||
if params[:insite]
|
||||
if q == "%%"
|
||||
@result = []
|
||||
@searched_attach = paginateHelper @result,10
|
||||
# @searched_attach = paginateHelper @result,10
|
||||
else
|
||||
@result = find_public_attache q,sort
|
||||
@result = visable_attachemnts_insite @result,@course
|
||||
@searched_attach = paginateHelper @result,10
|
||||
# @searched_attach = paginateHelper @result,10
|
||||
end
|
||||
else
|
||||
@result = find_course_attache q,@course,sort
|
||||
@result = visable_attachemnts @result
|
||||
@searched_attach = paginateHelper @result,10
|
||||
|
||||
# @searched_attach = paginateHelper @result,10
|
||||
@tag_list = get_course_tag_list @course
|
||||
end
|
||||
@all_attachments = @result
|
||||
@limit = 10
|
||||
@feedback_count = @all_attachments.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@offset ||= @feedback_pages.offset
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@obj_attachments = paginateHelper @all_attachments,10
|
||||
#rescue Exception => e
|
||||
# #render 'stores'
|
||||
# redirect_to search_course_files_url
|
||||
|
@ -144,18 +150,26 @@ class FilesController < ApplicationController
|
|||
if params[:insite]
|
||||
if q == "%%"
|
||||
@project_attachment_result = []
|
||||
@searched_attach = paginateHelper @project_attachment_result, 10
|
||||
# @searched_attach = paginateHelper @project_attachment_result, 10
|
||||
else
|
||||
@project_attachment_result = find_public_attache q,sort
|
||||
@project_attachment_result = visable_attachemnts_insite @project_attachment_result, @project
|
||||
@searched_attach = paginateHelper @project_attachment_result, 10
|
||||
# @searched_attach = paginateHelper @project_attachment_result, 10
|
||||
end
|
||||
else
|
||||
@project_attachment_result = find_project_attache q, @project,sort
|
||||
@project_attachment_result = visable_attachemnts @project_attachment_result
|
||||
@searched_attach = paginateHelper @project_attachment_result,10
|
||||
# @searched_attach = paginateHelper @project_attachment_result,10
|
||||
@tag_list = get_project_tag_list @project
|
||||
end
|
||||
|
||||
@all_attachments = @project_attachment_result
|
||||
@limit = 10
|
||||
@feedback_count = @all_attachments.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@offset ||= @feedback_pages.offset
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@obj_attachments = paginateHelper @all_attachments,10
|
||||
#rescue Exception => e
|
||||
# #render 'stores'
|
||||
# redirect_to search_course_files_url
|
||||
|
@ -867,7 +881,17 @@ class FilesController < ApplicationController
|
|||
else
|
||||
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank?
|
||||
end
|
||||
@searched_attach = paginateHelper @result,10
|
||||
|
||||
@all_attachments = @result
|
||||
@limit = 10
|
||||
@feedback_count = @all_attachments.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@offset ||= @feedback_pages.offset
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@obj_attachments = paginateHelper @all_attachments,10
|
||||
|
||||
|
||||
# @searched_attach = paginateHelper @result,10
|
||||
if @project
|
||||
@tag_list = get_project_tag_list @project
|
||||
@result_search_project = @result
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
class PullRequestsController < ApplicationController
|
||||
before_filter :find_project_and_repository
|
||||
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new]
|
||||
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new,
|
||||
:update_pull_request, :pull_request_comments, :create_pull_request_comment]
|
||||
layout "base_projects"
|
||||
include PullRequestsHelper
|
||||
include ApplicationHelper
|
||||
|
@ -14,9 +15,19 @@ class PullRequestsController < ApplicationController
|
|||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
|
||||
when "2"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}
|
||||
when "3"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"}
|
||||
end
|
||||
@requests_opened_count = @requests.count
|
||||
@requests_merged_count = params[:type] ? @requests.count : @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count
|
||||
@requests_merged_count = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}.count
|
||||
@requests_closed_count = @g.merge_requests(@project.gpid).select{|request| request.state == "closed"}.count
|
||||
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@count = type_count(type, @requests_opened_count, @requests_merged_count, @requests_closed_count)
|
||||
@pages = Paginator.new @count, @limit, params['page'] || 1
|
||||
@offset ||= @pages.offset
|
||||
@requests = paginateHelper @requests, 10
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
|
@ -84,6 +95,15 @@ class PullRequestsController < ApplicationController
|
|||
@commits_count = @commits.count
|
||||
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
|
||||
@changes_count = @changes.count
|
||||
@comments = @g.merge_request_comments(@project.gpid, params[:id]).reverse
|
||||
@comments_count = @comments.count
|
||||
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@count = @comments_count
|
||||
@pages = Paginator.new @count, @limit, params['page'] || 1
|
||||
@offset ||= @pages.offset
|
||||
@comments = paginateHelper @comments, 10
|
||||
end
|
||||
|
||||
# Accept a merge request.
|
||||
|
@ -99,6 +119,7 @@ class PullRequestsController < ApplicationController
|
|||
def accept_pull_request
|
||||
begin
|
||||
status = @g.accept_merge_rquest(@project.gpid, params[:id], User.current.gid)
|
||||
PullRequest.create(:pull_request_id => status.id, :user_id => User.current.id, :gpid => status.project_id)
|
||||
respond_to do |format|
|
||||
format.js{redirect_to project_pull_request_path(status.id, :project_id => @project.id)}
|
||||
end
|
||||
|
@ -107,16 +128,110 @@ class PullRequestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 获取某次请求的提交次数
|
||||
def pull_request_commits
|
||||
@type = parms[:type]
|
||||
@commits = @g.merge_request_commits(@project.gpid, params[:id].to_i)
|
||||
# Updates a merge request.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.update_merge_request(5, 42, :title => 'New title')
|
||||
#
|
||||
# @param [Integer] project The ID of a project.
|
||||
# @param [Integer] id The ID of a merge request.
|
||||
# @param [Hash] options A customizable set of options.
|
||||
# @option options [String] :title The title of a merge request.
|
||||
# @option options [String] :source_branch The source branch name.
|
||||
# @option options [String] :target_branch The target branch name.
|
||||
# @option options [Integer] :assignee_id The ID of a user to assign merge request.
|
||||
# @option options [String] :state_event New state (close|reopen|merge).
|
||||
# @return [Gitlab::ObjectifiedHash] Information about updated merge request.
|
||||
def update_pull_request
|
||||
begin
|
||||
@g.update_merge_request(@project.gpid, params[:id], User.current.gid, :state_event => params[:state])
|
||||
respond_to do |format|
|
||||
format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)}
|
||||
end
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
# 获取某次请求的改动
|
||||
# Creates a merge request.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.create_merge_request(5, 'New merge request',
|
||||
# :source_branch => 'source_branch', :target_branch => 'target_branch')
|
||||
# Gitlab.create_merge_request(5, 'New merge request',
|
||||
# :source_branch => 'source_branch', :target_branch => 'target_branch', :assignee_id => 42)
|
||||
def create_pull_request_comment
|
||||
content = params[:pull_request_comment]
|
||||
begin
|
||||
@comments = @g.create_merge_request_comment(@project.gpid, params[:id], content, User.current.gid)
|
||||
respond_to do |format|
|
||||
format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)}
|
||||
end
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
# Gets the comments on a merge request.
|
||||
#
|
||||
# @example
|
||||
# Gitlab.merge_request_comments(5, 1)
|
||||
def pull_request_comments
|
||||
begin
|
||||
@comments = @g.merge_request_comments(@project.gpid, params[:id]).reverse
|
||||
@comments_count = @comments.count
|
||||
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@count = @comments_count
|
||||
@pages = Paginator.new @count, @limit, params['page'] || 1
|
||||
@offset ||= @pages.offset
|
||||
@comments = paginateHelper @comments, 10
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
# Get a list of merge request commits.
|
||||
# Parameters:
|
||||
# id (required) - The ID of a project
|
||||
# merge_request_id (required) - The ID of MR
|
||||
def pull_request_commits
|
||||
begin
|
||||
@type = params[:type]
|
||||
@commits = @g.merge_request_commits(@project.gpid, params[:id])
|
||||
@commits_count = @commits.count
|
||||
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@count = @commits_count
|
||||
@pages = Paginator.new @count, @limit, params['page'] || 1
|
||||
@offset ||= @pages.offset
|
||||
@commits = paginateHelper @commits, 10
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
# Shows information about the merge request including its files and changes. With GitLab 8.2 the return fields upvotes and downvotes are deprecated and always return 0.
|
||||
# Parameters:
|
||||
# id (required) - The ID of a project
|
||||
# merge_request_id (required) - The ID of MR
|
||||
def pull_request_changes
|
||||
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
|
||||
@changes_count = @changes.count
|
||||
begin
|
||||
@type = params[:type]
|
||||
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
|
||||
@changes_count = @changes.count
|
||||
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@count = @changes_count
|
||||
@pages = Paginator.new @count, @limit, params['page'] || 1
|
||||
@offset ||= @pages.offset
|
||||
@changes = paginateHelper @changes, 10
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -17,6 +17,7 @@ class QualityAnalysisController < ApplicationController
|
|||
|
||||
# params 说明:{identifier:版本库名}
|
||||
def create
|
||||
logger.info("11111111111111111111111111111")
|
||||
begin
|
||||
user_name = User.find(params[:user_id]).try(:login)
|
||||
identifier = params[:identifier]
|
||||
|
@ -32,12 +33,18 @@ class QualityAnalysisController < ApplicationController
|
|||
projects_date = open(@sonar_address + "/api/projects/index").read
|
||||
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
||||
quality_an = QualityAnalysis.where(:sonar_name => sonar_name).first
|
||||
if @client.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank?
|
||||
aa = @client.job.delete("#{job_name}")
|
||||
logger.info("###########################6666666666666")
|
||||
logger.info("job_name is ###########################{job_name}")
|
||||
logger.info("@client_jenkins is ###########################{@client_jenkins}")
|
||||
logger.info("@client_jenkins job is ###########################{@client_jenkins.job}")
|
||||
logger.info("@client_jenkins result is ###########################{@client_jenkins.job.exists?(job_name)}")
|
||||
if @client_jenkins.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank?
|
||||
aa = @client_jenkins.job.delete("#{job_name}")
|
||||
quality_an.delete unless quality_an.blank?
|
||||
end
|
||||
|
||||
# Checks if the given job exists in Jenkins.
|
||||
# unless @client.job.exists?(job_name)
|
||||
unless @client_jenkins.job.exists?(job_name)
|
||||
@g = Gitlab.client
|
||||
branch = params[:branch]
|
||||
language = swith_language_type(params[:language])
|
||||
|
@ -59,20 +66,20 @@ class QualityAnalysisController < ApplicationController
|
|||
@doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties
|
||||
|
||||
# jenkins job创建
|
||||
jenkins_job = @client.job.create("#{job_name}", @doc.to_xml)
|
||||
jenkins_job = @client_jenkins.job.create("#{job_name}", @doc.to_xml)
|
||||
logger.info("Jenkins status of create ==> #{jenkins_job}")
|
||||
|
||||
# 将地址作为hook值添加到gitlab
|
||||
@g.add_project_hook(@project.gpid, @jenkins_address + "/project/#{job_name}")
|
||||
# job创建完成后自动运行job,如果运行成功则返回‘200’
|
||||
code = @client.job.build("#{job_name}")
|
||||
code = @client_jenkins.job.build("#{job_name}")
|
||||
logger.error("build result ==> #{code}")
|
||||
|
||||
# 判断调用sonar分析是否成功
|
||||
# 等待启动时间处理, 最长时间为30分钟
|
||||
for i in 0..360 do
|
||||
sleep(5)
|
||||
@current_build_status = @client.job.get_current_build_status("#{job_name}")
|
||||
@current_build_status = @client_jenkins.job.get_current_build_status("#{job_name}")
|
||||
if (@current_build_status == "success" || @current_build_status == "failure")
|
||||
break
|
||||
if i == 360
|
||||
|
@ -86,7 +93,7 @@ class QualityAnalysisController < ApplicationController
|
|||
sleep(10)
|
||||
|
||||
# 获取sonar output结果
|
||||
console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
|
||||
console_build = @client_jenkins.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
|
||||
logger.info("@current_build_status is ==> #{@current_build_status}")
|
||||
|
||||
# 两种情况需要删除job:
|
||||
|
@ -94,14 +101,14 @@ class QualityAnalysisController < ApplicationController
|
|||
# 2/creat和build成功,调用sonar启动失败则删除job
|
||||
# 错误信息存储需存到Trustie数据库,否则一旦job删除则无法获取这些信息
|
||||
if jenkins_job == '200' && code != '201'
|
||||
@client.job.delete("#{job_name}")
|
||||
@client_jenkins.job.delete("#{job_name}")
|
||||
else
|
||||
if @current_build_status == "failure"
|
||||
reg_console = /Exception:.*?\r/.match(console_build)
|
||||
output = reg_console[0].gsub("\r", "") unless reg_console.nil?
|
||||
se = SonarError.where(:jenkins_job_name => job_name).first
|
||||
se.nil? ? SonarError.create(:project_id => @project.id, :jenkins_job_name => job_name, :output => output) : se.update_column(:output, output)
|
||||
@client.job.delete("#{job_name}")
|
||||
@client_jenkins.job.delete("#{job_name}")
|
||||
elsif @current_build_status == "success"
|
||||
if quality_an.blank?
|
||||
QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier,
|
||||
|
@ -111,17 +118,24 @@ class QualityAnalysisController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
if @current_build_status == "success"
|
||||
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch, :current_build_status => @current_build_status, :job_name => job_name)}
|
||||
elsif @current_build_status == "failure"
|
||||
format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name)}
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
@message = e.message
|
||||
end
|
||||
respond_to do |format|
|
||||
if @current_build_status == "success"
|
||||
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch, :current_build_status => @current_build_status, :job_name => job_name)}
|
||||
elsif @current_build_status == "failure"
|
||||
format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name)}
|
||||
logger.error("######################====>#{e.message}")
|
||||
respond_to do |format|
|
||||
format.html{redirect_to error_list_project_quality_analysi_path(:project_id => @project.id, :job_name => job_name, :message => @message)}
|
||||
# format.html{redirect_to :controller => 'repositories', :action => 'show', :id => @project, :repository_id => identifier}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def error_list
|
||||
|
@ -159,9 +173,9 @@ class QualityAnalysisController < ApplicationController
|
|||
rep_id = Repository.where(:project_id => @project.id, :identifier => qa.rep_identifier).first.try(:id)
|
||||
job_name = "#{qa.author_login}-#{rep_id}"
|
||||
logger.info("result: job_name ###################==>#{job_name}")
|
||||
logger.info("result: @client.job ###################==>#{@client.job}")
|
||||
logger.info("result: @client_jenkins.job ###################==>#{@client_jenkins.job}")
|
||||
|
||||
d_job = @client.job.delete(job_name)
|
||||
d_job = @client_jenkins.job.delete(job_name)
|
||||
logger.info("result: delete job ###################==>#{d_job}")
|
||||
qa.delete
|
||||
respond_to do |format|
|
||||
|
@ -198,7 +212,7 @@ class QualityAnalysisController < ApplicationController
|
|||
@doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties
|
||||
|
||||
# update成功则返回 ‘200’
|
||||
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
|
||||
jenkins_job = @client_jenkins.job.update("#{job_name}", @doc.to_xml)
|
||||
# 数据更新到Trustie数据
|
||||
if jenkins_job == '200'
|
||||
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
|
||||
|
@ -278,9 +292,10 @@ class QualityAnalysisController < ApplicationController
|
|||
@jenkins_address = Redmine::Configuration['jenkins_address']
|
||||
jenkins_username = Redmine::Configuration['jenkins_username']
|
||||
jenkins_password = Redmine::Configuration['jenkins_password']
|
||||
|
||||
logger.info("22222222222222222222222222222222")
|
||||
# connect jenkins
|
||||
@client = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => jenkins_username, :password => jenkins_password)
|
||||
@client_jenkins = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => jenkins_username, :password => jenkins_password)
|
||||
logger.info("333333333333333333333333333333")
|
||||
rescue => e
|
||||
logger.error("failed to connect Jenkins ==> #{e}")
|
||||
end
|
||||
|
|
|
@ -597,6 +597,7 @@ class StudentWorkController < ApplicationController
|
|||
student_work.description = params[:student_work][:description]
|
||||
student_work.homework_common_id = @homework.id
|
||||
student_work.user_id = User.current.id
|
||||
student_work.commit_time = Time.now
|
||||
student_work.save_attachments(params[:attachments])
|
||||
render_attachment_warning_if_needed(student_work)
|
||||
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||
|
@ -791,7 +792,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
elsif @homework.homework_type == 1
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0)
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil)
|
||||
end
|
||||
@student_work = StudentWork.new
|
||||
respond_to do |format|
|
||||
|
@ -826,7 +827,7 @@ class StudentWorkController < ApplicationController
|
|||
@new_score.user_id = User.current.id
|
||||
@new_score.student_work_id = @work.id
|
||||
if @is_teacher && @work.work_status == 0
|
||||
@work.update_column('work_status', 1)
|
||||
@work.update_attributes(:work_status => 1, :commit_time => Time.now)
|
||||
end
|
||||
if User.current.admin?
|
||||
@new_score.reviewer_role = 1
|
||||
|
|
|
@ -42,7 +42,7 @@ class UsersController < ApplicationController
|
|||
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
|
||||
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
#before_filter :rest_user_score, only: :show
|
||||
#before_filter :select_entry, only: :user_projects
|
||||
|
@ -1025,6 +1025,7 @@ class UsersController < ApplicationController
|
|||
student_work.work_status = 1
|
||||
end
|
||||
|
||||
student_work.commit_time = Time.now
|
||||
student_work.save
|
||||
send_message_to_teacher(student_work)
|
||||
homework.update_column(:updated_at, Time.now)
|
||||
|
@ -1555,7 +1556,7 @@ class UsersController < ApplicationController
|
|||
stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
|
||||
stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
|
||||
@receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5)
|
||||
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time)
|
||||
if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.created_at > @receive_homeworks.first.created_at)
|
||||
@manage_pre = true
|
||||
else
|
||||
@manage_pre = false
|
||||
|
@ -3439,7 +3440,22 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def user_projectlist
|
||||
@order, @c_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
|
||||
#limit = 5
|
||||
|
||||
@my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_projects_count = @my_projects.count
|
||||
|
||||
@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
|
||||
@my_joined_projects_count = @my_joined_projects.count
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def sort_project_list
|
||||
@order, @c_sort, @type, @list_type = params[:order] || 1, params[:sort] || 1, params[:type] || 1, params[:list_type] || 1
|
||||
#limit = 5
|
||||
|
||||
#确定 sort_type
|
||||
if @order.to_i == @type.to_i
|
||||
|
@ -3448,11 +3464,16 @@ class UsersController < ApplicationController
|
|||
@c_sort = 2
|
||||
end
|
||||
|
||||
sort_name = "updated_at"
|
||||
sort_name = "updatetime"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
#@projects = @user.projects.visible.order("#{sort_name} #{sort_type}")
|
||||
@projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS #{sort_name} ").order("#{sort_name} #{sort_type}")
|
||||
if @list_type.to_i == 1
|
||||
@projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
else
|
||||
@projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
end
|
||||
@projects_count = @projects.count
|
||||
|
||||
#根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num
|
||||
if @order.to_i == 2
|
||||
|
@ -3469,18 +3490,8 @@ class UsersController < ApplicationController
|
|||
@type = 1
|
||||
end
|
||||
|
||||
#分页
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@atta_count = @projects.count
|
||||
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
|
||||
@offset ||= @atta_pages.offset
|
||||
@projects = paginateHelper @projects,@limit
|
||||
@is_project = 1
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -252,13 +252,16 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
|
||||
def sendBind(request)
|
||||
tmpurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login&connect_redirect=1#wechat_redirect"
|
||||
logger.info "tmpurl!!!!!!!!!!!!!!"
|
||||
logger.info tmpurl
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
||||
我们将会与微信不断结合,为您提供更有价值的服务。
|
||||
|
||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||
request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login#wechat_redirect"
|
||||
url = tmpurl
|
||||
pic_url = "#{ROOT_URL}/images/weixin_pic.jpg"
|
||||
article.item title: "#{n[:title]}",
|
||||
description: n[:content],
|
||||
|
|
|
@ -2738,7 +2738,7 @@ module ApplicationHelper
|
|||
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
|
||||
end
|
||||
else
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
||||
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束"
|
||||
|
@ -2841,7 +2841,7 @@ module ApplicationHelper
|
|||
#获取当前作业的提交截止时间/互评截止时间
|
||||
def cur_homework_end_time homework
|
||||
str = ""
|
||||
if homework.anonymous_comment == 0 && homework.end_time < Date.today && homework.homework_detail_manual
|
||||
if homework.anonymous_comment == 0 && homework.end_time && homework.end_time < Date.today && homework.homework_detail_manual
|
||||
str = "互评截止:#{format_date homework.homework_detail_manual.evaluation_end}"
|
||||
else
|
||||
str = "提交截止:#{homework.end_time ? (format_date homework.end_time) : ' -- '}"
|
||||
|
|
|
@ -14,4 +14,37 @@ module PullRequestsHelper
|
|||
User.find(user_id).try(:login)
|
||||
end
|
||||
|
||||
# 获取接受PullRequest用户的信息
|
||||
def accept_user pull_request_id
|
||||
PullRequest.where(:pull_request_id => pull_request_id).first
|
||||
end
|
||||
|
||||
def get_state state
|
||||
case state
|
||||
when "open","reopened"
|
||||
l(:label_state_open)
|
||||
when "closed"
|
||||
l(:label_state_closed)
|
||||
when "merged"
|
||||
l(:label_state_merged)
|
||||
end
|
||||
end
|
||||
|
||||
def type_count type, requests_opened_count, requests_merged_count, requests_closed_count
|
||||
case type
|
||||
when nil, "1"
|
||||
requests_opened_count
|
||||
when "2"
|
||||
requests_merged_count
|
||||
when "3"
|
||||
requests_closed_count
|
||||
end
|
||||
end
|
||||
|
||||
# 判断是否允许创建Pull Request
|
||||
# 如果分支相同,并且项目相同则提示
|
||||
def judge_pr_allow
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -6,18 +6,23 @@ module QualityAnalysisHelper
|
|||
if val <= 5
|
||||
arr << "很好"
|
||||
arr << "b_green2"
|
||||
arr << "A"
|
||||
elsif val. > 5 && val <= 10
|
||||
arr << "较好"
|
||||
arr << "b_slow_yellow"
|
||||
arr << "B"
|
||||
elsif val > 10 && val <= 20
|
||||
arr << "中等"
|
||||
arr << "b_yellow"
|
||||
arr << "C"
|
||||
elsif val > 20 && val <= 50
|
||||
arr << "较差"
|
||||
arr << "b_slow_red"
|
||||
arr << "D"
|
||||
elsif val > 20
|
||||
arr << "很差"
|
||||
arr << "b_red"
|
||||
arr << "E"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ module RepositoriesHelper
|
|||
end
|
||||
|
||||
# 获取文件目录的最新动态
|
||||
def get_trees_last_changes(project_id, rev, ent_name, g)
|
||||
def get_trees_last_changes(gpid, rev, ent_name, g)
|
||||
begin
|
||||
tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name)
|
||||
tree_changes = g.rep_last_changes(gpid, :rev => rev, :path => ent_name)
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
|
|
|
@ -80,6 +80,7 @@ class Course < ActiveRecord::Base
|
|||
after_update :update_files_public,:update_course_ealasticsearch_index
|
||||
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index
|
||||
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
|
||||
after_save :log_infor
|
||||
|
||||
safe_attributes 'extra',
|
||||
'time',
|
||||
|
@ -504,6 +505,10 @@ class Course < ActiveRecord::Base
|
|||
ticket
|
||||
end
|
||||
|
||||
def log_infor
|
||||
Rails.logger.info "##########################################################course's syllabus_id is #{self.syllabus_id}."
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -1254,12 +1254,14 @@ class Project < ActiveRecord::Base
|
|||
|
||||
|
||||
def create_project_ealasticsearch_index
|
||||
return if Rails.env.development?
|
||||
if self.is_public
|
||||
self.__elasticsearch__.index_document
|
||||
end
|
||||
end
|
||||
|
||||
def update_project_ealasticsearch_index
|
||||
return if Rails.env.development?
|
||||
if self.is_public #如果是初次更新成为公开的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
|
||||
begin
|
||||
self.__elasticsearch__.update_document
|
||||
|
@ -1276,6 +1278,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def delete_project_ealasticsearch_index
|
||||
return if Rails.env.development?
|
||||
begin
|
||||
self.__elasticsearch__.delete_document
|
||||
rescue => e
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
class PullRequest < ActiveRecord::Base
|
||||
attr_accessible :gpid, :pull_request_id, :user_id
|
||||
validates_uniqueness_of :pull_request_id
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
#学生提交作品表
|
||||
class StudentWork < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
|
||||
|
||||
belongs_to :homework_common
|
||||
belongs_to :user
|
||||
|
|
|
@ -357,7 +357,6 @@ class CoursesService
|
|||
#@course.password = params[:course][:password]
|
||||
@course.tea_id = current_user.id
|
||||
@course.syllabus_id = params[:syllabus_id].to_i
|
||||
Rails.logger.error "update_syllabus_id: courses_service/create_course"
|
||||
@course.term = params[:term]
|
||||
@course.time = params[:time]
|
||||
@course.end_term = params[:end_term]
|
||||
|
@ -417,7 +416,6 @@ class CoursesService
|
|||
#course.safe_attributes = params[:course]
|
||||
#course.password = params[:course][:password]
|
||||
course.syllabus_id = params[:syllabus_id].to_i
|
||||
Rails.logger.error "update_syllabus_id: courses_service/edit_course"
|
||||
course.time = params[:time]
|
||||
course.term = params[:term]
|
||||
course.end_time = params[:end_time]
|
||||
|
|
|
@ -83,14 +83,12 @@ class SyllabusesService
|
|||
courses.each do |course|
|
||||
if ::Course === course
|
||||
course.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/create"
|
||||
course.save!
|
||||
send_wechat_create_class_notice user,course
|
||||
elsif Hash === course
|
||||
c = ::Course.new(course)
|
||||
c.tea_id = user.id
|
||||
c.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/create"
|
||||
c.update_default_value
|
||||
c.is_public = 0
|
||||
c.save!
|
||||
|
@ -135,7 +133,6 @@ class SyllabusesService
|
|||
course.name = c
|
||||
course.tea_id = user.id
|
||||
course.syllabus_id = sy.id
|
||||
Rails.logger.error "update_syllabus_id: syllabus_service/edit"
|
||||
course.update_default_value
|
||||
course.is_public = 0
|
||||
course.save!
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
<span>测验时长:<%= exercise.time %>分钟</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<pre class="fontGrey2 font_cus"><%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%></pre>
|
||||
<pre class="fontGrey2 font_cus" style="white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:pre-wrap;white-space:-o-pre-wrap;word-break:normal;word-wrap: break-word;">
|
||||
<%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%>
|
||||
</pre>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -1,19 +1,14 @@
|
|||
<% curse_attachments.each do |file| %>
|
||||
<% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %>
|
||||
<% curse_attachments.each do |file| %>
|
||||
<% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %>
|
||||
<div id="resource_detail_<%=file.id %>">
|
||||
<%=render :partial=>'files/resource_detail',:locals => {:file => file} %>
|
||||
<%=render :partial=>'files/resource_detail',:locals => {:file => file} %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if curse_attachments.count == 10%>
|
||||
<% if params[:action] == 'search' %>
|
||||
<%=link_to "点击展开更多", search_course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||
<% else %>
|
||||
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
||||
<%=link_to "点击展开更多", course_files_path(:course_id => course.id, :page => @page), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||
<%end%>
|
||||
<% end%>
|
||||
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -66,17 +66,10 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if project_attachments.count == 10%>
|
||||
<% if params[:action] == 'search_project' %>
|
||||
<!--<ul class="wlist">-->
|
||||
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>-->
|
||||
<!--</ul>-->
|
||||
<%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||
<%else%>
|
||||
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
||||
<%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||
<%end%>
|
||||
<% end%>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<% if @course %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% elsif @project %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list', :locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments})%>");
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% elsif @org_subfield %>
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list', :locals => {org_subfield:@org_subfield, all_attachments:@all_attachments, sort:@sort, order:@order, org_subfield_attachments:@obj_attachments})%>");
|
||||
<%end %>
|
|
@ -1,6 +1,3 @@
|
|||
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %> //搜索的时候有时候是需要加载下一页,有时候是直接替换当前 #course_list。这个根据 page来判定
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach} )%>");
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @result.count%>")
|
||||
<% end %>
|
||||
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
|
|
|
@ -1,7 +1,2 @@
|
|||
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %> //搜索的时候有时候是需要加载下一页,有时候是直接替换当前 #course_list。这个根据 page来判定
|
||||
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list',
|
||||
:locals => {project: @project, all_attachments:@result, sort:@sort, order:@order, project_attachments:@searched_attach})%>");
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'files/project_list',:locals => {project:@project, all_attachments:@result, sort:@sort, order:@order,project_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @project_attachment_result.count %>")
|
||||
<% end %>
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<% if @course %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
|
||||
$("#course_filter_order").html("<%= escape_javascript(render :partial => 'course_file_filter_order', :locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach, tag_name: @tag_name, q: @q})%>");
|
||||
$("#attachment_count").html("<%= @result.count%>")
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'project_list',:locals => {project:@project, all_attachments:@result_search_project, sort:@sort, order:@order, project_attachments:@searched_attach}) %>");
|
||||
$("#attachment_count").html("<%= @result_search_project.count%>")
|
||||
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
|
||||
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
|
||||
<% end %>
|
||||
|
|
|
@ -5,27 +5,27 @@
|
|||
<div class="cl"></div>
|
||||
</h3>
|
||||
<ul class="sy_info mt15" id="all_syllabus_attr">
|
||||
<li><label >创建教师</label><span class="fl ml10 sy_cgrey"><%=syllabus.user.show_name %></span></li>
|
||||
<li><label >创建教师</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.user.show_name %></span></li>
|
||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||
<li><label>课程性质</label><span class="fl ml10 sy_cgrey"><%=syllabus.syllabus_type_str %></span></li>
|
||||
<li><label>课程性质</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.syllabus_type_str %></span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
<li><label>学分</label><span class="fl ml10 sy_cgrey"><%=syllabus.credit %>学分</span></li>
|
||||
<li><label>学分</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.credit %>学分</span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.hours.nil? || syllabus.hours == '' %>
|
||||
<li><label>总学时</label><span class="fl ml10 sy_cgrey"><%=syllabus.hours %>学时</span></li>
|
||||
<li><label>总学时</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.hours %>学时</span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.theory_hours.nil? || syllabus.theory_hours == '' %>
|
||||
<li><label>理论学时</label><span class="fl ml10 sy_cgrey"><%=syllabus.theory_hours %>学时</span></li>
|
||||
<li><label>理论学时</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.theory_hours %>学时</span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.practice_hours.nil? || syllabus.practice_hours == '' %>
|
||||
<li><label>实践学时</label><span class="fl ml10 sy_cgrey"><%=syllabus.practice_hours %>学时</span></li>
|
||||
<li><label>实践学时</label><span class="fl ml10 sy_cgrey w110"><%=syllabus.practice_hours %>学时</span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.applicable_major.nil? || syllabus.applicable_major == '' %>
|
||||
<li><label>适用专业</label><span class="fl ml10 sy_cgrey"><%=syllabus.applicable_major %></span></li>
|
||||
<li><label>适用专业</label><span class="fl ml10 sy_cgrey w110" style="word-wrap:break-word;"><%=syllabus.applicable_major %></span></li>
|
||||
<% end %>
|
||||
<% unless syllabus.pre_course.nil? || syllabus.pre_course == '' %>
|
||||
<li><label>先修课程</label><span class="fl ml10 sy_cgrey"><%=syllabus.pre_course %></span></li>
|
||||
<li><label>先修课程</label><span class="fl ml10 sy_cgrey w110" style="word-wrap:break-word;"><%=syllabus.pre_course %></span></li>
|
||||
<% end %>
|
||||
|
||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<li>
|
||||
<span class="user_icons_class"></span>
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "course_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "project_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
|
||||
<div class="user_navmore_box">
|
||||
<ul class="<%#= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
|
@ -60,16 +60,16 @@
|
|||
|
||||
<% if all_count > (page.to_i+1) * 10%>
|
||||
<input type="hidden" value="<%= page%>" id="project_page_num">
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_project" onclick="show_more_project('<%= user_projects4show_user_path(user.id)%>');">
|
||||
<a class="user_navmorebox" href="javascript:void(0);" id="user_show_more_project" onclick="show_more_project('<%= user_projects4show_user_path(user.id,:page => page)%>');">
|
||||
<span class="user_icons_moreclass"></span>
|
||||
</a>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var projectcount = <%= @user.projects.visible.count %>;
|
||||
var projectshowcount = document.getElementsByClassName("course_list_menu").length;
|
||||
var projectcount = <%= all_count %>;
|
||||
var projectshowcount = document.getElementsByClassName("project_list_menu").length;
|
||||
|
||||
if((projectcount <= projectshowcount)&&(projectcount > 5)){
|
||||
if((projectcount <= projectshowcount)&&(projectcount > 10)){
|
||||
$("#user_show_more_project").hide();
|
||||
$('#user_hide_project').show();
|
||||
}
|
||||
|
|
|
@ -328,7 +328,6 @@
|
|||
for(var i = 10; i < target.length; i++){
|
||||
target.eq(i).slideToggle();
|
||||
}
|
||||
$('#homepageLeftMenuForge').slideToggle();
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_closeclass");
|
||||
$('#hide_show_projecticon').toggleClass("user_icons_moreclass");
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_projects_new_name)%> :</label>
|
||||
<input type="text" name="project[name]" id="project_name" class="courses_input" maxlength="100" onkeyup="regex_project_name();">
|
||||
<input type="text" name="project[name]" id="project_name" class="courses_input" maxlength="100" placeholder="例如:团队协作方法与机制研究" onkeyup="regex_project_name();">
|
||||
<span class="c_red" id="project_name_notice" style="display: none;">项目名称不能为空</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<% if @forked_project.nil? %>
|
||||
<%= select_tag :branch, options_for_select(@source_rev), :id => "pull_request_branch", :name => "target_branch", :value => "target_branch",:class => "ml30 fontGrey3 fb fl", :style => "padding:5px 0 5px 5px;" %>
|
||||
<% else %>
|
||||
<select onchange="choice_branch(this.value, document.getElementById('pull_request_branch'), <%= @source_rev %>, <%= @forked_rev %>);" name="source_project" value="source_project" class="ml30 fontGrey3 fb fl" style = "padding:5px 0 5px 5px;">
|
||||
<option value="source_project_name"><%= @source_project_name %></option>
|
||||
<option value="forked_project_name"><%= @forked_project_name %></option>
|
||||
<select onchange="choice_branch(this.value, document.getElementById('pull_request_branch'), <%= @source_rev %>, <%= @forked_rev %>);" id="pull_request_project" name="source_project" value="source_project" class="ml30 fontGrey3 fb fl" style = "padding:5px 0 5px 5px;">
|
||||
<option name="<%= @project.id %>" value="source_project_name" ><%= @source_project_name %></option>
|
||||
<option name="<%= @forked_project.id %>" value="forked_project_name" ><%= @forked_project_name %></option>
|
||||
</select>
|
||||
<select name="target_branch" id="pull_request_branch" class = "ml30 fontGrey3 fb fl" style = "width:140px; padding:5px 0 5px 5px;">
|
||||
<% @source_rev.each do |rev| %>
|
||||
|
@ -25,8 +25,9 @@
|
|||
<% end %>
|
||||
</select>
|
||||
<% end %>
|
||||
<p id="pull_request_project_hidden" style="display: none"><%= @forked_project.nil? ? "" : @project.id %></p>
|
||||
<div class="cl"></div>
|
||||
<p id ="pull_request_branch_error" class="ml100 fontGrey2 mt5 c_red" style="display: none">同一个项目的源分支和目标分支不能相同</p>
|
||||
<p id ="pull_request_branch_error" class="ml100 fontGrey2 mt5 c_red" style="display: none">没有内容可以合并,请切换一个不同的分支</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-row b_grey" style="border-top:1px solid #ddd;">
|
||||
|
@ -56,7 +57,9 @@
|
|||
{
|
||||
var source_branch = $.trim($("#source_branch").val());
|
||||
var target_branch = $.trim($("#pull_request_branch").val());
|
||||
if(source_branch == target_branch)
|
||||
var target_project = $.trim($("#pull_request_project").children().attr("name"));
|
||||
var target_forked_project = $.trim($("#pull_request_project_hidden").text());
|
||||
if(target_project == target_forked_project && source_branch == target_branch)
|
||||
{
|
||||
$("#pull_request_branch_error").show();
|
||||
return false;
|
||||
|
@ -71,7 +74,7 @@
|
|||
//提交pull request
|
||||
function pull_request_commit()
|
||||
{
|
||||
if(regex_pr_name())
|
||||
if(regex_pr_name() && regex_branch())
|
||||
{
|
||||
$("#pull_request_form").submit();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% unless @changes.blank? %>
|
||||
<% if !@changes.blank? && @type == "3" %>
|
||||
<% @changes.each do |cd| %>
|
||||
<div class="showing-changes-row fontGrey2" style="width:710px;">
|
||||
<a class="linkGrey3" id="changed-files">
|
||||
|
@ -29,5 +29,13 @@
|
|||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<div class="merge-discussion-input">
|
||||
<%= form_tag(url_for(:controller => 'pull_requests', :action => 'create_pull_request_comment', :project_id => @project.id), :id => 'pull_request_comment_form', :method => "post", :remote => true) do %>
|
||||
<textarea id="pull_request_comment" name="pull_request_comment"></textarea>
|
||||
<span id ="pr_comment_tip" class="fontGrey2 c_red" style="display: none">内容不能为空</span>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn mt10" onclick="pull_request_commit()">留言</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% @comments.each do |comment| %>
|
||||
<div class="merge-discussion-content merge-discussion-automatic">
|
||||
<%= link_to comment.author.try(:username), user_path(get_user_by_login_and(comment.author.try(:username))), :class => "link-blue mr15 fl" %>
|
||||
<span class="fl fontGrey2"><%= time_tag(comment.created_at) %>前</span>
|
||||
<div class="cl"></div>
|
||||
<div class="merge-discussion-detail"><%= comment.note %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function regex_pr_comment()
|
||||
{
|
||||
var comment = $.trim($("#pull_request_comment").val());
|
||||
if(comment.length == 0)
|
||||
{
|
||||
$("#pr_comment_tip").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#pr_comment_tip").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//提交pull request_comment
|
||||
function pull_request_commit()
|
||||
{
|
||||
if(regex_pr_comment())
|
||||
{
|
||||
$("#pull_request_comment_form").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,19 +1,32 @@
|
|||
<% @commits.each do |commit| %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-commit-time">
|
||||
<img width="16" class="ui-datepicker-trigger mr15" style="cursor:default; margin-top:3px; margin-left:0;" /><span class="fontGrey3"><%= format_date(commit.created_at) %></span>
|
||||
<!--<p class="mt10 fontGrey2">1次提交</p>-->
|
||||
<p class="mt10 fontGrey2"><%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %>创建于<%= time_tag(commit.created_at) %>前</p>
|
||||
</div>
|
||||
<div class="merge-commit-detail">
|
||||
<span class="fontGrey3 fb"><%= commit.title %></span>
|
||||
<div class="new-merge-row b_grey fontGrey2"><span class="ml10"> 根据最近提交时间排列</span></div>
|
||||
<% if !@commits.blank? && @type == "2" %>
|
||||
<% @commits.each do |commit| %>
|
||||
<div class="new-merge-wrap">
|
||||
<div class="merge-commit-time">
|
||||
<img width="16" class="ui-datepicker-trigger mr15" style="cursor:default; margin-top:3px; margin-left:0;" /><span class="fontGrey3"><%= format_date(commit.created_at) %></span>
|
||||
<!--<p class="mt10 fontGrey2">1次提交</p>-->
|
||||
<p class="mt10 fontGrey2"><%= link_to commit.author_name, user_path(get_user_by_mail(commit.author_email)), :class => "link-blue" %> 创建于<%= time_tag(commit.created_at) %>前</p>
|
||||
</div>
|
||||
<div class="merge-commit-detail">
|
||||
<span class="fontGrey3 fb"><%= commit.title %></span>
|
||||
|
||||
</div>
|
||||
<div class="merge-commit-code">
|
||||
</div>
|
||||
<div class="merge-commit-code">
|
||||
<span class="fontGrey3">
|
||||
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<% @requests.each do |request| %>
|
||||
<li>
|
||||
<% request %>
|
||||
<%=link_to request.title, project_pull_request_path(request.id, :project_id => @project.id), :class => "linkGrey3 fb fl"%>
|
||||
<%=link_to request.title, project_pull_request_path(request.id, :project_id => @project.id), :class => "linkGrey3 fb fl hidden", :style => "width:100%;"%>
|
||||
<!--<a href="javascript:void(0);" class="fr fontGrey2 fb"><img src="/images/comments.png" class="mr5" width="15" />0</a><span class="fr mr15 fb fontGrey2">关闭</span>-->
|
||||
<div class="cl mb5"></div>
|
||||
<span class="fontGrey2">由 <%= link_to request.author.try(:username), user_path(get_user_by_login_and(request.author.try(:username))), :class => "link-blue" %> 创建于<%= time_tag(request.created_at) %></span>
|
||||
|
@ -12,4 +12,13 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -4,14 +4,17 @@
|
|||
|
||||
<div id="pull_request_show">
|
||||
<div id="mergeShow" class="f14 fontGrey2 merge-show">
|
||||
<span class="mr10 open-status"><%= @request.state == "merged" ? "已合并" : "待处理" %></span><span class="mr10">合并请求</span> 由<%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %>提交 · 最后编辑时间<%= time_tag(@request.updated_at) %>
|
||||
<!--<a href="javascript:void(0);" class="BlueCirBtnMini fr mt5">编辑</a>-->
|
||||
<span class="mr10 open-status"><%= get_state(@request.state) %></span><span class="mr10">合并请求</span> 由 <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %> 于 <%= time_tag(@request.created_at) %> 前提交 · 最后编辑时间 <%= time_tag(@request.updated_at) %> 前
|
||||
<% unless @request.state == "merged" %>
|
||||
<%= link_to "#{@request.state == 'closed' ? '重新打开' : '关闭'}", update_pull_request_project_pull_request_path(@request.id, :project_id => @project.id, :state => @request.state =="closed" ? "reopen" : "close"), :class => "BlueCirBtn fr" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="new-merge-row b_grey"><strong><%= @request.title %></strong><p class="mt10"><%= @request.description %></p></div>
|
||||
<div class="mt10 mb15">
|
||||
请求将 <span class="fontGrey3 fb"><%= @request.source_branch %></span> 合并至 <span class="fontGrey3 fb"><%= @request.target_branch %></span>
|
||||
|
||||
<div class="mt10 mb15">
|
||||
<%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>
|
||||
请求将 <span class="fontGrey3 fb"><%= @request.source_branch %></span> 合并至 <span class="fontGrey3 fb"><%= @request.target_branch %></span>
|
||||
<% if @commits_count == 0 && @changes_count == 0 %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<span class="fontGrey3 fb" style="font-size:13px;"><img src="/images/warning.png" width="16" class="mr5 mt2 fl"><%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %></span><br />
|
||||
|
@ -21,29 +24,42 @@
|
|||
<% else %>
|
||||
<% if @request.state == "merged" %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<span class="fontGrey3 fb" style="font-size:13px;"><%#= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %> 前合并</span><br />
|
||||
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
|
||||
<% if accept_user(@request.id).blank? %>
|
||||
<p class="fontGrey2 mt5">改动已合并至<%= @request.target_branch %></p>
|
||||
<% else %>
|
||||
<span class="fontGrey3 fb" style="font-size:13px;"><%= link_to User.find(accept_user(@request.id).user_id), user_path(accept_user(@request.id).user_id), :class => "link-blue" %> 于 <%= time_tag(accept_user(@request.id).created_at) %> 前合并</span><br />
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if is_project_manager?(User.current.id, @project.id) %>
|
||||
<div class="merge-commit-option mt15">
|
||||
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
|
||||
<% if @request.state == "closed" %>
|
||||
该请求已被关闭
|
||||
<% else %>
|
||||
<%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="merge-record" style="border-top:1px solid #ddd;">
|
||||
<li><%= link_to "提交<span class='project-number-dot'>#{@commits_count}</span>".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => 1), :remote => true, :class => "active" %></li>
|
||||
<li><%= link_to "改动<span class='project-number-dot'>#{@changes_count}</span>".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => 2), :remote => true %></li>
|
||||
<li><%= link_to "留言<span class='project-number-dot'>#{@comments_count}</span>".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id, :type => "1"), :remote => true, :class => "active" %></li>
|
||||
<li><%= link_to "提交<span class='project-number-dot'>#{@commits_count}</span>".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => "2"), :remote => true %></li>
|
||||
<li><%= link_to "改动<span class='project-number-dot'>#{@changes_count}</span>".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => "3"), :remote => true %></li>
|
||||
</ul>
|
||||
<div class="new-merge-row b_grey fontGrey2"><span class="ml10"> 根据最近提交时间排列</span></div>
|
||||
<div id="merge_record_0">
|
||||
<% if @type == nil || @type == "1" %>
|
||||
<div id="merge_record_0">
|
||||
<%= render :partial => "pull_requests/pull_request_comments" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="merge_record_1" class="undis">
|
||||
<%= render :partial => "pull_requests/pull_request_commits" %>
|
||||
</div>
|
||||
<div id="merge_record_1" class="undis">
|
||||
<div id="merge_record_2" class="undis">
|
||||
<%= render :partial => "pull_requests/pull_request_changes" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
@ -51,19 +67,13 @@
|
|||
<script>
|
||||
$("#pull_request_show").parent().css("width","730px");
|
||||
|
||||
$("#changed-files").toggle(function(){
|
||||
$("#changed-files-detail").show();
|
||||
},function(){
|
||||
$("#changed-files-detail").hide();
|
||||
});
|
||||
|
||||
$(".merge-record li a").click(function(){
|
||||
$(".merge-record li a").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
var index = $(".merge-record li a").index(this);
|
||||
|
||||
$("#merge_record_0, #merge_record_1").hide();
|
||||
$("#merge_record_0, #merge_record_1, #merge_record_2").hide();
|
||||
$("#merge_record_" + index).show();
|
||||
});
|
||||
</script>
|
|
@ -2,6 +2,7 @@
|
|||
<ul id="mergeBanner" class="project-merge-banner">
|
||||
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
|
||||
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
||||
<div class="cl"></div>
|
||||
|
@ -12,6 +13,7 @@
|
|||
<%= render "pull_requests/pull_requests_list" %>
|
||||
</ul>
|
||||
|
||||
|
||||
<script>
|
||||
$("#mergeBanner").parent().css("width","730px");
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes", :locals => {:type => @type} ) %>');
|
||||
$("#merge_record_2").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');
|
|
@ -0,0 +1 @@
|
|||
$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_comments") %>');
|
|
@ -1 +1 @@
|
|||
$("#merge_record_0").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits", :locals => {:type => @type} ) %>');
|
||||
$("#merge_record_1").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_commits") %>');
|
|
@ -10,22 +10,23 @@
|
|||
<li class="analysis-result-version fl fontBlue2" >分支</li>
|
||||
<li class="analysis-result-loc fl fontBlue2" >语言</li>
|
||||
<li class="analysis-result-debt fl fontBlue2" >路径</li>
|
||||
<li class="analysis-result-time fl fontBlue2" ></li>
|
||||
<!--<li class="analysis-result-time fl fontBlue2" >bianji</li>-->
|
||||
<li class="analysis-result-time fl fontBlue2" >最近更新</li>
|
||||
<li class="analysis-result-edit fl fontBlue2" ></li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% if @quality_analyses.count >0 %>
|
||||
<% @quality_analyses.each do |qa| %>
|
||||
<ul class="analysis-result-list">
|
||||
<li title="Name" title="名称"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></li>
|
||||
<li class="analysis-result-version fl fontBlue2 hidden" title="分支名"><%= qa.branch %></li>
|
||||
<li class="analysis-result-loc fl fontBlue2 hidden" title="语言"><%= qa.language %></li>
|
||||
<li class="analysis-result-debt fl fontBlue2 hidden" title="路径"><%= qa.path %></li>
|
||||
<li title="<%= qa.author_login+ ':' +qa.rep_identifier %>"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %></li>
|
||||
<li class="analysis-result-version fl fontBlue2 hidden" title="<%= qa.branch %>"><%= qa.branch %></li>
|
||||
<li class="analysis-result-loc fl fontBlue2 hidden" title="<%= qa.language %>"><%= qa.language %></li>
|
||||
<li class="analysis-result-debt fl fontBlue2 hidden" title="<%= qa.path %>"><%= qa.path %></li>
|
||||
<li class="analysis-result-time fl fontBlue2 hidden" title="<%= qa.updated_at %>"><%= format_time(qa.updated_at) %></li>
|
||||
<% if User.current.try(:login) == qa.author_login || User.current.admin? || is_project_manager?(User.current.id, @project.id) %>
|
||||
<li class="analysis-result-time fl" title="编辑">
|
||||
<li class="analysis-result-edit fl fontBlue2 hidden" title="<%= qa.path %>">
|
||||
<%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %><span style="color: #888"> / </span>
|
||||
<%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果,确定删除吗?", :class => "fontBlue2" %>
|
||||
</li>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="analysis-genral">
|
||||
<p id="container_sqale_rating" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
||||
<p class="fontGrey3">质量等级</p>
|
||||
<p class="fontBlue2 pr"><%= @ha["sqale_rating"] %>
|
||||
<p class="fontBlue2 pr"><%= sqale_rating_status(@ha["sqale_rating"].to_i)[2] %>
|
||||
<span class="f10 c_white analysis-genral-icon <%= sqale_rating_status(@ha["sqale_rating"].to_i)[1] %> borderRadius">
|
||||
<%= @ha["sqale_rating"].nil? ? "很好" : sqale_rating_status(@ha["sqale_rating"].to_i)[0] %>
|
||||
</span>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<div class="c_red">本次分析失败,原因如下:</div>
|
||||
<% if @build_console_result == false %>
|
||||
分析超时
|
||||
<% elsif params[:message] %>
|
||||
<%= params[:message] %>
|
||||
<% else %>
|
||||
<%= h @error_list.try(:output).html_safe %>
|
||||
<% end %>
|
||||
|
|
|
@ -26,19 +26,19 @@
|
|||
</td>
|
||||
<div id="children_tree">
|
||||
<td class="tree-comments c_grey hidden">
|
||||
<div class="hidden" title="<%= (latest_changes.message) if latest_changes && latest_changes.message %>">
|
||||
<%= (latest_changes.message) if latest_changes && latest_changes.message %>
|
||||
<div class="hidden" title="<%= (latest_changes.message) if latest_changes %>">
|
||||
<%= (latest_changes.message) if latest_changes %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="tree-author c_grey">
|
||||
<div class="hidden" title="<%= (latest_changes.author) if latest_changes && latest_changes.author %>">
|
||||
<%= (latest_changes.author) if latest_changes && latest_changes.author %>
|
||||
<div class="hidden" title="<%= (latest_changes.author_name) if latest_changes %>">
|
||||
<%= (latest_changes.author_name) if latest_changes %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="tree-age c_grey">
|
||||
<div class="hidden" title="<%= format_time(latest_changes.time) %>">
|
||||
<div class="hidden" title="<%= format_time(latest_changes.time) if latest_changes %>">
|
||||
<%# 为了转换UTC时间,时差8小时 %>
|
||||
<%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>
|
||||
<%= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes %>
|
||||
</div>
|
||||
</td>
|
||||
</div>
|
||||
|
|
|
@ -31,9 +31,11 @@
|
|||
|
||||
<div class="HomeWorkCon mt15" nhname='student_work_form'>
|
||||
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
|
|
|
@ -235,9 +235,11 @@
|
|||
:action => 'create',
|
||||
:homework => @homework.id
|
||||
},:remote=>true ) do |f| %>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class=" c_red mb10">
|
||||
提示:作品名称和描述中不要出现真实的姓名信息
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
|
||||
|
|
|
@ -135,9 +135,9 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.student_works.has_committed.count != 0 %>
|
||||
<% sw = activity.student_works.has_committed.reorder("created_at desc").first %>
|
||||
<% sw = activity.student_works.has_committed.reorder("commit_time desc").first %>
|
||||
<div class="mt10 homepagePostDeadline mb10">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
# <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<div id="user_join_projects_list">
|
||||
<%= render :partial => 'users/project_list', :locals => {:projects => @my_joined_projects, :list_type => 2, :count => @my_joined_projects_count}%>
|
||||
</div>
|
|
@ -0,0 +1,3 @@
|
|||
<div id="user_projects_list">
|
||||
<%= render :partial => 'users/project_list', :locals => {:projects => @my_projects, :list_type => 1, :count => @my_projects_count}%>
|
||||
</div>
|
|
@ -0,0 +1,63 @@
|
|||
<div class="syllabus_category">
|
||||
<% unless projects.empty? %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
|
||||
<% end %>
|
||||
<span class="grayTxt fl "><%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="syllabus_courses_box" id="project_li_<%=list_type %>">
|
||||
<% if projects.empty? %>
|
||||
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
|
||||
<% if list_type == 1 %>
|
||||
<p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有创建项目~~<br />
|
||||
<%= link_to "创建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有加入项目~~<br />
|
||||
<%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% projects.each_with_index do |project, i| %>
|
||||
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
|
||||
<div class="sy_courses_open">
|
||||
<span class="icons_project_list fl mt5 mr10"></span>
|
||||
<h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
|
||||
<% unless project.is_public? %>
|
||||
<span class="hw_icon_private fl"></span>
|
||||
<% end %>
|
||||
<% projectUser = User.where("id=?",project.user_id).first %>
|
||||
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="fl sy_p_grey">更新时间:<%= format_date(project.updatetime) %></p>
|
||||
<div class=" fr">
|
||||
<p class="list-info fr grayTxt">
|
||||
<%= link_to project.members.count, member_project_path(project), :class => "c_blue" %><span class="mr5">成员 |</span>
|
||||
<%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %><span class="mr5">问题 |</span>
|
||||
<%= link_to project.project_score.attach_num, project_files_path(project), :class => "c_blue" %><span class="mr5">资源</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if count > 5 %>
|
||||
<div class="syllabus_courses_list">
|
||||
<p class="new_projectlist_more"><a id="project_more_<%=list_type %>" href="javascript:void(0);" data-count="<%= count %>" data-init="0" onclick="expand_projects('#project_more_<%=list_type %>', '#project_li_<%=list_type %>', <%=count%>);">共<%=count %>个项目,点击全部展开</a></p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div><!--syllabus_courses_box end-->
|
|
@ -25,10 +25,3 @@
|
|||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" id="cancel_group">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
if($.trim($("#base_on_project").val()) == 1) {
|
||||
$("#base_on_project").attr('checked','checked');
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -146,9 +146,9 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.student_works.has_committed.count != 0 %>
|
||||
<% sw = homework_common.student_works.has_committed.reorder("created_at desc").first %>
|
||||
<% sw = homework_common.student_works.has_committed.reorder("commit_time desc").first %>
|
||||
<div class="mt10 homepagePostDeadline mb10">
|
||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
# <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
@ -302,7 +302,7 @@
|
|||
|
||||
<% count=homework_common.journals_for_messages.count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => -1, :is_in_course => is_in_course,:course_activity=>-1} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => homework_common.id, :is_in_course => is_in_course,:course_activity=>-1} %>
|
||||
|
||||
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
} else {
|
||||
$("#anonymous_comment").attr('checked',false);
|
||||
}
|
||||
if($.trim($("#base_on_project").val()) == 1) {
|
||||
$("#base_on_project").attr('checked','checked');
|
||||
}
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
$("#BluePopupBox a.BlueCirBtn").click();
|
||||
<% end %>
|
||||
|
|
|
@ -1,3 +1,86 @@
|
|||
<div class="syllabus_box">
|
||||
<h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>项目列表</h2>
|
||||
<div class="syllabus_category">
|
||||
<a class="sortdownbtn sort_no fr"></a><a href="#" class="sortTxt fr">人气</a>
|
||||
<a class="sortupbtn fr"></a><a href="#" class="sortTxt fr ">时间</a>
|
||||
<span class="grayTxt fl ">我创建的项目</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="syllabus_courses_box">
|
||||
<% @projects.each do |project|%>
|
||||
<div class="syllabus_courses_list" style="cursor: default">
|
||||
<div class="sy_courses_open">
|
||||
<span class="icons_project_list fl mt5 mr10"></span>
|
||||
<h3><%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
|
||||
<% unless project.is_public? %>
|
||||
<span class="hw_icon_private fl"></span>
|
||||
<% end %>
|
||||
<% projectUser = User.where("id=?",project.user_id).first %>
|
||||
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="fl sy_p_grey">更新时间:<%= format_date(project.updated_on) %></p>
|
||||
<div class=" fr">
|
||||
<p class="list-info fr grayTxt">
|
||||
<%= link_to project.members.count, member_project_path(project), :class => "c_blue" %><span class="mr5">成员 |</span>
|
||||
<%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %><span class="mr5">问题 |</span>
|
||||
<%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %><span class="mr5">资源</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="syllabus_courses_list ">
|
||||
<p class="new_projectlist_more"><a href="javascript:void(0);" >共100个项目,点击全部展开</a></p>
|
||||
</div>
|
||||
</div><!--syllabus_courses_box end-->
|
||||
</div><!--syllabus_box end-->
|
||||
|
||||
<div class="" style="height:20px; background:#eaebec;"></div>
|
||||
<div class="syllabus_box">
|
||||
<div class="syllabus_category">
|
||||
<a class="sortdownbtn sort_no fr"></a><a href="#" class="sortTxt fr">人气</a>
|
||||
<a class="sortupbtn fr"></a><a href="#" class="sortTxt fr ">时间</a>
|
||||
<span class="grayTxt fl ">我参与的项目</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="syllabus_courses_box">
|
||||
<% @projects.each do |project| %>
|
||||
<div class="syllabus_courses_list" style="cursor: default;">
|
||||
<div class="sy_courses_open">
|
||||
<span class="icons_project_list fl mt5 mr10"></span>
|
||||
<h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
|
||||
<% unless project.is_public? %>
|
||||
<span class="hw_icon_private fl"></span>
|
||||
<% end %>
|
||||
<% projectUser = User.where("id=?",project.user_id).first %>
|
||||
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="fl sy_p_grey">更新时间:<%= format_date(project.updated_on) %></p>
|
||||
<div class=" fr">
|
||||
<p class="list-info fr grayTxt">
|
||||
<%= link_to project.members.count, member_project_path(project), :class => "c_blue" %><span class="mr5">成员 |</span>
|
||||
<%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %><span class="mr5">问题 |</span>
|
||||
<%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %><span class="mr5">资源</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="syllabus_courses_list ">
|
||||
<p class="new_projectlist_more"><a href="javascript:void(0);" >共100个项目,点击全部展开</a></p>
|
||||
</div>
|
||||
</div><!--syllabus_courses_box end-->
|
||||
</div><!--syllabus_box end-->
|
||||
|
||||
|
||||
|
||||
<div class="listbox" id="project-list">
|
||||
<h2 class="list-h2">项目列表</h2>
|
||||
<div class="category">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<% if @list_type.to_i == 1 %>
|
||||
$("#user_projects_list").html('<%= escape_javascript(render :partial => 'users/project_list', :locals => {:projects => @projects, :list_type => 1, :count => @projects_count}) %>');
|
||||
<% else %>
|
||||
$("#user_join_projects_list").html('<%= escape_javascript(render :partial => 'users/project_list', :locals => {:projects => @projects, :list_type => 2, :count => @projects_count}) %>');
|
||||
<% end %>
|
|
@ -27,9 +27,19 @@
|
|||
<%# end %>
|
||||
</div>
|
||||
<p id="nodata" class="nodata" style="display:<%= @list.count > 0 ? 'none' : 'block' %>;"><%= l(:label_no_data) %></p>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<ul class="wlist" style=" border:none;">-->
|
||||
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>-->
|
||||
<!--</ul>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
</div>
|
||||
<ul class="wlist" style=" border:none;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<!--</div>-->
|
||||
|
|
|
@ -1 +1,39 @@
|
|||
<%= render :partial => 'users/user_project_list'%>
|
||||
<div class="syllabus_box">
|
||||
<h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>项目列表</h2>
|
||||
<%= render :partial => 'users/my_projects'%>
|
||||
<div class="" style="height:20px; background:#eaebec;"></div>
|
||||
<%= render :partial => 'users/my_joined_projects'%>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".syllabus_box").height() + diffHeight;
|
||||
$(".syllabus_box").css("minHeight", tmpHeight);
|
||||
}
|
||||
});
|
||||
function expand_projects(btnid,container,count){
|
||||
var target = $(container).children('.syllabus_courses_list');
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.html('点击收起');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
btn.html('共' + count + '个项目,点击全部展开');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
target.eq(3).show();
|
||||
target.eq(4).show();
|
||||
btn.parent().parent().show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1,241 @@
|
|||
# = Redmine configuration file
|
||||
#
|
||||
# Each environment has it's own configuration options. If you are only
|
||||
# running in production, only the production block needs to be configured.
|
||||
# Environment specific configuration options override the default ones.
|
||||
#
|
||||
# Note that this file needs to be a valid YAML file.
|
||||
# DO NOT USE TABS! Use 2 spaces instead of tabs for identation.
|
||||
#
|
||||
# == Outgoing email settings (email_delivery setting)
|
||||
#
|
||||
# === Common configurations
|
||||
#
|
||||
# ==== Sendmail command
|
||||
#
|
||||
# production:
|
||||
# email_delivery:
|
||||
# delivery_method: :sendmail
|
||||
#
|
||||
# ==== Simple SMTP server at localhost
|
||||
#
|
||||
# production:
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: smtp.163.com
|
||||
# port: 25
|
||||
#
|
||||
# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
|
||||
#
|
||||
# production:
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: smtp.gmail.com
|
||||
# port: 587
|
||||
# authentication: :login
|
||||
# domain: 'foo.com'
|
||||
# user_name: senluowanxiangt@gmail.com
|
||||
# password: 1913TXBja
|
||||
#
|
||||
# ==== SMTP server at example.com using PLAIN authentication
|
||||
#
|
||||
# production:
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: smtp.gmail.com
|
||||
# port: 587
|
||||
# authentication: :plain
|
||||
# domain: 'example.com'
|
||||
# user_name: senluowanxiangt@gmail.com
|
||||
# password: 1913TXBja
|
||||
#
|
||||
# ==== SMTP server at using TLS (GMail)
|
||||
#
|
||||
# This might require some additional configuration. See the guides at:
|
||||
# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
|
||||
#
|
||||
# production:
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# enable_starttls_auto: true
|
||||
# address: smtp.gmail.com
|
||||
# port: 587
|
||||
# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
|
||||
# authentication: :plain
|
||||
# user_name: senluowanxiangt@gmail.com
|
||||
# password: 1913TXBja
|
||||
#
|
||||
#
|
||||
# === More configuration options
|
||||
#
|
||||
# See the "Configuration options" at the following website for a list of the
|
||||
# full options allowed:
|
||||
#
|
||||
# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
|
||||
|
||||
|
||||
|
||||
default:
|
||||
email_delivery:
|
||||
delivery_method: :smtp
|
||||
smtp_settings:
|
||||
address: mail.trustie.net
|
||||
port: 25
|
||||
domain: mail.trustie.net
|
||||
authentication: :login
|
||||
user_name: "mail@trustie.net"
|
||||
password: "loong2010"
|
||||
|
||||
# Absolute path to the directory where attachments are stored.
|
||||
# The default is the 'files' directory in your Redmine instance.
|
||||
# Your Redmine instance needs to have write permission on this
|
||||
# directory.
|
||||
# Examples:
|
||||
# attachments_storage_path: /var/redmine/files
|
||||
# attachments_storage_path: D:/redmine/files
|
||||
attachments_storage_path:
|
||||
|
||||
# Configuration of the autologin cookie.
|
||||
# autologin_cookie_name: the name of the cookie (default: autologin)
|
||||
# autologin_cookie_path: the cookie path (default: /)
|
||||
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
|
||||
autologin_cookie_name: "autologin_trustie"
|
||||
autologin_cookie_path:
|
||||
autologin_cookie_secure:
|
||||
|
||||
# Configuration of SCM executable command.
|
||||
#
|
||||
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
|
||||
# On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
|
||||
#
|
||||
# On Windows + JRuby 1.6.2, path which contains spaces does not work.
|
||||
# For example, "C:\Program Files\TortoiseHg\hg.exe".
|
||||
# If you want to this feature, you need to install to the path which does not contains spaces.
|
||||
# For example, "C:\TortoiseHg\hg.exe".
|
||||
#
|
||||
# Examples:
|
||||
# scm_subversion_command: svn # (default: svn)
|
||||
# scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg)
|
||||
# scm_git_command: /usr/local/bin/git # (default: git)
|
||||
# scm_cvs_command: cvs # (default: cvs)
|
||||
# scm_bazaar_command: bzr.exe # (default: bzr)
|
||||
# scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs)
|
||||
#
|
||||
scm_subversion_command:
|
||||
scm_mercurial_command:
|
||||
scm_git_command:
|
||||
scm_cvs_command:
|
||||
scm_bazaar_command:
|
||||
scm_darcs_command:
|
||||
|
||||
# Absolute path to the SCM commands errors (stderr) log file.
|
||||
# The default is to log in the 'log' directory of your Redmine instance.
|
||||
# Example:
|
||||
# scm_stderr_log_file: /var/log/redmine_scm_stderr.log
|
||||
scm_stderr_log_file:
|
||||
|
||||
# Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
|
||||
# If you don't want to enable data encryption, just leave it blank.
|
||||
# WARNING: losing/changing this key will make encrypted data unreadable.
|
||||
#
|
||||
# If you want to encrypt existing passwords in your database:
|
||||
# * set the cipher key here in your configuration file
|
||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
||||
#
|
||||
# If you have encrypted data and want to change this key, you have to:
|
||||
# * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
|
||||
# * change the cipher key here in your configuration file
|
||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
||||
database_cipher_key:
|
||||
|
||||
# Set this to false to disable plugins' assets mirroring on startup.
|
||||
# You can use `rake redmine:plugins:assets` to manually mirror assets
|
||||
# to public/plugin_assets when you install/upgrade a Redmine plugin.
|
||||
#
|
||||
#mirror_plugins_assets_on_startup: false
|
||||
|
||||
# Your secret key for verifying cookie session data integrity. If you
|
||||
# change this key, all old sessions will become invalid! Make sure the
|
||||
# secret is at least 30 characters and all random, no regular words or
|
||||
# you'll be exposed to dictionary attacks.
|
||||
#
|
||||
# If you have a load-balancing Redmine cluster, you have to use the
|
||||
# same secret token on each machine.
|
||||
#secret_token: 'change it to a long random string'
|
||||
|
||||
# Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
|
||||
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
|
||||
imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert'
|
||||
|
||||
# Configuration of RMagcik font.
|
||||
#
|
||||
# Redmine uses RMagcik in order to export gantt png.
|
||||
# You don't need this setting if you don't install RMagcik.
|
||||
#
|
||||
# In CJK (Chinese, Japanese and Korean),
|
||||
# in order to show CJK characters correctly,
|
||||
# you need to set this configuration.
|
||||
#
|
||||
# Because there is no standard font across platforms in CJK,
|
||||
# you need to set a font installed in your server.
|
||||
#
|
||||
# This setting is not necessary in non CJK.
|
||||
#
|
||||
# Examples for Japanese:
|
||||
# Windows:
|
||||
# rmagick_font_path: C:\windows\fonts\msgothic.ttc
|
||||
# Linux:
|
||||
# rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
||||
#
|
||||
rmagick_font_path:
|
||||
|
||||
# Maximum number of simultaneous AJAX uploads
|
||||
#max_concurrent_ajax_uploads: 2
|
||||
#pic_types: "bmp,jpeg,jpg,png,gif"
|
||||
|
||||
repository_root_path: '/tmp/htdocs'
|
||||
judge_server: 'http://judge.trustie.net/'
|
||||
|
||||
# Gitlab url
|
||||
gitlab_address: 'https://git.trustie.net'
|
||||
# Sonar url
|
||||
sonar_address: 'http://sonar.trustie.net'
|
||||
#Jenkins url
|
||||
jenkins_address: 'http://jenins.trustie.net'
|
||||
jenkins_username: 'temp'
|
||||
jenkins_password: '123123'
|
||||
|
||||
# specific configuration options for production environment
|
||||
# that overrides the default ones
|
||||
production:
|
||||
# CJK support
|
||||
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
||||
judge_server: 'http://192.168.80.21:8080/'
|
||||
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
|
||||
cookie_domain: ".trustie.net"
|
||||
email_delivery:
|
||||
delivery_method: :smtp
|
||||
smtp_settings:
|
||||
address: mail.trustie.net
|
||||
port: 25
|
||||
domain: mail.trustie.net
|
||||
authentication: :login
|
||||
user_name: "mail@trustie.net"
|
||||
password: "loong2010"
|
||||
|
||||
# specific configuration options for development environment
|
||||
# that overrides the default ones
|
||||
development:
|
||||
email_delivery:
|
||||
delivery_method: :smtp
|
||||
smtp_settings:
|
||||
address: mail.trustie.net
|
||||
port: 25
|
||||
domain: mail.trustie.net
|
||||
authentication: :login
|
||||
user_name: "mail@trustie.net"
|
||||
password: "loong2010"
|
|
@ -457,3 +457,8 @@ zh:
|
|||
# 版本库迁移
|
||||
label_repository_migrate_dec: 注意:Trustie版本库近期进行了一次大的改造,历史版本需要转换成新的版本,输入新的版本库名,即可完成转换。 转换过程可能需要等待一段时间。
|
||||
label_repository_name_dec: 版本库名仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用,长度必须在 1 到 254 个字符之间,一旦保存,标识无法修改。
|
||||
|
||||
# pull requests
|
||||
label_state_open: 待处理
|
||||
label_state_closed: 关闭
|
||||
label_state_merged: 已合并
|
||||
|
|
|
@ -626,6 +626,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist"
|
||||
|
||||
match 'sort_syllabus_list', :to => 'users#sort_syllabus_list', :via => :get, :as => "sort_syllabus_list"
|
||||
match 'sort_project_list', :to => 'users#sort_project_list', :via => :get, :as => "sort_project_list"
|
||||
|
||||
get 'edit_brief_introduction'
|
||||
get "user_resource"
|
||||
|
@ -816,6 +817,9 @@ RedmineApp::Application.routes.draw do
|
|||
get 'accept_pull_request'
|
||||
get 'pull_request_commits'
|
||||
get 'pull_request_changes'
|
||||
get 'update_pull_request'
|
||||
get 'pull_request_comments'
|
||||
post 'create_pull_request_comment'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
class AddCommitTimeToStudentWork < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :student_works, :commit_time, :datetime
|
||||
|
||||
count = StudentWork.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
StudentWork.page(i).per(30).each do |work|
|
||||
if work.work_status != 0
|
||||
work.update_column("commit_time", work.created_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
class CreatePullRequests < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :pull_requests do |t|
|
||||
t.integer :pull_request_id
|
||||
t.integer :gpid
|
||||
t.integer :user_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
441
db/schema.rb
441
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160811084401) do
|
||||
ActiveRecord::Schema.define(:version => 20160810081337) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
|
||||
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
|
||||
|
||||
create_table "application_settings", :force => true do |t|
|
||||
t.integer "default_projects_limit"
|
||||
t.boolean "signup_enabled"
|
||||
t.boolean "signin_enabled"
|
||||
t.boolean "gravatar_enabled"
|
||||
t.text "sign_in_text"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "home_page_url"
|
||||
t.integer "default_branch_protection", :default => 2
|
||||
t.boolean "twitter_sharing_enabled", :default => true
|
||||
t.text "restricted_visibility_levels"
|
||||
t.boolean "version_check_enabled", :default => true
|
||||
t.integer "max_attachment_size", :default => 10, :null => false
|
||||
t.integer "default_project_visibility"
|
||||
t.integer "default_snippet_visibility"
|
||||
t.text "restricted_signup_domains"
|
||||
t.boolean "user_oauth_applications", :default => true
|
||||
t.string "after_sign_out_path"
|
||||
t.integer "session_expire_delay", :default => 10080, :null => false
|
||||
end
|
||||
|
||||
create_table "applied_messages", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "applied_id"
|
||||
|
@ -60,16 +82,17 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "status", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "name"
|
||||
t.integer "applied_user_id"
|
||||
t.integer "role"
|
||||
t.integer "project_id"
|
||||
t.string "name"
|
||||
end
|
||||
|
||||
create_table "applied_projects", :force => true do |t|
|
||||
t.integer "project_id", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "role", :default => 0
|
||||
t.integer "project_id", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "role", :default => 0
|
||||
t.integer "applied_user_id"
|
||||
end
|
||||
|
||||
create_table "apply_add_schools", :force => true do |t|
|
||||
|
@ -184,6 +207,20 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.string "typeName", :limit => 50
|
||||
end
|
||||
|
||||
create_table "audit_events", :force => true do |t|
|
||||
t.integer "author_id", :null => false
|
||||
t.string "type", :null => false
|
||||
t.integer "entity_id", :null => false
|
||||
t.string "entity_type", :null => false
|
||||
t.text "details"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id"
|
||||
add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type"
|
||||
add_index "audit_events", ["type"], :name => "index_audit_events_on_type"
|
||||
|
||||
create_table "auth_sources", :force => true do |t|
|
||||
t.string "type", :limit => 30, :default => "", :null => false
|
||||
t.string "name", :limit => 60, :default => "", :null => false
|
||||
|
@ -281,6 +318,17 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
|
||||
add_index "boards", ["project_id"], :name => "boards_project_id"
|
||||
|
||||
create_table "broadcast_messages", :force => true do |t|
|
||||
t.text "message", :null => false
|
||||
t.datetime "starts_at"
|
||||
t.datetime "ends_at"
|
||||
t.integer "alert_type"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "color"
|
||||
t.string "font"
|
||||
end
|
||||
|
||||
create_table "bug_to_osps", :force => true do |t|
|
||||
t.integer "osp_id"
|
||||
t.integer "relative_memo_id"
|
||||
|
@ -310,14 +358,16 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
|
||||
|
||||
create_table "changesets", :force => true do |t|
|
||||
t.integer "repository_id", :null => false
|
||||
t.string "revision", :null => false
|
||||
t.integer "repository_id", :null => false
|
||||
t.string "revision", :null => false
|
||||
t.string "committer"
|
||||
t.datetime "committed_on", :null => false
|
||||
t.datetime "committed_on", :null => false
|
||||
t.text "comments"
|
||||
t.date "commit_date"
|
||||
t.string "scmid"
|
||||
t.integer "user_id"
|
||||
t.integer "project_id"
|
||||
t.integer "type", :default => 0
|
||||
end
|
||||
|
||||
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
|
||||
|
@ -592,13 +642,16 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "excellent_option", :default => 0
|
||||
t.integer "is_copy", :default => 0
|
||||
t.integer "visits", :default => 0
|
||||
t.integer "syllabus_id"
|
||||
t.string "invite_code"
|
||||
t.string "qrcode"
|
||||
t.integer "syllabus_id"
|
||||
end
|
||||
|
||||
add_index "courses", ["id"], :name => "id", :unique => true
|
||||
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
|
||||
add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
|
||||
add_index "courses", ["tea_id"], :name => "tea_id"
|
||||
add_index "courses", ["visits"], :name => "visits"
|
||||
|
||||
create_table "custom_fields", :force => true do |t|
|
||||
t.string "type", :limit => 30, :default => "", :null => false
|
||||
|
@ -661,6 +714,15 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "deploy_keys_projects", :force => true do |t|
|
||||
t.integer "deploy_key_id", :null => false
|
||||
t.integer "project_id", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
|
@ -710,6 +772,16 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "emails", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.string "email", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true
|
||||
add_index "emails", ["user_id"], :name => "index_emails_on_user_id"
|
||||
|
||||
create_table "enabled_modules", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "name", :null => false
|
||||
|
@ -732,6 +804,25 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
|
||||
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
|
||||
|
||||
create_table "events", :force => true do |t|
|
||||
t.string "target_type"
|
||||
t.integer "target_id"
|
||||
t.string "title"
|
||||
t.text "data"
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "action"
|
||||
t.integer "author_id"
|
||||
end
|
||||
|
||||
add_index "events", ["action"], :name => "index_events_on_action"
|
||||
add_index "events", ["author_id"], :name => "index_events_on_author_id"
|
||||
add_index "events", ["created_at"], :name => "index_events_on_created_at"
|
||||
add_index "events", ["project_id"], :name => "index_events_on_project_id"
|
||||
add_index "events", ["target_id"], :name => "index_events_on_target_id"
|
||||
add_index "events", ["target_type"], :name => "index_events_on_target_type"
|
||||
|
||||
create_table "exercise_answers", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "exercise_question_id"
|
||||
|
@ -834,6 +925,15 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
|
||||
add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at"
|
||||
|
||||
create_table "forked_project_links", :force => true do |t|
|
||||
t.integer "forked_to_project_id", :null => false
|
||||
t.integer "forked_from_project_id", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true
|
||||
|
||||
create_table "forums", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.text "description"
|
||||
|
@ -963,6 +1063,17 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "identities", :force => true do |t|
|
||||
t.string "extern_uid"
|
||||
t.string "provider"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id"
|
||||
add_index "identities", ["user_id"], :name => "index_identities_on_user_id"
|
||||
|
||||
create_table "invite_lists", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.integer "user_id"
|
||||
|
@ -1109,6 +1220,20 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "private", :default => 0
|
||||
end
|
||||
|
||||
create_table "keys", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.text "key"
|
||||
t.string "title"
|
||||
t.string "type"
|
||||
t.string "fingerprint"
|
||||
t.boolean "public", :default => false, :null => false
|
||||
end
|
||||
|
||||
add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id"
|
||||
add_index "keys", ["user_id"], :name => "index_keys_on_user_id"
|
||||
|
||||
create_table "kindeditor_assets", :force => true do |t|
|
||||
t.string "asset"
|
||||
t.integer "file_size"
|
||||
|
@ -1120,6 +1245,27 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "owner_type", :default => 0
|
||||
end
|
||||
|
||||
create_table "label_links", :force => true do |t|
|
||||
t.integer "label_id"
|
||||
t.integer "target_id"
|
||||
t.string "target_type"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id"
|
||||
add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type"
|
||||
|
||||
create_table "labels", :force => true do |t|
|
||||
t.string "title"
|
||||
t.string "color"
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "labels", ["project_id"], :name => "index_labels_on_project_id"
|
||||
|
||||
create_table "member_roles", :force => true do |t|
|
||||
t.integer "member_id", :null => false
|
||||
t.integer "role_id", :null => false
|
||||
|
@ -1171,6 +1317,47 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "viewed_count", :default => 0
|
||||
end
|
||||
|
||||
create_table "merge_request_diffs", :force => true do |t|
|
||||
t.string "state"
|
||||
t.text "st_commits", :limit => 2147483647
|
||||
t.text "st_diffs", :limit => 2147483647
|
||||
t.integer "merge_request_id", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true
|
||||
|
||||
create_table "merge_requests", :force => true do |t|
|
||||
t.string "target_branch", :null => false
|
||||
t.string "source_branch", :null => false
|
||||
t.integer "source_project_id", :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "assignee_id"
|
||||
t.string "title"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "milestone_id"
|
||||
t.string "state"
|
||||
t.string "merge_status"
|
||||
t.integer "target_project_id", :null => false
|
||||
t.integer "iid"
|
||||
t.text "description"
|
||||
t.integer "position", :default => 0
|
||||
t.datetime "locked_at"
|
||||
end
|
||||
|
||||
add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id"
|
||||
add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id"
|
||||
add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id"
|
||||
add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at"
|
||||
add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id"
|
||||
add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch"
|
||||
add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id"
|
||||
add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch"
|
||||
add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true
|
||||
add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title"
|
||||
|
||||
create_table "message_alls", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "message_id"
|
||||
|
@ -1205,6 +1392,39 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
|
||||
add_index "messages", ["parent_id"], :name => "messages_parent_id"
|
||||
|
||||
create_table "milestones", :force => true do |t|
|
||||
t.string "title", :null => false
|
||||
t.integer "project_id", :null => false
|
||||
t.text "description"
|
||||
t.date "due_date"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "state"
|
||||
t.integer "iid"
|
||||
end
|
||||
|
||||
add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id"
|
||||
add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date"
|
||||
add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true
|
||||
add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id"
|
||||
|
||||
create_table "namespaces", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.string "path", :null => false
|
||||
t.integer "owner_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "type"
|
||||
t.string "description", :default => "", :null => false
|
||||
t.string "avatar"
|
||||
end
|
||||
|
||||
add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id"
|
||||
add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true
|
||||
add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id"
|
||||
add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true
|
||||
add_index "namespaces", ["type"], :name => "index_namespaces_on_type"
|
||||
|
||||
create_table "news", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "title", :limit => 60, :default => "", :null => false
|
||||
|
@ -1230,6 +1450,31 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "notes", :force => true do |t|
|
||||
t.text "note"
|
||||
t.string "noteable_type"
|
||||
t.integer "author_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "project_id"
|
||||
t.string "attachment"
|
||||
t.string "line_code"
|
||||
t.string "commit_id"
|
||||
t.integer "noteable_id"
|
||||
t.boolean "system", :default => false, :null => false
|
||||
t.text "st_diff", :limit => 2147483647
|
||||
end
|
||||
|
||||
add_index "notes", ["author_id"], :name => "index_notes_on_author_id"
|
||||
add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id"
|
||||
add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id"
|
||||
add_index "notes", ["created_at"], :name => "index_notes_on_created_at"
|
||||
add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type"
|
||||
add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
|
||||
add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type"
|
||||
add_index "notes", ["project_id"], :name => "index_notes_on_project_id"
|
||||
add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at"
|
||||
|
||||
create_table "notificationcomments", :force => true do |t|
|
||||
t.string "notificationcommented_type"
|
||||
t.integer "notificationcommented_id"
|
||||
|
@ -1239,6 +1484,49 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "oauth_access_grants", :force => true do |t|
|
||||
t.integer "resource_owner_id", :null => false
|
||||
t.integer "application_id", :null => false
|
||||
t.string "token", :null => false
|
||||
t.integer "expires_in", :null => false
|
||||
t.text "redirect_uri", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "revoked_at"
|
||||
t.string "scopes"
|
||||
end
|
||||
|
||||
add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
|
||||
|
||||
create_table "oauth_access_tokens", :force => true do |t|
|
||||
t.integer "resource_owner_id"
|
||||
t.integer "application_id"
|
||||
t.string "token", :null => false
|
||||
t.string "refresh_token"
|
||||
t.integer "expires_in"
|
||||
t.datetime "revoked_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.string "scopes"
|
||||
end
|
||||
|
||||
add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
|
||||
add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
|
||||
add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
|
||||
|
||||
create_table "oauth_applications", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.string "uid", :null => false
|
||||
t.string "secret", :null => false
|
||||
t.text "redirect_uri", :null => false
|
||||
t.string "scopes", :default => "", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "owner_id"
|
||||
t.string "owner_type"
|
||||
end
|
||||
|
||||
add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type"
|
||||
add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
|
||||
|
||||
create_table "onclick_times", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.datetime "onclick_time"
|
||||
|
@ -1396,6 +1684,23 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "allow_teacher", :default => 0
|
||||
end
|
||||
|
||||
create_table "permissions", :force => true do |t|
|
||||
t.string "controller", :limit => 30, :default => "", :null => false
|
||||
t.string "action", :limit => 30, :default => "", :null => false
|
||||
t.string "description", :limit => 60, :default => "", :null => false
|
||||
t.boolean "is_public", :default => false, :null => false
|
||||
t.integer "sort", :default => 0, :null => false
|
||||
t.boolean "mail_option", :default => false, :null => false
|
||||
t.boolean "mail_enabled", :default => false, :null => false
|
||||
end
|
||||
|
||||
create_table "permissions_roles", :id => false, :force => true do |t|
|
||||
t.integer "permission_id", :default => 0, :null => false
|
||||
t.integer "role_id", :default => 0, :null => false
|
||||
end
|
||||
|
||||
add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
|
||||
|
||||
create_table "phone_app_versions", :force => true do |t|
|
||||
t.string "version"
|
||||
t.text "description"
|
||||
|
@ -1478,6 +1783,11 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "project_import_data", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.text "data"
|
||||
end
|
||||
|
||||
create_table "project_infos", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.integer "user_id"
|
||||
|
@ -1570,6 +1880,24 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
|
||||
add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
|
||||
|
||||
create_table "protected_branches", :force => true do |t|
|
||||
t.integer "project_id", :null => false
|
||||
t.string "name", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "developers_can_push", :default => false, :null => false
|
||||
end
|
||||
|
||||
add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id"
|
||||
|
||||
create_table "pull_requests", :force => true do |t|
|
||||
t.integer "pull_request_id"
|
||||
t.integer "gpid"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "quality_analyses", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "author_login"
|
||||
|
@ -1718,6 +2046,25 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "is_teacher_score", :default => 0
|
||||
end
|
||||
|
||||
create_table "services", :force => true do |t|
|
||||
t.string "type"
|
||||
t.string "title"
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "active", :default => false, :null => false
|
||||
t.text "properties"
|
||||
t.boolean "template", :default => false
|
||||
t.boolean "push_events", :default => true
|
||||
t.boolean "issues_events", :default => true
|
||||
t.boolean "merge_requests_events", :default => true
|
||||
t.boolean "tag_push_events", :default => true
|
||||
t.boolean "note_events", :default => true, :null => false
|
||||
end
|
||||
|
||||
add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id"
|
||||
add_index "services", ["project_id"], :name => "index_services_on_project_id"
|
||||
|
||||
create_table "settings", :force => true do |t|
|
||||
t.string "name", :default => "", :null => false
|
||||
t.text "value"
|
||||
|
@ -1756,6 +2103,26 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "snippets", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "content", :limit => 2147483647
|
||||
t.integer "author_id", :null => false
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "file_name"
|
||||
t.datetime "expires_at"
|
||||
t.string "type"
|
||||
t.integer "visibility_level", :default => 0, :null => false
|
||||
end
|
||||
|
||||
add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id"
|
||||
add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id"
|
||||
add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at"
|
||||
add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at"
|
||||
add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id"
|
||||
add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level"
|
||||
|
||||
create_table "softapplications", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
|
@ -1836,9 +2203,9 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.integer "absence_penalty", :default => 0
|
||||
t.float "system_score", :default => 0.0
|
||||
t.boolean "is_test", :default => false
|
||||
t.float "work_score"
|
||||
t.integer "simi_id"
|
||||
t.integer "simi_value"
|
||||
t.float "work_score"
|
||||
t.integer "work_status", :default => 0
|
||||
end
|
||||
|
||||
|
@ -1887,13 +2254,13 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
|
||||
create_table "sub_domains", :force => true do |t|
|
||||
t.integer "org_subfield_id"
|
||||
t.integer "priority", :default => 0
|
||||
t.integer "priority"
|
||||
t.string "name"
|
||||
t.string "field_type"
|
||||
t.integer "hide", :default => 0
|
||||
t.integer "status", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "hide"
|
||||
t.integer "status"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "subfield_subdomain_dirs", :force => true do |t|
|
||||
|
@ -1903,6 +2270,17 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "subscriptions", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "subscribable_id"
|
||||
t.string "subscribable_type"
|
||||
t.boolean "subscribed"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true
|
||||
|
||||
create_table "syllabuses", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
|
@ -2132,9 +2510,8 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.string "remark"
|
||||
t.integer "groupid"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "bindtype", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
|
@ -2164,6 +2541,17 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
|
||||
add_index "users", ["type"], :name => "index_users_on_type"
|
||||
|
||||
create_table "users_star_projects", :force => true do |t|
|
||||
t.integer "project_id", :null => false
|
||||
t.integer "user_id", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id"
|
||||
add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true
|
||||
add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id"
|
||||
|
||||
create_table "versions", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.string "name", :default => "", :null => false
|
||||
|
@ -2215,6 +2603,23 @@ ActiveRecord::Schema.define(:version => 20160811084401) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "web_hooks", :force => true do |t|
|
||||
t.string "url"
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "type", :default => "ProjectHook"
|
||||
t.integer "service_id"
|
||||
t.boolean "push_events", :default => true, :null => false
|
||||
t.boolean "issues_events", :default => false, :null => false
|
||||
t.boolean "merge_requests_events", :default => false, :null => false
|
||||
t.boolean "tag_push_events", :default => false
|
||||
t.boolean "note_events", :default => false, :null => false
|
||||
end
|
||||
|
||||
add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id"
|
||||
add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"
|
||||
|
||||
create_table "wechat_logs", :force => true do |t|
|
||||
t.string "openid", :null => false
|
||||
t.text "request_raw"
|
||||
|
|
|
@ -64,8 +64,8 @@ class Gitlab::Client
|
|||
# @option options [Integer] :assignee_id The ID of a user to assign merge request.
|
||||
# @option options [String] :state_event New state (close|reopen|merge).
|
||||
# @return [Gitlab::ObjectifiedHash] Information about updated merge request.
|
||||
def update_merge_request(project, id, options={})
|
||||
put("/projects/#{project}/merge_request/#{id}", :body => options)
|
||||
def update_merge_request(project, id, gid, options={})
|
||||
put("/projects/#{project}/merge_request/#{id}?user_id=#{gid}", :body => options)
|
||||
end
|
||||
|
||||
# Adds a comment to a merge request.
|
||||
|
@ -78,8 +78,8 @@ class Gitlab::Client
|
|||
# @param [Integer] id The ID of a merge request.
|
||||
# @param [String] note The content of a comment.
|
||||
# @return [Gitlab::ObjectifiedHash] Information about created merge request comment.
|
||||
def create_merge_request_comment(project, id, note)
|
||||
post("/projects/#{project}/merge_request/#{id}/comments", :body => {:note => note})
|
||||
def create_merge_request_comment(project, id, note, gid)
|
||||
post("/projects/#{project}/merge_request/#{id}/comments?user_id=#{gid}", :body => {:note => note})
|
||||
end
|
||||
|
||||
# Get a list of merge request commits.
|
||||
|
|
|
@ -1552,7 +1552,10 @@ function pop_box_new(value, Width, Height){
|
|||
document.onmousemove = null;
|
||||
}
|
||||
|
||||
new Drag("popupWrap");
|
||||
$(".sy_popup_con").mousedown(function(event){
|
||||
event.stopPropagation();
|
||||
new Drag("popupWrap");
|
||||
});
|
||||
}
|
||||
|
||||
// 公共提示弹框样式
|
||||
|
|
|
@ -142,7 +142,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|||
|
||||
data.disabled = false;
|
||||
if(typeof cb === 'function'){
|
||||
cb();
|
||||
cb(response.data.subscribe);
|
||||
}
|
||||
|
||||
//保证内外回复数一致
|
||||
|
@ -301,9 +301,16 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
|||
loadData(args.id,0,0);
|
||||
args.scope.addReply = function(data){
|
||||
console.log(data.comment);
|
||||
addCommonReply(args.id, args.replyType, data,args, function(){
|
||||
addCommonReply(args.id, args.replyType, data,args, function(subscribe){
|
||||
args.scope.formData = {comment: ''};
|
||||
loadData(args.id,0,0);
|
||||
if(subscribe == 0){
|
||||
$location.path("/login_tip");
|
||||
return;
|
||||
}
|
||||
else{
|
||||
loadData(args.id,0,0);
|
||||
}
|
||||
|
||||
if(typeof args.replyCallback === 'function'){
|
||||
args.replyCallback();
|
||||
}
|
||||
|
|
|
@ -160,9 +160,9 @@ div.thumbnails div {background:#fff;display:inline-block;margin-right:2px;}
|
|||
.repos_files ul:hover{ background:#ffffdd;}
|
||||
.repos_t_c li{ text-align:center;}
|
||||
.pic_stats{display:block; background:url(/images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
|
||||
.tree-age{width:10%; text-align:right;}
|
||||
.tree-age{width:15%; text-align:right;}
|
||||
.tree-author{width:10%; text-align:left;}
|
||||
.tree-comments{width:40%; text-align:left;}
|
||||
.tree-comments{width:35%; text-align:left;}
|
||||
|
||||
/* 里程碑 */
|
||||
.roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
|
||||
|
@ -511,8 +511,9 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
|
|||
.analysis-result-name {width:200px;}
|
||||
.analysis-result-version {width:90px; text-align:right;}
|
||||
.analysis-result-loc {width:60px; text-align:right;}
|
||||
.analysis-result-debt {width:160px; text-align:right;}
|
||||
.analysis-result-debt {width:80px; text-align:right;}
|
||||
.analysis-result-time {width:150px; text-align:right;}
|
||||
.analysis-result-edit {width:80px; text-align:right;}
|
||||
.analysis-name-icon {background:url(/images/code-analysis-icon.png) -2px -148px no-repeat; width:16px; height:16px; display:inline-block; vertical-align:middle;}
|
||||
|
||||
|
||||
|
@ -523,7 +524,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
|
|||
.project-merge-banner li a {padding:14px; font-size:14px; color:#555; display:inline-block;}
|
||||
.project-number-dot {display:inline-block; min-width:10px; padding:3px 5px; font-size:12px; color:#888; line-height:1; vertical-align:middle; white-space:nowrap; text-align:center; background-color:#eee; border-radius:10px; margin-left:5px;}
|
||||
.project-merge-content {}
|
||||
.project-merge-content li {padding:10px; margin:0 -10px; background-color:#f9f9f9; border-bottom:1px solid #e5e5e5;}
|
||||
.project-merge-content>li {padding:10px; margin:0 -10px; background-color:#f9f9f9; border-bottom:1px solid #e5e5e5;}
|
||||
.no-merge-content {padding:10px 15px; color:#888;}
|
||||
.new-merge-request {border-bottom:1px solid #ddd; padding-bottom:10px;}
|
||||
.new-merge-wrap {font-size:13px; color:#484848; border-bottom:1px solid #ddd; padding:10px 0;}
|
||||
|
@ -541,3 +542,41 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
|
|||
.merge-show {margin:-10px -10px 0 -10px; padding:10px; line-height:36px; border-bottom:1px solid #ddd;}
|
||||
.open-status {color:#fff; padding:0 16px; background-color:#3b94d6; border-radius:2px; display:inline-block;}
|
||||
.merge-commit-option {padding:12px; border:1px solid #ddd; background-color:#f9f9f9; border-radius:2px;}
|
||||
.merge-discussion-content {font-size:13px; color: #484848; margin:0 -10px; padding:10px; border-bottom:1px solid #ddd;}
|
||||
.merge-discussion-detail {font-size:13px; line-height:1.5em; color:#484848; margin-top:10px;}
|
||||
.merge-discussion-automatic {background-color:#fdfdfd;}
|
||||
.merge-discussion-input {margin:0 -10px; padding:10px; background-color:#f8f8f8;}
|
||||
.merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;}
|
||||
|
||||
/*新版项目列表新增*/
|
||||
.new_project_title{ font-size:16px; color:#333; max-width:560px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); }
|
||||
.new_projectlist_more{ text-align:center;}
|
||||
.new_projectlist_more a:hover{ color:#3b94d6;}
|
||||
/*新版项目引用的新版课程大纲中的公共样式*/
|
||||
.icons_tishi{
|
||||
width: 110px;
|
||||
height: 110px;
|
||||
margin: 135px auto 20px;
|
||||
}
|
||||
.sy_tab_con_p{
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-bottom:100px;
|
||||
color:#888;
|
||||
}
|
||||
a.sy_btn_green{
|
||||
display:inline-block;
|
||||
color: #fff;
|
||||
background: #60b25e;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding:0 15px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
-webkit-border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
-o-border-radius:3px;
|
||||
border-radius:3px;
|
||||
}
|
||||
a:hover.sy_btn_green{ background: #51a74f;}
|
|
@ -474,6 +474,7 @@ a.f_grey:hover {color:#000000;}
|
|||
.shadowbox_news_list{ max-height:400px; overflow:hidden;}
|
||||
.shadowbox_news_list a{ color:#999;}
|
||||
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
|
||||
.shadowbox_news_list li:last-child {border-bottom:none;}
|
||||
.shadowbox_news_list li:hover{ background-color:#eee;}
|
||||
span.shadowbox_news_user{ color:#3b94d6;}
|
||||
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
FactoryGirl.define do
|
||||
factory :pull_request do
|
||||
pull_request_id 1
|
||||
gpid 1
|
||||
user_id 1
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PullRequest, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue