Merge branch 'daiao_dev' into cxt_course
Conflicts: app/views/admin/courses.html.erb public/stylesheets/new_user.css
This commit is contained in:
commit
37dd447fcb
7
Gemfile
7
Gemfile
|
@ -3,13 +3,16 @@ source 'https://ruby.taobao.org/'
|
||||||
unless RUBY_PLATFORM =~ /w32/
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
# unix-like only
|
# unix-like only
|
||||||
gem 'iconv'
|
gem 'iconv'
|
||||||
|
if RUBY_PLATFORM =~ /darwin/
|
||||||
|
gem "rmagick", "= 2.15.4" ## osx must be this version
|
||||||
|
else
|
||||||
gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel
|
gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel
|
||||||
gem 'certified'
|
|
||||||
end
|
end
|
||||||
|
gem 'certified'
|
||||||
gem 'net-ssh', '2.9.1'
|
gem 'net-ssh', '2.9.1'
|
||||||
gem 'jenkins_api_client'
|
gem 'jenkins_api_client'
|
||||||
gem 'nokogiri'
|
gem 'nokogiri'
|
||||||
|
end
|
||||||
|
|
||||||
gem 'wechat',path: 'lib/wechat'
|
gem 'wechat',path: 'lib/wechat'
|
||||||
gem 'grack', path:'lib/grack'
|
gem 'grack', path:'lib/grack'
|
||||||
|
|
|
@ -239,14 +239,23 @@ class AccountController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
def resendmail
|
def resendmail
|
||||||
|
result = {:status=>1, :email=>""}
|
||||||
user = User.find(params[:user]) if params[:user]
|
user = User.find(params[:user]) if params[:user]
|
||||||
|
result[:email] = user.mail
|
||||||
token = Token.new(:user => user, :action => "register")
|
token = Token.new(:user => user, :action => "register")
|
||||||
if token.save
|
if token.save
|
||||||
Mailer.run.register(token)
|
# Mailer.run.register(token)
|
||||||
|
Mailer.register(token).deliver
|
||||||
else
|
else
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
|
result[:status] = 0
|
||||||
end
|
end
|
||||||
|
render :json => result
|
||||||
|
end
|
||||||
|
|
||||||
|
def email_activation
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -264,6 +273,7 @@ class AccountController < ApplicationController
|
||||||
if user.nil?
|
if user.nil?
|
||||||
invalid_credentials
|
invalid_credentials
|
||||||
elsif user.status == 2
|
elsif user.status == 2
|
||||||
|
@user = user
|
||||||
invalid_credentials_new
|
invalid_credentials_new
|
||||||
elsif user.new_record?
|
elsif user.new_record?
|
||||||
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
|
onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id })
|
||||||
|
@ -375,8 +385,9 @@ class AccountController < ApplicationController
|
||||||
|
|
||||||
def invalid_credentials_new
|
def invalid_credentials_new
|
||||||
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}"
|
logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}"
|
||||||
flash[:error] = l(:notice_account_invalid_creditentials_new)
|
# flash[:error] = l(:notice_account_invalid_creditentials_new)
|
||||||
render signin_path(:login=>true)
|
# render signin_path(:login=>true)
|
||||||
|
render :action => 'email_activation'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Register a user for email activation.
|
# Register a user for email activation.
|
||||||
|
|
|
@ -612,7 +612,7 @@ class AttachmentsController < ApplicationController
|
||||||
@attachment.container.board.course)
|
@attachment.container.board.course)
|
||||||
@course = @attachment.container.board.course
|
@course = @attachment.container.board.course
|
||||||
else
|
else
|
||||||
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
unless @attachment.container_type == 'Syllabus' || @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork'
|
||||||
@project = @attachment.project
|
@project = @attachment.project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -125,7 +125,9 @@ class BoardsController < ApplicationController
|
||||||
if @order.to_i == 2
|
if @order.to_i == 2
|
||||||
@type = 2
|
@type = 2
|
||||||
@topics.each do |topic|
|
@topics.each do |topic|
|
||||||
topic[:infocount] = get_praise_num(topic) + (topic.parent ? topic.parent.children.count : topic.children.count)
|
all_comments = []
|
||||||
|
count=get_all_children(all_comments, topic).count
|
||||||
|
topic[:infocount] = get_praise_num(topic) + count
|
||||||
if topic[:infocount] < 0
|
if topic[:infocount] < 0
|
||||||
topic[:infocount] = 0
|
topic[:infocount] = 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,7 +44,8 @@ class MessagesController < ApplicationController
|
||||||
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
|
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
|
||||||
page = 1 + offset / REPLIES_PER_PAGE
|
page = 1 + offset / REPLIES_PER_PAGE
|
||||||
end
|
end
|
||||||
@reply_count = @topic.children.count
|
all_comments = []
|
||||||
|
@reply_count = get_all_children(all_comments, @topic).count
|
||||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||||
if @course
|
if @course
|
||||||
messages_replies = @topic.children.
|
messages_replies = @topic.children.
|
||||||
|
@ -137,17 +138,21 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
# Reply to a topic
|
# Reply to a topic
|
||||||
def reply
|
def reply
|
||||||
if params[:reply][:content] == ""
|
if params[:parent_id]
|
||||||
if params[:is_board]
|
parent = Message.find params[:parent_id]
|
||||||
if @project
|
@reply = Message.new
|
||||||
(redirect_to project_boards_path(@project), :notice => l(:label_reply_empty);return)
|
@reply.author = User.current
|
||||||
elsif @course
|
@reply.board = parent.board
|
||||||
(redirect_to course_boards_path(@course), :notice => l(:label_reply_empty);return)
|
@reply.content = params[:content]
|
||||||
end
|
@reply.subject = "RE: #{parent.subject}"
|
||||||
|
@reply.reply_id = params[:reply_id]
|
||||||
|
# @reply.reply_id = params[:id]
|
||||||
|
parent.children << @reply
|
||||||
|
@topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
|
||||||
|
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||||
|
@is_course = params[:is_course] if params[:is_course]
|
||||||
|
@is_board = params[:is_board] if params[:is_board]
|
||||||
else
|
else
|
||||||
(redirect_to board_message_url(@board, @topic, :r => @reply), :notice => l(:label_reply_empty);return)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@quote = params[:quote][:quote]
|
@quote = params[:quote][:quote]
|
||||||
@reply = Message.new
|
@reply = Message.new
|
||||||
@reply.author = User.current
|
@reply.author = User.current
|
||||||
|
@ -155,8 +160,10 @@ class MessagesController < ApplicationController
|
||||||
@reply.safe_attributes = params[:reply]
|
@reply.safe_attributes = params[:reply]
|
||||||
@reply.content = @quote + @reply.content
|
@reply.content = @quote + @reply.content
|
||||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||||
# @reply.reply_id = params[:id]
|
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
|
# @reply.reply_id = params[:id]
|
||||||
|
end
|
||||||
|
|
||||||
update_course_activity(@topic.class,@topic.id)
|
update_course_activity(@topic.class,@topic.id)
|
||||||
update_user_activity(@topic.class,@topic.id)
|
update_user_activity(@topic.class,@topic.id)
|
||||||
update_forge_activity(@topic.class,@topic.id)
|
update_forge_activity(@topic.class,@topic.id)
|
||||||
|
@ -182,14 +189,10 @@ class MessagesController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
elsif params[:is_board]
|
return
|
||||||
if @project
|
|
||||||
redirect_to project_boards_path(@project)
|
|
||||||
elsif @course
|
|
||||||
redirect_to course_boards_path(@course)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
redirect_to board_message_url(@board, @topic, :r => @reply)
|
redirect_to board_message_url(@board, @topic)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -251,6 +254,17 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
# Delete a messages
|
# Delete a messages
|
||||||
def destroy
|
def destroy
|
||||||
|
if params[:user_activity_id]
|
||||||
|
@message.destroy
|
||||||
|
@topic = Message.find(params[:activity_id].to_i)
|
||||||
|
@user_activity_id = params[:user_activity_id]
|
||||||
|
@is_course = params[:is_course]
|
||||||
|
@is_board = params[:is_board]
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
if @project
|
if @project
|
||||||
(render_403; return false) unless @message.destroyable_by?(User.current)
|
(render_403; return false) unless @message.destroyable_by?(User.current)
|
||||||
elsif @course
|
elsif @course
|
||||||
|
@ -299,12 +313,12 @@ class MessagesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def quote
|
def quote
|
||||||
@subject = @message.subject
|
# @subject = @message.subject
|
||||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
# @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||||
|
#
|
||||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
# @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
||||||
@temp = Message.new
|
# @temp = Message.new
|
||||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author.show_name)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
|
# @temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author.show_name)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
|
|
|
@ -127,12 +127,14 @@ class MyController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
@user.safe_attributes = params[:user]
|
@user.safe_attributes = params[:user]
|
||||||
|
@user.lastname = params[:lastname]
|
||||||
|
@user.firstname = ""
|
||||||
@user.pref.attributes = params[:pref]
|
@user.pref.attributes = params[:pref]
|
||||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||||
#@user.login = params[:login]
|
#@user.login = params[:login]
|
||||||
unless @user.user_extensions.nil?
|
unless @user.user_extensions.nil?
|
||||||
if @user.user_extensions.identity == 2
|
if @user.user_extensions.identity == 2
|
||||||
@user.firstname = params[:enterprise_name]
|
# @user.firstname = params[:enterprise_name]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -144,7 +146,7 @@ class MyController < ApplicationController
|
||||||
# end
|
# end
|
||||||
@se.school_id = params[:occupation]
|
@se.school_id = params[:occupation]
|
||||||
|
|
||||||
@se.gender = params[:gender]
|
@se.gender = params[:sex]
|
||||||
@se.location = params[:province] if params[:province]
|
@se.location = params[:province] if params[:province]
|
||||||
@se.location_city = params[:city] if params[:city]
|
@se.location_city = params[:city] if params[:city]
|
||||||
@se.identity = params[:identity].to_i if params[:identity]
|
@se.identity = params[:identity].to_i if params[:identity]
|
||||||
|
|
|
@ -653,12 +653,12 @@ class ProjectsController < ApplicationController
|
||||||
def update
|
def update
|
||||||
@project.safe_attributes = params[:project]
|
@project.safe_attributes = params[:project]
|
||||||
@project.organization_id = params[:organization_id]
|
@project.organization_id = params[:organization_id]
|
||||||
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
|
params[:project][:is_public] == "on" ? @project.is_public = 1 : @project.is_public = 0
|
||||||
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
|
params[:project][:hidden_repo] == "on" ? @project.hidden_repo = 1 : @project.hidden_repo = 0
|
||||||
# 更新公开私有时同步gitlab公开私有
|
# 更新公开私有时同步gitlab公开私有
|
||||||
if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? true : false)
|
if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? 1 : 0)
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
params[:project][:is_public] ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch])
|
params[:project][:is_public] == "on" ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch])
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
class QualityAnalysisController < ApplicationController
|
class QualityAnalysisController < ApplicationController
|
||||||
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
||||||
|
before_filter :find_quality_analysis, :only => [:edit, :update_jenkins_job]
|
||||||
before_filter :authorize
|
before_filter :authorize
|
||||||
|
before_filter :connect_jenkins, :only => [:create, :edit, :update_jenkins_job, :index]
|
||||||
layout "base_projects"
|
layout "base_projects"
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
include QualityAnalysisHelper
|
||||||
require 'jenkins_api_client'
|
require 'jenkins_api_client'
|
||||||
require 'nokogiri'
|
require 'nokogiri'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
@ -12,72 +15,180 @@ class QualityAnalysisController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# params 说明:{identifier:版本库名}
|
||||||
def create
|
def create
|
||||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
begin
|
||||||
jenkins_address = Redmine::Configuration['jenkins_address']
|
|
||||||
@client = JenkinsApi::Client.new(:server_url => jenkins_address,
|
|
||||||
:username => "temp",
|
|
||||||
:password => '123123')
|
|
||||||
#@client.exists?(job_name)
|
|
||||||
@g = Gitlab.client
|
|
||||||
user_name = User.find(params[:user_id]).try(:login)
|
user_name = User.find(params[:user_id]).try(:login)
|
||||||
branch = params[:branch].nil? ? "master" : params[:branch]
|
|
||||||
language = params[:language]
|
|
||||||
path = params[:path]
|
|
||||||
identifier = params[:identifier]
|
identifier = params[:identifier]
|
||||||
|
rep_id = params[:rep_id]
|
||||||
|
|
||||||
|
# job_name and sonar_name 前者为job名字,后者为jenkins配置名
|
||||||
|
job_name = "#{user_name}-#{rep_id}"
|
||||||
|
sonar_name = "#{user_name}:#{rep_id}"
|
||||||
|
|
||||||
|
# Checks if the given job exists in Jenkins.
|
||||||
|
unless @client.job.exists?(job_name)
|
||||||
|
@g = Gitlab.client
|
||||||
|
branch = params[:branch]
|
||||||
|
language = swith_language_type(params[:language])
|
||||||
|
path = params[:path].blank? ? "./" : params[:path]
|
||||||
qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
|
qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
|
||||||
version = qa.nil? ? 1 : qa.sonar_version + 1
|
version = qa.nil? ? 1 : qa.sonar_version + 1
|
||||||
properties = "sonar.projectKey=#{user_name}:#{identifier}
|
properties = "sonar.projectKey=#{sonar_name}
|
||||||
sonar.projectName=#{user_name}:#{identifier}
|
sonar.projectName=#{sonar_name}
|
||||||
sonar.projectVersion=#{version}
|
sonar.projectVersion=#{version}
|
||||||
sonar.sources=#{path}
|
sonar.sources=#{path}
|
||||||
sonar.language=#{language.downcase}
|
sonar.language=#{language.downcase}
|
||||||
sonar.sourceEncoding=utf-8"
|
sonar.sourceEncoding=utf-8"
|
||||||
git_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git"
|
git_url = @gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git"
|
||||||
|
|
||||||
# # # modify config
|
# 替换配置文件
|
||||||
@doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml')))
|
@doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml')))
|
||||||
@doc.at_xpath("//hudson.plugins.git.UserRemoteConfig/url").content = git_url
|
@doc.at_xpath("//hudson.plugins.git.UserRemoteConfig/url").content = git_url
|
||||||
@doc.at_xpath("//hudson.plugins.git.BranchSpec/name").content = "*/#{branch}"
|
@doc.at_xpath("//hudson.plugins.git.BranchSpec/name").content = "*/#{branch}"
|
||||||
@doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties
|
@doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties
|
||||||
#
|
|
||||||
# replace config.xml of jenkins
|
|
||||||
@client = @client.job.create("#{user_name}_#{identifier}", @doc.to_xml)
|
|
||||||
# relace gitlab hook
|
|
||||||
# genkins address
|
|
||||||
@g.add_project_hook(@project.gpid, jenkins_address + "/project/#{user_name}_#{identifier}")
|
|
||||||
if qa.nil?
|
|
||||||
QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language)
|
|
||||||
|
|
||||||
|
# jenkins job创建
|
||||||
|
jenkins_job = @client.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}")
|
||||||
|
logger.error("build result ==> #{code}")
|
||||||
|
|
||||||
|
# 判断调用sonar分析是否成功
|
||||||
|
# 等待启动时间处理, 最长时间为30分钟
|
||||||
|
for i in 0..60 do
|
||||||
|
sleep(60)
|
||||||
|
@current_build_status = @client.job.get_current_build_status("#{job_name}")
|
||||||
|
if (@current_build_status != "not_run" || @current_build_status != "running")
|
||||||
|
break
|
||||||
|
if i == 60
|
||||||
|
@build_console_result = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')
|
||||||
|
logger.info("@current_build_status is ==> #{@current_build_status}")
|
||||||
|
logger.info("@console_build is ==> #{@console_build}")
|
||||||
|
|
||||||
|
d = @client.job.delete("#{job_name}") if jenkins_job == '200' && code != '201'
|
||||||
|
logger.error("delete result ==> #{code}")
|
||||||
|
if qa.blank? && @current_build_status == "success"
|
||||||
|
QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier,
|
||||||
|
:sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}")
|
||||||
else
|
else
|
||||||
qa.update_attribute(:sonar_version, version)
|
qa.update_attribute(:sonar_version, version)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue => e
|
||||||
|
puts e
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
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)}
|
||||||
|
# format.js{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch)}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# get language type
|
||||||
|
def swith_language_type language
|
||||||
|
if language == "c#"
|
||||||
|
"cs"
|
||||||
|
elsif language == "python"
|
||||||
|
"py"
|
||||||
|
elsif language == "c"
|
||||||
|
"c++"
|
||||||
|
else
|
||||||
|
language
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@g = Gitlab.client
|
||||||
|
gitlab_branches = @g.branches(@project.gpid)
|
||||||
|
@branch_names = gitlab_branches.map{|b| b.name}
|
||||||
|
@gitlab_default_branch = @g.project(@project.gpid).default_branch
|
||||||
|
end
|
||||||
|
|
||||||
|
# 更新Jenkins job,主要包括相关配置文件参数的更新,Trustie平台数据的更新
|
||||||
|
def update_jenkins_job
|
||||||
|
begin
|
||||||
|
rep_id = Repository.where(:project_id => @project.id).first.try(:id)
|
||||||
|
logger.error("#############################===>666")
|
||||||
|
sonar_name = @quality_analysis.sonar_name
|
||||||
|
job_name = "#{@quality_analysis.author_login}-#{rep_id}"
|
||||||
|
version = @quality_analysis.sonar_version
|
||||||
|
path = params[:path].blank? ? "./" : params[:path]
|
||||||
|
language = swith_language_type(params[:language])
|
||||||
|
branch = params[:branch]
|
||||||
|
identifier = @quality_analysis.rep_identifier
|
||||||
|
properties = "sonar.projectKey=#{sonar_name}
|
||||||
|
sonar.projectName=#{sonar_name}
|
||||||
|
sonar.projectVersion=#{version}
|
||||||
|
sonar.sources=#{path}
|
||||||
|
sonar.language=#{language.downcase}
|
||||||
|
sonar.sourceEncoding=utf-8"
|
||||||
|
git_url = @gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git"
|
||||||
|
|
||||||
|
# modify config.yml
|
||||||
|
@doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml')))
|
||||||
|
@doc.at_xpath("//hudson.plugins.git.UserRemoteConfig/url").content = git_url
|
||||||
|
@doc.at_xpath("//hudson.plugins.git.BranchSpec/name").content = "*/#{branch}"
|
||||||
|
@doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties
|
||||||
|
|
||||||
|
# update成功则返回 ‘200’
|
||||||
|
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
|
||||||
|
get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280")
|
||||||
|
logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200'
|
||||||
|
|
||||||
|
# 数据更新到Trustie数据库
|
||||||
|
if jenkins_job == '200'
|
||||||
|
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
|
||||||
|
@quality_analysis.path = path
|
||||||
|
@quality_analysis.language = language
|
||||||
|
@quality_analysis.branch = branch
|
||||||
|
@quality_analysis.save
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
logger.error("Update jenkins job: #{e}")
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)}
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# resource_id: login + @repository.id
|
||||||
def index
|
def index
|
||||||
|
begin
|
||||||
|
@branch = params[:branch]
|
||||||
|
@resource_id = params[:resource_id]
|
||||||
@sonar_address = Redmine::Configuration['sonar_address']
|
@sonar_address = Redmine::Configuration['sonar_address']
|
||||||
# if params[:resource_id].nil?
|
@jenkins_address = Redmine::Configuration['jenkins_address']
|
||||||
# @name_flag = true
|
if params[:resource_id].nil?
|
||||||
# @quality_analyses = QualityAnalysis.where(:project_id => @project.id)
|
@name_flag = true
|
||||||
# # @quality_analyses.map {|qa| qa.}
|
projects_date = open(@sonar_address + "/api/projects/index").read
|
||||||
# # if @quality_analyses.count > 0
|
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
||||||
# # @quality_analyses.each do |qa|
|
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
|
||||||
# # ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
|
||||||
# #
|
else
|
||||||
# # end
|
if params[:current_build_status] == "failure"
|
||||||
# # end
|
job_name = params[:job_name]
|
||||||
# # projects_date = open(@sonar_address + "/api/projects/index").read
|
@console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
|
||||||
# # arr = JSON.parse(projects_date).map {|m| m["nm"]}
|
end
|
||||||
# # arr.map
|
|
||||||
# else
|
|
||||||
qa = QualityAnalysis.where(:project_id => @project.id).first
|
|
||||||
@resource_id = qa.author_login+":"+qa.rep_identifier
|
|
||||||
@name_flag = false
|
|
||||||
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read
|
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read
|
||||||
@complexity =JSON.parse(complexity_date).first
|
@complexity =JSON.parse(complexity_date).first
|
||||||
issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read
|
issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read
|
||||||
@sonar_issues = JSON.parse(issue_date).first
|
@sonar_issues = JSON.parse(issue_date).first
|
||||||
# end
|
end
|
||||||
|
rescue => e
|
||||||
|
puts e
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find project of id params[:project_id]
|
# Find project of id params[:project_id]
|
||||||
|
@ -87,6 +198,14 @@ class QualityAnalysisController < ApplicationController
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_quality_analysis
|
||||||
|
begin
|
||||||
|
@quality_analysis = QualityAnalysis.find(params[:id])
|
||||||
|
rescue
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Authorize the user for the requested action
|
# Authorize the user for the requested action
|
||||||
def authorize(ctrl = params[:controller], action = params[:action], global = false)
|
def authorize(ctrl = params[:controller], action = params[:action], global = false)
|
||||||
unless @project.archived? && @project.gpid.nil?
|
unless @project.archived? && @project.gpid.nil?
|
||||||
|
@ -96,4 +215,14 @@ class QualityAnalysisController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def connect_jenkins
|
||||||
|
@gitlab_address = Redmine::Configuration['gitlab_address']
|
||||||
|
@jenkins_address = Redmine::Configuration['jenkins_address']
|
||||||
|
|
||||||
|
# connect jenkins
|
||||||
|
@client = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => "temp", :password => '123123')
|
||||||
|
rescue => e
|
||||||
|
logger.error("failed to connect Jenkins ==> #{e}")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,6 +20,8 @@ require 'SVG/Graph/BarHorizontal'
|
||||||
require 'digest/sha1'
|
require 'digest/sha1'
|
||||||
require 'redmine/scm/adapters/abstract_adapter'
|
require 'redmine/scm/adapters/abstract_adapter'
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
|
require 'json'
|
||||||
|
require 'open-uri'
|
||||||
|
|
||||||
class ChangesetNotFound < Exception; end
|
class ChangesetNotFound < Exception; end
|
||||||
class InvalidRevisionParam < Exception; end
|
class InvalidRevisionParam < Exception; end
|
||||||
|
@ -372,7 +374,7 @@ update
|
||||||
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
||||||
g_project = g.project(@project.gpid)
|
g_project = g.project(@project.gpid)
|
||||||
# 总的提交数
|
# 总的提交数
|
||||||
@changesets_all_count = @project.gpid.nil? ? 0 : g_project.commit_count
|
@changesets_all_count = @project.gpid.nil? ? 0 : commit_count(@project, @rev)
|
||||||
@g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
@g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch
|
||||||
# 访问该页面的是会后则刷新
|
# 访问该页面的是会后则刷新
|
||||||
if @project.project_score.nil?
|
if @project.project_score.nil?
|
||||||
|
|
|
@ -150,4 +150,55 @@ class SchoolController < ApplicationController
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#申请高校(单位) name:名称 province:省 city:市 address:地址 remarks:备注
|
||||||
|
def apply_add_school
|
||||||
|
|
||||||
|
data = {result:0,name:params[:name],school_id:0}
|
||||||
|
#0 成功 1参数错误 2名称已存在
|
||||||
|
data[:result] = 0
|
||||||
|
|
||||||
|
#检验参数
|
||||||
|
if params[:name] == "" || params[:province] == "" || params[:city] == "" || params[:address] == ""
|
||||||
|
data[:result] = 1
|
||||||
|
else
|
||||||
|
school_id = School.find_by_sql("select id from schools where name='#{params[:name]}'").first
|
||||||
|
if school_id
|
||||||
|
data[:result] = 2
|
||||||
|
else
|
||||||
|
school = School.new
|
||||||
|
school.name = params[:name].strip
|
||||||
|
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
|
||||||
|
school.save
|
||||||
|
|
||||||
|
#status 0未处理 1通过 2拒绝
|
||||||
|
applyschool = ApplyAddSchools.new
|
||||||
|
applyschool.school_id = school.id
|
||||||
|
applyschool.name = school.name
|
||||||
|
applyschool.province = params[:province]
|
||||||
|
applyschool.city = params[:city]
|
||||||
|
applyschool.address = params[:address]
|
||||||
|
applyschool.remarks = params[:remarks]
|
||||||
|
applyschool.save
|
||||||
|
|
||||||
|
data[:school_id] = school.id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
render :json =>data
|
||||||
|
end
|
||||||
|
|
||||||
|
def search_repeat_schoolname
|
||||||
|
status = 0
|
||||||
|
name = params[:name]
|
||||||
|
|
||||||
|
if name
|
||||||
|
school_id = School.find_by_sql("select id from schools where name='#{name}'").first
|
||||||
|
|
||||||
|
if school_id
|
||||||
|
status = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
render :json =>status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,6 +90,8 @@ class UsersController < ApplicationController
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when 'JournalsForMessage'
|
when 'JournalsForMessage'
|
||||||
@comment = JournalsForMessage.find params[:comment].to_i
|
@comment = JournalsForMessage.find params[:comment].to_i
|
||||||
|
when 'Message'
|
||||||
|
@comment = Message.find params[:comment].to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -111,6 +113,13 @@ class UsersController < ApplicationController
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id]
|
||||||
@activity_id = params[:activity_id]
|
@activity_id = params[:activity_id]
|
||||||
@type = 'JournalsForMessage'
|
@type = 'JournalsForMessage'
|
||||||
|
when 'Message'
|
||||||
|
@reply = Message.find params[:reply_id]
|
||||||
|
@user_activity_id = params[:user_activity_id]
|
||||||
|
@activity_id = params[:activity_id]
|
||||||
|
@is_course = params[:is_course]
|
||||||
|
@is_board = params[:is_board]
|
||||||
|
@type = 'Message'
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
@ -1248,6 +1257,12 @@ class UsersController < ApplicationController
|
||||||
render :layout=>'new_base_user'
|
render :layout=>'new_base_user'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#给某人留言
|
||||||
|
def feedBackTo
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def user_comments
|
def user_comments
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -3275,7 +3290,12 @@ class UsersController < ApplicationController
|
||||||
@journals = obj.children.reorder("created_at desc")
|
@journals = obj.children.reorder("created_at desc")
|
||||||
when 'Message'
|
when 'Message'
|
||||||
obj = Message.where('id = ?', params[:id].to_i).first
|
obj = Message.where('id = ?', params[:id].to_i).first
|
||||||
@journals = obj.children.reorder("created_on desc")
|
@type = 'Message'
|
||||||
|
@is_course = params[:is_course]
|
||||||
|
@is_board = params[:is_board]
|
||||||
|
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||||
|
comments = []
|
||||||
|
@journals = get_all_children(comments, obj)
|
||||||
when 'News'
|
when 'News'
|
||||||
obj = News.where('id = ?', params[:id].to_i).first
|
obj = News.where('id = ?', params[:id].to_i).first
|
||||||
@journals = obj.comments.reorder("created_on desc")
|
@journals = obj.comments.reorder("created_on desc")
|
||||||
|
|
|
@ -360,6 +360,27 @@ class WordsController < ApplicationController
|
||||||
redirect_to user_url(user.id)
|
redirect_to user_url(user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#邮箱激活问题留言 留言成功给出提示框
|
||||||
|
def leave_email_activation_message
|
||||||
|
status = 1 #成功
|
||||||
|
me = User.find(params[:user])
|
||||||
|
if me
|
||||||
|
#课程使者id=1
|
||||||
|
@user = User.find(1)
|
||||||
|
if params[:text].size>0 && @user
|
||||||
|
# @user.add_jour(me, params[:text])
|
||||||
|
#私信
|
||||||
|
message = "<span style='color:red;'>【未收到激活邮件的用户反馈,用户邮箱:"+me.mail+"】</span><br>"+params[:text]
|
||||||
|
@user.journals_for_messages << JournalsForMessage.new(:user_id => me.id, :notes => message, :reply_id => 0, :status => true, :is_readed => false, :private => 1)
|
||||||
|
else
|
||||||
|
status = 0
|
||||||
|
end
|
||||||
|
render :json => status
|
||||||
|
else
|
||||||
|
render_403
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_user
|
def find_user
|
||||||
|
|
|
@ -803,22 +803,22 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取Gitlab版本库提交总数
|
# 获取Gitlab版本库提交总数
|
||||||
def commit_count(project)
|
def commit_count(project, branch)
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
#add by hx
|
#add by hx
|
||||||
if g.commits(project.gpid , :page=>200).count > 0
|
if g.commits(project.gpid, :ref_name => @rev , :page=>200).count > 0
|
||||||
count = 4020
|
count = 4020
|
||||||
elsif g.commits(project.gpid , :page=>25).count==0
|
elsif g.commits(project.gpid , :page=>25, :ref_name => branch).count==0
|
||||||
count = count_commits(project.gpid , 0 , 25)
|
count = count_commits(project.gpid , 0 , 25)
|
||||||
elsif g.commits(project.gpid , :page=>50).count ==0
|
elsif g.commits(project.gpid , :page=>50, :ref_name => branch).count ==0
|
||||||
count = count_commits(project.gpid , 25 , 50)+ 25 * 20
|
count = count_commits(project.gpid , 25 , 50)+ 25 * 20
|
||||||
elsif g.commits(project.gpid , :page=>75).count ==0
|
elsif g.commits(project.gpid , :page=>75, :ref_name => branch).count ==0
|
||||||
count = count_commits(project.gpid , 50 , 75)+ 50 * 20
|
count = count_commits(project.gpid , 50 , 75)+ 50 * 20
|
||||||
elsif g.commits(project.gpid , :page=>100).count== 0
|
elsif g.commits(project.gpid , :page=>100, :ref_name => branch).count== 0
|
||||||
count = count_commits(project.gpid , 75 , 100) + 75 * 20
|
count = count_commits(project.gpid , 75 , 100) + 75 * 20
|
||||||
elsif g.commits(project.gpid , :page=>125).count==0
|
elsif g.commits(project.gpid , :page=>125, :ref_name => branch).count==0
|
||||||
count = count_commits(project.gpid , 100 , 125) + 100 * 20
|
count = count_commits(project.gpid , 100 , 125) + 100 * 20
|
||||||
elsif g.commits(project.gpid , :page=>150).count==0
|
elsif g.commits(project.gpid , :page=>150, :ref_name => branch).count==0
|
||||||
count = count_commits(project.gpid , 125 , 150) + 125 * 20
|
count = count_commits(project.gpid , 125 , 150) + 125 * 20
|
||||||
else
|
else
|
||||||
count = count_commits(project.gpid , 150 ,200) + 150 * 20
|
count = count_commits(project.gpid , 150 ,200) + 150 * 20
|
||||||
|
@ -832,7 +832,7 @@ module ApplicationHelper
|
||||||
if $g.commits(project_id,:page => page).count == 0
|
if $g.commits(project_id,:page => page).count == 0
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
count = count + $g.commits(project_id,:page => page).count
|
count = count + $g.commits(project_id, :ref_name => @rev, :page => page).count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
|
@ -3138,9 +3138,9 @@ def get_reply_parents_no_root parents_rely, comment
|
||||||
parents_rely
|
parents_rely
|
||||||
end
|
end
|
||||||
|
|
||||||
#获取留言的所有子节点
|
#获取所有子节点
|
||||||
def get_all_children result, jour
|
def get_all_children result, jour
|
||||||
if jour.kind_of? JournalsForMessage
|
if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message)
|
||||||
jour.children.each do |jour_child|
|
jour.children.each do |jour_child|
|
||||||
result << jour_child
|
result << jour_child
|
||||||
get_all_children result, jour_child
|
get_all_children result, jour_child
|
||||||
|
|
|
@ -23,7 +23,7 @@ module OrganizationsHelper
|
||||||
when 'activity' then
|
when 'activity' then
|
||||||
return '动态'
|
return '动态'
|
||||||
when 'course' then
|
when 'course' then
|
||||||
return '课程'
|
return '班级'
|
||||||
when 'project' then
|
when 'project' then
|
||||||
return '项目'
|
return '项目'
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,19 +3,19 @@ module QualityAnalysisHelper
|
||||||
|
|
||||||
def sqale_rating_status val
|
def sqale_rating_status val
|
||||||
arr = []
|
arr = []
|
||||||
if val.to_i > 0 && val.to_i < 5
|
if val < 5
|
||||||
arr << "很好"
|
arr << "很好"
|
||||||
arr << "b_green2"
|
arr << "b_green2"
|
||||||
elsif val.to_i > 5 && val.to_i < 10
|
elsif val. > 5 && val < 10
|
||||||
arr << "较好"
|
arr << "较好"
|
||||||
arr << "b_slow_yellow"
|
arr << "b_slow_yellow"
|
||||||
elsif val.to_i > 10 && val.to_i < 20
|
elsif val > 10 && val < 20
|
||||||
arr << "中等"
|
arr << "中等"
|
||||||
arr << "b_yellow"
|
arr << "b_yellow"
|
||||||
elsif val.to_i > 20 && val.to_i < 50
|
elsif val > 20 && val < 50
|
||||||
arr << "较差"
|
arr << "较差"
|
||||||
arr << "b_slow_red"
|
arr << "b_slow_red"
|
||||||
elsif val.to_i > 20
|
elsif val > 20
|
||||||
arr << "很差"
|
arr << "很差"
|
||||||
arr << "b_red"
|
arr << "b_red"
|
||||||
end
|
end
|
||||||
|
@ -23,13 +23,13 @@ module QualityAnalysisHelper
|
||||||
|
|
||||||
def complexity_status val
|
def complexity_status val
|
||||||
arr = []
|
arr = []
|
||||||
if val.to_i < 10
|
if val < 10
|
||||||
arr << "良好"
|
arr << "良好"
|
||||||
arr << "b_green2"
|
arr << "b_green2"
|
||||||
elsif val.to_i > 10 && val.to_i < 15
|
elsif val > 10 && val < 15
|
||||||
arr << "较高"
|
arr << "较高"
|
||||||
arr << "b_yellow"
|
arr << "b_yellow"
|
||||||
elsif val.to_i > 15
|
elsif val > 15
|
||||||
arr << "很高"
|
arr << "很高"
|
||||||
arr << "b_red"
|
arr << "b_red"
|
||||||
end
|
end
|
||||||
|
@ -37,13 +37,13 @@ module QualityAnalysisHelper
|
||||||
|
|
||||||
def duplicated_lines_density_status val
|
def duplicated_lines_density_status val
|
||||||
arr = []
|
arr = []
|
||||||
if val.to_i < 30
|
if val < 30
|
||||||
arr << "良好"
|
arr << "良好"
|
||||||
arr << "b_green2"
|
arr << "b_green2"
|
||||||
elsif val.to_i > 30 && val.to_i < 50
|
elsif val > 30 && val < 50
|
||||||
arr << "较高"
|
arr << "较高"
|
||||||
arr << "b_yellow"
|
arr << "b_yellow"
|
||||||
elsif val.to_i > 50
|
elsif val > 50
|
||||||
arr << "很高"
|
arr << "很高"
|
||||||
arr << "b_red"
|
arr << "b_red"
|
||||||
end
|
end
|
||||||
|
@ -51,28 +51,28 @@ module QualityAnalysisHelper
|
||||||
|
|
||||||
def comment_lines_density_status val
|
def comment_lines_density_status val
|
||||||
arr = []
|
arr = []
|
||||||
if val.to_i < 20
|
if val < 20
|
||||||
arr << "较低"
|
arr << "较低"
|
||||||
arr << "b_yellow"
|
arr << "b_yellow"
|
||||||
elsif val.to_i > 20 && val.to_i < 50
|
elsif val > 20 && val < 50
|
||||||
arr << "正常"
|
arr << "正常"
|
||||||
arr << "b_green2"
|
arr << "b_green2"
|
||||||
elsif val.to_i > 50
|
elsif val > 50
|
||||||
arr << "较高"
|
arr << "较高"
|
||||||
arr << "b_red"
|
arr << "b_red"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def score_sqale_rating val
|
def score_sqale_rating val
|
||||||
if val.to_i > 0 && val.to_i < 5
|
if val > 0 && val < 5
|
||||||
"5"
|
"5"
|
||||||
elsif val.to_i > 5 && val.to_i < 10
|
elsif val > 5 && val < 10
|
||||||
"4"
|
"4"
|
||||||
elsif val.to_i > 10 && val.to_i < 20
|
elsif val > 10 && val < 20
|
||||||
"3"
|
"3"
|
||||||
elsif val.to_i > 20 && val.to_i < 50
|
elsif val > 20 && val < 50
|
||||||
"2"
|
"2"
|
||||||
elsif val.to_i > 20
|
elsif val > 20
|
||||||
"1"
|
"1"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,6 +41,11 @@ module RepositoriesHelper
|
||||||
identifiers.include?(iden) ? false :true
|
identifiers.include?(iden) ? false :true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def quality_analysis login, rep_id
|
||||||
|
long_rep_id = "#{login}:#{rep_id}"
|
||||||
|
QualityAnalysis.where(:sonar_name => long_rep_id).first
|
||||||
|
end
|
||||||
|
|
||||||
# 获取文件目录的最新动态
|
# 获取文件目录的最新动态
|
||||||
def get_trees_last_changes(project_id, rev, ent_name)
|
def get_trees_last_changes(project_id, rev, ent_name)
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
|
|
|
@ -48,17 +48,17 @@ module SyllabusesHelper
|
||||||
option6 = []
|
option6 = []
|
||||||
|
|
||||||
option1 << "请选择"
|
option1 << "请选择"
|
||||||
option1 << 1
|
option1 << 0
|
||||||
option2 << "公共必修课"
|
option2 << "公共必修课"
|
||||||
option2 << 2
|
option2 << 1
|
||||||
option3 << "学科必修课"
|
option3 << "学科必修课"
|
||||||
option3 << 3
|
option3 << 2
|
||||||
option4 << "专业选修课"
|
option4 << "专业选修课"
|
||||||
option4 << 4
|
option4 << 3
|
||||||
option5 << "实践必修课"
|
option5 << "实践必修课"
|
||||||
option5 << 5
|
option5 << 4
|
||||||
option6 << "实践选修课"
|
option6 << "实践选修课"
|
||||||
option6 << 6
|
option6 << 5
|
||||||
|
|
||||||
type << option1
|
type << option1
|
||||||
type << option2
|
type << option2
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
class ApplyAddSchools < ActiveRecord::Base
|
||||||
|
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
|
||||||
|
end
|
|
@ -471,8 +471,7 @@ class Course < ActiveRecord::Base
|
||||||
if !code || code.size <5
|
if !code || code.size <5
|
||||||
code = CODES.sample(5).join
|
code = CODES.sample(5).join
|
||||||
return generate_invite_code if Course.where(invite_code: code).present?
|
return generate_invite_code if Course.where(invite_code: code).present?
|
||||||
self[:invite_code] = code
|
update_attribute(:invite_code, code)
|
||||||
save! && reload
|
|
||||||
end
|
end
|
||||||
code
|
code
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class QualityAnalysis < ActiveRecord::Base
|
class QualityAnalysis < ActiveRecord::Base
|
||||||
attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language
|
attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language, :sonar_name
|
||||||
|
|
||||||
def user_rep_name
|
def user_rep_name
|
||||||
self.author_login+":"+self.rep_identifier
|
self.author_login+":"+self.rep_identifier
|
||||||
|
|
|
@ -324,15 +324,15 @@ class CoursesService
|
||||||
define_error [
|
define_error [
|
||||||
0, '加入成功',
|
0, '加入成功',
|
||||||
1, '密码错误',
|
1, '密码错误',
|
||||||
2, '课程已过期 请联系课程管理员重启课程。',
|
2, '班级已过期 请联系班级管理员重启班级。',
|
||||||
3, '您已经加入了课程',
|
3, '您已经加入了班级',
|
||||||
4, '您加入的课程不存在',
|
4, '您加入的班级不存在',
|
||||||
5, '您还未登录',
|
5, '您还未登录',
|
||||||
6, '申请成功,请等待审核完毕',
|
6, '申请成功,请等待审核完毕',
|
||||||
7, '您已经发送过申请了,请耐心等待',
|
7, '您已经发送过申请了,请耐心等待',
|
||||||
8, '您已经是该课程的教师了',
|
8, '您已经是该班级的教师了',
|
||||||
9, '您已经是该课程的教辅了',
|
9, '您已经是该班级的教辅了',
|
||||||
10, '您已经是该课程的管理员了',
|
10, '您已经是该班级的管理员了',
|
||||||
'未知错误,请稍后再试'
|
'未知错误,请稍后再试'
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
<div class="new_content">
|
||||||
|
<div class="email_verify">
|
||||||
|
<p class="email_verify_prompt"><span class="icons_email_prompt"></span>您的账号尚未激活,请先进入您的注册邮箱,激活您的账号。</p>
|
||||||
|
<button class="email_verify_btn mt30 ml30" onclick = "resendMail('<%= resendmail_path(@user) %>','<%= @user.id %>');">重新发送激活邮件</button>
|
||||||
|
<%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %>
|
||||||
|
<ul class="email_prompt_txt ml30 mt30">
|
||||||
|
<p class="email_prompt_p">如果您尚未收到激活邮件,请按照以下步骤操作:</p>
|
||||||
|
<li>检查邮箱的“订阅邮件”、“垃圾邮件”,可能会发现激活邮件。 </li>
|
||||||
|
<li>如果激活邮件已无效,请点击重新发送激活邮件按钮。</li>
|
||||||
|
<li>如果您无法收到激活邮件,请您直接给我们管理员留言:</li>
|
||||||
|
<div class=" mt10">
|
||||||
|
<textarea style="resize: none;" class="email_prompt_mes" placeholder="请管理员尽快帮我解决邮箱激活问题"></textarea>
|
||||||
|
<button class="email_sub_btn fr" onclick="leave_email_activation_message('<%= leave_email_activation_message_path(1)%>','<%= @user.id %>');">确定</button>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function resendMail(url,id)
|
||||||
|
{
|
||||||
|
$.get(
|
||||||
|
url,
|
||||||
|
{user: id },
|
||||||
|
function (data) {
|
||||||
|
//邮箱@之前用a**b格式显示
|
||||||
|
var mail = data.email;
|
||||||
|
var pos = mail.indexOf("@");
|
||||||
|
var restr = mail.substring(1,pos-1);
|
||||||
|
if( mail.split("@")[0].length > 2 ){
|
||||||
|
mail = mail.replace(restr,"***");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".email_verify_btn").replaceWith("<p class='email_verify_p mt30 ml30'>激活邮件已发送至您的注册邮箱("+mail+"),请及时登录邮箱进行验证。</p>");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
function leave_email_activation_message(url,user)
|
||||||
|
{
|
||||||
|
if ($(".email_prompt_mes").val().length == 0){
|
||||||
|
//弹框请他输入文字
|
||||||
|
var htmlvalue = "</br><div style='width:550px;text-align:center'>您的留言不能为空</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||||
|
pop_up_box(htmlvalue,580,30,50);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
data: {user: user, text: $(".email_prompt_mes").val() },
|
||||||
|
type: "POST",
|
||||||
|
success: function (data) {
|
||||||
|
var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好,并通过邮件通知您。感谢您的反馈!</p></div>"
|
||||||
|
pop_up_box(htmlvalue, 580, 30, 45);
|
||||||
|
$(".email_prompt_mes").val("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,127 +0,0 @@
|
||||||
<% @nav_dispaly_home_path_label = 1
|
|
||||||
@nav_dispaly_main_course_label = 1
|
|
||||||
@nav_dispaly_main_project_label = 1
|
|
||||||
@nav_dispaly_main_contest_label = 1 %>
|
|
||||||
<% @nav_dispaly_forum_label = 1%>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- end -->
|
|
||||||
|
|
||||||
<h3><%= l(:label_register) %> <%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
|
|
||||||
|
|
||||||
<%= labelled_form_for @user, :url => register_path do |f| %>
|
|
||||||
<%= error_messages_for 'user' %>
|
|
||||||
<div class="box tabular">
|
|
||||||
|
|
||||||
<% if @user.auth_source_id.nil? %>
|
|
||||||
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
|
|
||||||
<em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em>
|
|
||||||
</p>
|
|
||||||
<p><%= f.password_field :password, :size => 25, :required => true %><span id="valid_user_password"></span>
|
|
||||||
<em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
|
||||||
</p>
|
|
||||||
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<%= f.text_field :mail,:size => 25, :required => true %>
|
|
||||||
<span id="valid_user_mail" ></span>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<em class="info" style="color: #acaeb1">
|
|
||||||
<p><%= "#{l(:label_mail_attention)} " %></p>
|
|
||||||
<p><%= "#{l(:label_mail_attention1)} " %></p>
|
|
||||||
</em>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- end -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td><%= submit_tag l(:button_submit) %></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</p>
|
|
||||||
<% end %>
|
|
||||||
<% if Setting.openid? %>
|
|
||||||
<p><%= f.text_field :identity_url %></p>
|
|
||||||
<% end %>
|
|
||||||
<% @user.custom_field_values.select { |v| v.editable? || v.required? }.each do |value| %>
|
|
||||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% password_min_length = Setting.password_min_length %>
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(document).ready(function () {
|
|
||||||
var $login = $('#user_login')
|
|
||||||
var $mail = $('#user_mail')
|
|
||||||
var $password = $('#user_password')
|
|
||||||
var $password_confirmation = $('#user_password_confirmation')
|
|
||||||
$login.blur(function (event) {
|
|
||||||
if ($(this).is('#user_login')) {
|
|
||||||
$.get(
|
|
||||||
'<%=account_valid_ajax_path%>',
|
|
||||||
{ valid: "login",
|
|
||||||
value: this.value },
|
|
||||||
function (data) {
|
|
||||||
if (data.valid) {
|
|
||||||
$('#valid_user_login').html('<span class="green">' + data.message + "</span>");
|
|
||||||
} else {
|
|
||||||
$('#valid_user_login').html('<span class="red">' + data.message + "</span>");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
;
|
|
||||||
});
|
|
||||||
|
|
||||||
$mail.blur(function (event) {
|
|
||||||
if ($(this).is('#user_mail')) {
|
|
||||||
$.get('<%=account_valid_ajax_path%>',
|
|
||||||
{ valid: "mail",
|
|
||||||
value: this.value },
|
|
||||||
function (data) {
|
|
||||||
if (data.valid) {
|
|
||||||
$('#valid_user_mail').html('<span class="green">' + data.message + "</span>");
|
|
||||||
} else {
|
|
||||||
$('#valid_user_mail').html('<span class="red">' + data.message + "</span>");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
;
|
|
||||||
});
|
|
||||||
$password.blur(function () {
|
|
||||||
var pas1 = document.getElementById("user_password").value;
|
|
||||||
var password_min_length = <%= password_min_length %>
|
|
||||||
if (pas1.length >= password_min_length) {
|
|
||||||
|
|
||||||
$('#valid_user_password').html('<span class="green">'+ "</span>");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$('#valid_user_password').html('<span class="red">' + "<%= l(:setting_password_min_length_limit, :count => password_min_length) %>" + "</span>");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
$password_confirmation.blur(function () {
|
|
||||||
var password_min_length = <%= password_min_length %>
|
|
||||||
var pas1 = document.getElementById("user_password").value;
|
|
||||||
var pas2 = document.getElementById("user_password_confirmation").value;
|
|
||||||
if (pas1.length >= password_min_length && pas1 == pas2 ) {
|
|
||||||
$('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$('#valid_password').html('<span class="red">' + "<%= l(:setting_password_error) %>" + "</span>");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -2,31 +2,31 @@
|
||||||
<% if defined?(container) && container && container.saved_attachments %>
|
<% if defined?(container) && container && container.saved_attachments %>
|
||||||
<% if isReply %>
|
<% if isReply %>
|
||||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||||
<span id="attachments_p<%= i %>" class="sub_btn">
|
<p id="attachments_<%= i+1 %>" class="sub_btn">
|
||||||
|
|
||||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
||||||
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||||
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
||||||
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
||||||
|
|
||||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "#{i+1}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload', :containerid => "2") %>
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% container.attachments.each_with_index do |attachment, i| %>
|
<% container.attachments.each_with_index do |attachment, i| %>
|
||||||
<span id="attachments_p<%= i %>" class="attachment">
|
<p id="attachments_<%= i+1 %>" class="attachment">
|
||||||
|
|
||||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly=>'readonly')%>
|
||||||
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||||
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
||||||
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
|
||||||
|
|
||||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
|
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "#{i+1}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload', :containerid => "2") %>
|
||||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -91,9 +91,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
<!--<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >-->
|
||||||
<%= @article.content.html_safe%>
|
<!--<%#= @article.content.html_safe%>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
|
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>@article.id, :content=>@article.content} %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class=" fl" style="width: 600px">
|
<div class=" fl" style="width: 600px">
|
||||||
<%#= link_to_attachments_course @topic, :author => false %>
|
<%#= link_to_attachments_course @topic, :author => false %>
|
||||||
|
@ -192,12 +193,12 @@
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
var postContent = $("#message_description_<%= @article.id %>").html();
|
// var postContent = $("#message_description_<%#= @article.id %>").html();
|
||||||
postContent = postContent.replace(/ /g," ");
|
// postContent = postContent.replace(/ /g," ");
|
||||||
postContent= postContent.replace(/ {2}/g," ");
|
// postContent= postContent.replace(/ {2}/g," ");
|
||||||
postContent=postContent.replace(/ /g," ");
|
// postContent=postContent.replace(/ /g," ");
|
||||||
postContent=postContent.replace(/ /g," ");
|
// postContent=postContent.replace(/ /g," ");
|
||||||
$("#message_description_<%= @article.id %>").html(postContent);
|
// $("#message_description_<%#= @article.id %>").html(postContent);
|
||||||
autoUrl('message_description_<%= @article.id %>');
|
// autoUrl('message_description_<%#= @article.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,12 +10,12 @@ window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/co
|
||||||
<% elsif @state == 1 %>
|
<% elsif @state == 1 %>
|
||||||
alert("密码错误");
|
alert("密码错误");
|
||||||
<% elsif @state == 2 %>
|
<% elsif @state == 2 %>
|
||||||
alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)");
|
alert("班级已过期\n请联系班级管理员重启班级。(在配置班级处)");
|
||||||
<% elsif @state == 3 %>
|
<% elsif @state == 3 %>
|
||||||
alert("您已经加入了课程");
|
alert("您已经加入了班级");
|
||||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||||
<% elsif @state == 4 %>
|
<% elsif @state == 4 %>
|
||||||
alert("您加入的课程不存在");
|
alert("您加入的班级不存在");
|
||||||
<% elsif @state == 5 %>
|
<% elsif @state == 5 %>
|
||||||
alert("您还未登录");
|
alert("您还未登录");
|
||||||
<% elsif @state == 6 %>
|
<% elsif @state == 6 %>
|
||||||
|
@ -25,15 +25,15 @@ hidden_join_course_form();
|
||||||
alert("您已经发送过申请了,请耐心等待");
|
alert("您已经发送过申请了,请耐心等待");
|
||||||
hidden_join_course_form();
|
hidden_join_course_form();
|
||||||
<% elsif @state == 8%>
|
<% elsif @state == 8%>
|
||||||
alert("您已经是该课程的教师了");
|
alert("您已经是该班级的教师了");
|
||||||
hidden_join_course_form();
|
hidden_join_course_form();
|
||||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||||
<% elsif @state == 9%>
|
<% elsif @state == 9%>
|
||||||
alert("您已经是该课程的教辅了");
|
alert("您已经是该班级的教辅了");
|
||||||
hidden_join_course_form();
|
hidden_join_course_form();
|
||||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||||
<% elsif @state == 10%>
|
<% elsif @state == 10%>
|
||||||
alert("您已经是该课程的管理员了");
|
alert("您已经是该班级的管理员了");
|
||||||
hidden_join_course_form();
|
hidden_join_course_form();
|
||||||
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
}
|
}
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @course.is_public? %>
|
<% if @course.is_public? %>
|
||||||
$("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
$("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
$("#show_course_<%= @course.id %>").attr("title","私有班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||||
<% end %>
|
<% end %>
|
||||||
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
||||||
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
|
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
|
||||||
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
|
||||||
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
|
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
|
||||||
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();">
|
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick="f_submit();">
|
||||||
<%= l(:label_submit)%>
|
<%= l(:label_submit)%>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -25,7 +25,9 @@
|
||||||
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
|
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
|
||||||
<%#= l(:label_technical_support) %>
|
<%#= l(:label_technical_support) %>
|
||||||
<!--白 羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
|
<!--白 羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
|
||||||
<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center">QQ群号:173184401</p>
|
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
|
||||||
|
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号:173184401</a>-->
|
||||||
|
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="side_bottom"></div>
|
<div class="side_bottom"></div>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
<ul class="syllabus_leftinfo" id="all_syllabus_attr" onmouseover="$('#signature_edit').show();" onmouseout="$('#signature_edit').hide();">
|
||||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :class => 'fr', :onclick => "show_edit_base_info();"%>
|
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :id => 'signature_edit', :class => 'fr', :onclick => "show_edit_base_info();"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 %>
|
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||||
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<li><label>先修课程:</label><%=syllabus.pre_course %></li>
|
<li><label>先修课程:</label><%=syllabus.pre_course %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == '' %>
|
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %>
|
||||||
<li class="none none_attr"><label>课程性质:</label><span class="fontGrey3">空</span></li>
|
<li class="none none_attr"><label>课程性质:</label><span class="fontGrey3">空</span></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if syllabus.credit.nil? || syllabus.credit == '' %>
|
<% if syllabus.credit.nil? || syllabus.credit == '' %>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<li class="none none_attr"><label>先修课程:</label><span class="fontGrey3">空</span></li>
|
<li class="none none_attr"><label>先修课程:</label><span class="fontGrey3">空</span></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
||||||
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon" id="show_all_syllabus_attr"></a></span>
|
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon" id="show_all_syllabus_attr"></a></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="mb5" id="syllabus_eng_name_show">
|
<div class="mb5" id="syllabus_eng_name_show" style="word-break:normal;word-wrap:normal;">
|
||||||
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
|
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
|
||||||
</div>
|
</div>
|
||||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit" onblur="edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');"><%= @syllabus.eng_name %></textarea>
|
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit" onblur="edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');"><%= @syllabus.eng_name %></textarea>
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
<p><%= l(:mail_body_register) %><br />
|
<p><%= l(:mail_body_register) %><br />
|
||||||
<%= link_to h(@url), @url %></p>
|
<%= link_to h(@url), @url %></p>
|
||||||
|
<p>如果点击链接无效请复制该链接到浏览器中打开</p>
|
||||||
|
<br>
|
||||||
|
<p>感谢您的使用!</p>
|
||||||
|
<p>Trustie团队</p><p></p>
|
||||||
|
|
|
@ -95,9 +95,10 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% unless @replies.empty? %>
|
<% all_comments = []%>
|
||||||
|
<% comments = get_all_children(all_comments, @topic) %>
|
||||||
<div class="" id="reply_div_<%= @topic.id %>">
|
<div class="" id="reply_div_<%= @topic.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% comments.each_with_index do |reply,i| %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
@ -110,32 +111,41 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<%= time_from_now(reply.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
||||||
|
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||||
|
<% end %>
|
||||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div class="orig_reply mb10 mt-10">
|
||||||
<%= format_time(reply.created_on) %>
|
<div class="reply">
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<span class="reply-right">
|
||||||
<span id="reply_praise_count_<%= reply.id %>">
|
<span id="reply_praise_count_<%= reply.id %>">
|
||||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
||||||
</span>
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
{:action => 'quote', :id => reply},
|
{:action => 'quote', :id => reply},
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:method => 'get',
|
:method => 'get',
|
||||||
:class => 'fr newsBlue mr10',
|
|
||||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||||
|
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
{:action => 'destroy', :id => reply},
|
{:action => 'destroy', :id => reply},
|
||||||
:method => :post,
|
:method => :post,
|
||||||
:class => 'fr newsGrey mr10',
|
:class => 'fr mr20',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:title => l(:button_delete)
|
:title => l(:button_delete)
|
||||||
) if reply.course_destroyable_by?(User.current) %>
|
) if reply.course_destroyable_by?(User.current) %>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="reply_message_<%= reply.id%>"></p>
|
<p id="reply_message_<%= reply.id%>"></p>
|
||||||
|
@ -145,7 +155,6 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
||||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||||
|
|
|
@ -156,9 +156,10 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% unless @replies.empty? %>
|
<% all_comments = []%>
|
||||||
|
<% comments = get_all_children(all_comments, @topic) %>
|
||||||
<div class="" id="reply_div_<%= @topic.id %>">
|
<div class="" id="reply_div_<%= @topic.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% comments.each_with_index do |reply,i| %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
@ -171,36 +172,41 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= time_from_now(reply.created_on) %>
|
||||||
<% else %>
|
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
||||||
|
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||||
|
<% end %>
|
||||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe%>
|
<%= reply.content.html_safe%>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div class="orig_reply mb10 mt-10">
|
||||||
<%= format_time(reply.created_on) %>
|
<div class="reply">
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<span class="reply-right">
|
||||||
<span id="reply_praise_count_<%= reply.id %>">
|
<span id="reply_praise_count_<%= reply.id %>">
|
||||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
||||||
</span>
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
{:action => 'quote', :id => reply},
|
{:action => 'quote', :id => reply},
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:method => 'get',
|
:method => 'get',
|
||||||
:class => 'fr newsBlue mr10',
|
|
||||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||||
|
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
{:action => 'destroy', :id => reply},
|
{:action => 'destroy', :id => reply},
|
||||||
:method => :post,
|
:method => :post,
|
||||||
:class => 'fr newsGrey mr10',
|
:class => 'fr mr20',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:title => l(:button_delete)
|
:title => l(:button_delete)
|
||||||
) if reply.destroyable_by?(User.current) %>
|
) if reply.course_destroyable_by?(User.current) %>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="reply_message_<%= reply.id%>"></p>
|
<p id="reply_message_<%= reply.id%>"></p>
|
||||||
|
@ -209,8 +215,6 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
<div class="ReplyToMessageInputContainer mb10">
|
<div class="ReplyToMessageInputContainer mb10">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<div nhname='new_message_<%= reply.id%>'>
|
<div nhname='new_message_<%= reply.id%>'>
|
||||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :method => "post", :id => 'new_form' do |f| %>
|
||||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||||
<input type="hidden" name="reply[subject]" id="reply_subject">
|
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.id %>
|
||||||
|
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@topic.id %>
|
||||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply[content]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<%if @project%>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||||
|
<%elsif @course%>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||||
|
<% elsif @org_subfield %>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<%end%>
|
||||||
|
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
|
|
@ -1,16 +1,8 @@
|
||||||
/*$('#message_subject').val("<%#= raw escape_javascript(@subject) %>");
|
|
||||||
$('#message_quote').html("<%#= raw escape_javascript(@temp.content.html_safe) %>");
|
|
||||||
//$('#message_content').val("<#%= raw escape_javascript(@content) %>");
|
|
||||||
$('#quote_quote').html("<%#= raw escape_javascript(@temp.content.html_safe) %>");
|
|
||||||
|
|
||||||
showAndScrollTo("reply", "message_content");
|
|
||||||
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
|
||||||
$("img").removeAttr("align");*/
|
|
||||||
if($("#reply_message_<%= @message.id%>").length > 0) {
|
if($("#reply_message_<%= @message.id%>").length > 0) {
|
||||||
$("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message,:temp =>@temp,:subject =>@subject}) %>");
|
$("#reply_message_<%= @message.id%>").replaceWith("<%= escape_javascript(render :partial => 'reply_message', :locals => {:reply => @message}) %>");
|
||||||
$(function(){
|
$(function(){
|
||||||
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
/*$('#reply_subject').val("<%#= raw escape_javascript(@subject) %>");
|
||||||
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
$('#quote_quote').val("<%#= raw escape_javascript(@temp.content.html_safe) %>");*/
|
||||||
sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>");
|
sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>");
|
||||||
});
|
});
|
||||||
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
|
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
|
||||||
|
|
|
@ -0,0 +1,337 @@
|
||||||
|
<h2 class="winbox_h2">添加新的高校(单位)</h2>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<ul class="winbox_edit_new">
|
||||||
|
<li>
|
||||||
|
<label class="fl"><span class="c_red mr5">*</span>名称:</label>
|
||||||
|
<input id = "schoolname" type="text" class="winbox_input fl" onBlur = 'ifNameRepeat()' onFocus = '$("#schoolrepeatnotice").text("");$("#schoolrepeatnotice").attr("value",1);$("#schoolrepeatnotice").hide(); '/>
|
||||||
|
<span class="ml2" id="schoolrepeatnotice" style="color:red;" display="none"></span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="fl"> </label>
|
||||||
|
<span class="fl">例如:</span><span class="icons_right fl mt5 "></span><span class="fl">国防科学技术大学</span>
|
||||||
|
<span class="icons_error fl mt5 ml10"></span><span class="fl">国防科大计算机1班</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="fl"><span class="c_red mr5">*</span>地区:</label>
|
||||||
|
<select onchange="showcity(this.value, document.getElementById('schoolCity'));" name="province" id="schollProvince" class="winbox_select fl" style="height:28px;margin-left:2px;">
|
||||||
|
<option value="">--请选择省份--</option>
|
||||||
|
<option value="北京">北京</option>
|
||||||
|
<option value="上海">上海</option>
|
||||||
|
<option value="广东">广东</option>
|
||||||
|
<option value="江苏">江苏</option>
|
||||||
|
<option value="浙江">浙江</option>
|
||||||
|
<option value="重庆">重庆</option>
|
||||||
|
<option value="安徽">安徽</option>
|
||||||
|
<option value="福建">福建</option>
|
||||||
|
<option value="甘肃">甘肃</option>
|
||||||
|
<option value="广西">广西</option>
|
||||||
|
<option value="贵州">贵州</option>
|
||||||
|
<option value="海南">海南</option>
|
||||||
|
<option value="河北">河北</option>
|
||||||
|
<option value="黑龙江">黑龙江</option>
|
||||||
|
<option value="河南">河南</option>
|
||||||
|
<option value="湖北">湖北</option>
|
||||||
|
<option value="湖南">湖南</option>
|
||||||
|
<option value="江西">江西</option>
|
||||||
|
<option value="吉林">吉林</option>
|
||||||
|
<option value="辽宁">辽宁</option>
|
||||||
|
<option value="内蒙古">内蒙古</option>
|
||||||
|
<option value="宁夏">宁夏</option>
|
||||||
|
<option value="青海">青海</option>
|
||||||
|
<option value="山东">山东</option>
|
||||||
|
<option value="山西">山西</option>
|
||||||
|
<option value="陕西">陕西</option>
|
||||||
|
<option value="四川">四川</option>
|
||||||
|
<option value="天津">天津</option>
|
||||||
|
<option value="新疆">新疆</option>
|
||||||
|
<option value="西藏">西藏</option>
|
||||||
|
<option value="云南">云南</option>
|
||||||
|
<option value="香港">香港特别行政区</option>
|
||||||
|
<option value="澳门">澳门特别行政区</option>
|
||||||
|
<option value="台湾">台湾</option>
|
||||||
|
<option value="海外">海外</option>
|
||||||
|
</select>
|
||||||
|
<select name="city" id="schoolCity" class="winbox_select fl ml5" style="height:28px;"></select>
|
||||||
|
<span class="ml2" id="provincenotice" style="color:red;" display="none"></span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="fl"><span class="c_red mr5">*</span>详细地址:</label><input id="address" type="text" class="winbox_input fl" />
|
||||||
|
<span class="ml2" id="addressnotice" style="color:red;" display="none"></span>
|
||||||
|
</li>
|
||||||
|
<li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<li><label class="fl"> </label><button class="fl winbox_btn_blue mt10" onclick = "commit_add_school();">确定</button></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function commit_add_school(){
|
||||||
|
var name,province,city,address,remarks;
|
||||||
|
|
||||||
|
name = $("#schoolname").val();
|
||||||
|
province = $("#schollProvince").val();
|
||||||
|
address = $("#address").val();
|
||||||
|
|
||||||
|
if(name == ""){
|
||||||
|
$("#schoolname").focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if($("#schoolrepeatnotice").attr("value") == "1"){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(province == ""){
|
||||||
|
$("#provincenotice").text("请选择");
|
||||||
|
$("#provincenotice").show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
city = $("#schoolCity").val();
|
||||||
|
if(city == ""){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(address == ""){
|
||||||
|
$("#address").focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
remarks = $("#remarks").val();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/school/apply_add_school',
|
||||||
|
type: 'get',
|
||||||
|
data: {name:name,province:province,city:city,address:address,remarks:remarks},
|
||||||
|
success: function(data){
|
||||||
|
if(data.result == 0){
|
||||||
|
$("input[name='province']").val(data.name);
|
||||||
|
$("input[name='occupation']").val(data.school_id);
|
||||||
|
|
||||||
|
var htmlvalue = "</br><div style='width:550px;text-align:center'>添加成功!您可以继续使用了。</div></br><div style='width:550px;text-align:center'>后续我们将对您的高校(单位)进行审核,如有问题我们再联系您。</div></br><div style='width:67px; margin:0 auto; text-align:center'></div>";
|
||||||
|
pop_up_box(htmlvalue,500,30,50);
|
||||||
|
}
|
||||||
|
else if (data.result == 1){
|
||||||
|
}
|
||||||
|
else if (data.result == 2){
|
||||||
|
$("#schoolrepeatnotice").text("名称已存在");
|
||||||
|
$("#schoolrepeatnotice").show();
|
||||||
|
$("#schoolrepeatnotice").attr("value",1);
|
||||||
|
$("#schoolrepeatnotice").attr("style","color:red");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showcity(province, cityField) {
|
||||||
|
$("#provincenotice").hide();
|
||||||
|
switch (province) {
|
||||||
|
case "北京" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
|
||||||
|
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
|
||||||
|
break;
|
||||||
|
case "上海" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
|
||||||
|
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
|
||||||
|
break;
|
||||||
|
case "广东" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
|
||||||
|
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
|
||||||
|
break;
|
||||||
|
case "江苏" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
|
||||||
|
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
|
||||||
|
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
|
||||||
|
break;
|
||||||
|
case "重庆" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
|
||||||
|
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
|
||||||
|
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
|
||||||
|
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
|
||||||
|
break;
|
||||||
|
case "安徽" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
|
||||||
|
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
|
||||||
|
break;
|
||||||
|
case "福建" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
|
||||||
|
break;
|
||||||
|
case "甘肃" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
|
||||||
|
"武都", "武威", "西峰", "张掖");
|
||||||
|
break;
|
||||||
|
case "广西" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
|
||||||
|
break;
|
||||||
|
case "贵州" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
|
||||||
|
break;
|
||||||
|
case "海南" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
|
||||||
|
break;
|
||||||
|
case "河北" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
|
||||||
|
"唐山", "新城", "邢台", "张家口");
|
||||||
|
break;
|
||||||
|
case "黑龙江" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
|
||||||
|
"七台河", "双鸭山", "绥化", "伊春");
|
||||||
|
break;
|
||||||
|
case "河南" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
|
||||||
|
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
|
||||||
|
break;
|
||||||
|
case "香港" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"香港", "九龙", "新界");
|
||||||
|
break;
|
||||||
|
case "湖北" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
|
||||||
|
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
|
||||||
|
break;
|
||||||
|
case "湖南" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
|
||||||
|
"永州", "张家界", "株洲");
|
||||||
|
break;
|
||||||
|
case "江西" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
|
||||||
|
"上饶", "新余", "宜春", "鹰潭");
|
||||||
|
break;
|
||||||
|
case "吉林" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
|
||||||
|
break;
|
||||||
|
case "辽宁" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
|
||||||
|
"辽阳", "盘锦", "铁岭", "营口");
|
||||||
|
break;
|
||||||
|
case "澳门" :
|
||||||
|
var cityOptions = new Array("澳门");
|
||||||
|
break;
|
||||||
|
case "内蒙古" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
|
||||||
|
"乌兰浩特", "锡林浩特");
|
||||||
|
break;
|
||||||
|
case "宁夏" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"银川", "固源", "石嘴山", "吴忠");
|
||||||
|
break;
|
||||||
|
case "青海" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
|
||||||
|
break;
|
||||||
|
case "山东" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
|
||||||
|
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
|
||||||
|
break;
|
||||||
|
case "山西" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
|
||||||
|
"阳泉", "榆次", "运城");
|
||||||
|
break;
|
||||||
|
case "陕西" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
|
||||||
|
break;
|
||||||
|
case "四川" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
|
||||||
|
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
|
||||||
|
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
|
||||||
|
break;
|
||||||
|
case "台湾" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
|
||||||
|
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
|
||||||
|
break;
|
||||||
|
case "天津" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
|
||||||
|
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
|
||||||
|
break;
|
||||||
|
case "新疆" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
|
||||||
|
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
|
||||||
|
break;
|
||||||
|
case "西藏" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
|
||||||
|
break;
|
||||||
|
case "云南" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
|
||||||
|
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
|
||||||
|
break;
|
||||||
|
case "浙江" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
|
||||||
|
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
|
||||||
|
"台州", "温岭", "温州", "余姚", "舟山");
|
||||||
|
break;
|
||||||
|
case "海外" :
|
||||||
|
var cityOptions = new Array(
|
||||||
|
"美国", "日本", "英国", "法国", "德国", "其他");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
var cityOptions = new Array("");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cityField.options.length = 0;
|
||||||
|
for (var i = 0; i < cityOptions.length; i++) {
|
||||||
|
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
|
||||||
|
/*
|
||||||
|
if (cityField.options[i].value==city)
|
||||||
|
{
|
||||||
|
//alert("here put City ok!");
|
||||||
|
document.oblogform["city"].selectedIndex = i;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ifNameRepeat(){
|
||||||
|
|
||||||
|
//名称不能为空也不能重复
|
||||||
|
if($("#schoolname").val() == ""){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/school/search_repeat_schoolname',
|
||||||
|
type: 'get',
|
||||||
|
data: {name:$("#schoolname").val()},
|
||||||
|
success: function(data){
|
||||||
|
if (data == 1){
|
||||||
|
$("#schoolrepeatnotice").text("名称已存在");
|
||||||
|
$("#schoolrepeatnotice").show();
|
||||||
|
$("#schoolrepeatnotice").attr("value",1);
|
||||||
|
$("#schoolrepeatnotice").attr("style","color:red");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#schoolrepeatnotice").text("可用");
|
||||||
|
$("#schoolrepeatnotice").show();
|
||||||
|
$("#schoolrepeatnotice").attr("value",0);
|
||||||
|
$("#schoolrepeatnotice").attr("style","color:green");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -15,14 +15,13 @@
|
||||||
<%= error_messages_for 'user',@user.user_extensions %>
|
<%= error_messages_for 'user',@user.user_extensions %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<ul class="setting_left">
|
<ul class="setting_left">
|
||||||
<li>登录名 : <span style="color:red;">*</span></li>
|
<li><span style="color:red;">*</span> 登录名 : </li>
|
||||||
<li>邮箱 : <span style="color:red;">*</span></li>
|
<li><span style="color:red;">*</span> 邮箱 : </li>
|
||||||
<li>身份 : <span style="color:red;">*</span></li>
|
<li><span style="color:red;">*</span> 职业 : </li>
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓(Last Name) : <span style="color:red;">*</span></li>
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span> 姓名 : </li>
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名(First Name) : <span style="color:red;">*</span></li>
|
|
||||||
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名 : <span style="color:red;">*</span></li>
|
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名 : <span style="color:red;">*</span></li>
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">性别 : </li>
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span> 性别 : </li>
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">工作单位 : </li>
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;" ><span style="color:red;">*</span> 单位名称 : </li>
|
||||||
<li>地区 : </li>
|
<li>地区 : </li>
|
||||||
<li>邮件通知 : </li>
|
<li>邮件通知 : </li>
|
||||||
<!--<li>个人签名 : </li>-->
|
<!--<li>个人签名 : </li>-->
|
||||||
|
@ -65,33 +64,49 @@
|
||||||
<span id="identity_hint" style="display: none"></span>
|
<span id="identity_hint" style="display: none"></span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
||||||
<li nhname="tag" nh_tag_2="true" style="display:none;"><%= text_field_tag :enterprise_name,@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
||||||
<select class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
|
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
|
||||||
|
<input type="radio" id="sex" value="0" name="sex" class="fl "><label class="fl mr10">男</label> <input type="radio" id="sex" value="1" name="sex" checked="checked" class="fl "><label class="fl ">女</label>
|
||||||
|
<% else %>
|
||||||
|
<input type="radio" id="sex" value="0" name="sex" checked="checked" class="fl "><label class="fl mr10">男</label> <input type="radio" id="sex" value="1" name="sex" class="fl "><label class="fl ">女</label>
|
||||||
|
<% end %>
|
||||||
|
<select style = "display: none;" class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
||||||
<% if User.current.user_extensions.nil? %>
|
<% if User.current.user_extensions.nil? %>
|
||||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||||
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" />
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
|
||||||
|
<p class="fl ml10">
|
||||||
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||||
|
</p>
|
||||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||||
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
|
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
|
||||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||||
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
||||||
|
<p class="fl ml10">
|
||||||
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||||
|
</p>
|
||||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||||
<% elsif User.current.user_extensions.school.nil? %>
|
<% elsif User.current.user_extensions.school.nil? %>
|
||||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
||||||
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" />
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
|
||||||
|
<p class="fl ml10">
|
||||||
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||||
|
</p>
|
||||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
||||||
<% else %>
|
<% else %>
|
||||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" value="<%= User.current.user_extensions.school %>" />
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" />
|
||||||
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
||||||
|
<p class="fl ml10">
|
||||||
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
||||||
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
||||||
|
</p>
|
||||||
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
|
@ -140,13 +155,13 @@
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
|
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
|
||||||
<label>不要发送对我自己提交的修改的通知<%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %></label>
|
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %>不要发送对我自己提交的修改的通知</label>
|
||||||
</li>
|
</li>
|
||||||
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>-->
|
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>-->
|
||||||
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
|
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
|
||||||
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
|
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
|
||||||
<li class="ml2">
|
<li class="ml2">
|
||||||
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl">确认</a>
|
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" style="background: #3b94d6; padding: 0 25px;">确定</a>
|
||||||
<input type="submit" id="my_account_form_btn" style="display:none;"/>
|
<input type="submit" id="my_account_form_btn" style="display:none;"/>
|
||||||
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
|
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
|
||||||
</li>
|
</li>
|
||||||
|
@ -429,6 +444,7 @@
|
||||||
$("*[nh_required='1']",$(this)).attr("required",true);
|
$("*[nh_required='1']",$(this)).attr("required",true);
|
||||||
$(this).show()
|
$(this).show()
|
||||||
});
|
});
|
||||||
|
$("#identity_hint").hide();
|
||||||
}
|
}
|
||||||
function init_identity_and_title(pField, identity, cField, title, language) {
|
function init_identity_and_title(pField, identity, cField, title, language) {
|
||||||
for (var i = 0; i < pField.options.length; i++) {
|
for (var i = 0; i < pField.options.length; i++) {
|
||||||
|
@ -533,6 +549,14 @@
|
||||||
$("input[name='occupation']").val(data);
|
$("input[name='occupation']").val(data);
|
||||||
$("#search_school_result_list").hide();
|
$("#search_school_result_list").hide();
|
||||||
$("#hint").hide();
|
$("#hint").hide();
|
||||||
|
$("#errortip").hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function apply_add_school(){
|
||||||
|
var htmlvalue = "<%= escape_javascript( render :partial => 'my/apply_add_school' )%>";
|
||||||
|
pop_up_box(htmlvalue,580,20,48);
|
||||||
|
|
||||||
}
|
}
|
||||||
function add_school(name){
|
function add_school(name){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -619,16 +643,19 @@
|
||||||
$("#search_school_result_list").show();
|
$("#search_school_result_list").show();
|
||||||
if($(e.target).val().trim() != '') {
|
if($(e.target).val().trim() != '') {
|
||||||
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
||||||
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校');
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校(单位)');
|
||||||
$("#hint").show();
|
$("#hint").show();
|
||||||
|
$("#errortip").hide();
|
||||||
}else{
|
}else{
|
||||||
$("#hint").hide();
|
$("#hint").hide();
|
||||||
|
$("#errortip").hide();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$("#search_school_result_list").html('');
|
$("#search_school_result_list").html('');
|
||||||
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
||||||
$("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
|
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
||||||
$("#hint").show();
|
$("#hint").show();
|
||||||
|
$("#errortip").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -638,6 +665,7 @@
|
||||||
{
|
{
|
||||||
$("#search_school_result_list").hide();
|
$("#search_school_result_list").hide();
|
||||||
$("#hint").hide();
|
$("#hint").hide();
|
||||||
|
$("#errortip").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("input[name='province']").on('focus', function (e) {
|
$("input[name='province']").on('focus', function (e) {
|
||||||
|
@ -665,16 +693,19 @@
|
||||||
$("#search_school_result_list").show();
|
$("#search_school_result_list").show();
|
||||||
if($(e.target).val().trim() != '') {
|
if($(e.target).val().trim() != '') {
|
||||||
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
||||||
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校');
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校(单位)');
|
||||||
$("#hint").show();
|
$("#hint").show();
|
||||||
|
$("#errortip").hide();
|
||||||
}else{
|
}else{
|
||||||
$("#hint").hide();
|
$("#hint").hide();
|
||||||
|
$("#errortip").hide();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$("#search_school_result_list").html('');
|
$("#search_school_result_list").html('');
|
||||||
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
||||||
$("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
|
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
||||||
$("#hint").show();
|
$("#hint").show();
|
||||||
|
$("#errortip").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -702,19 +733,41 @@
|
||||||
<% if( !@act.nil? && @act == 'password') %>
|
<% if( !@act.nil? && @act == 'password') %>
|
||||||
$("#users_tb_2").click();
|
$("#users_tb_2").click();
|
||||||
<% end %>
|
<% end %>
|
||||||
$('#my_account_form_link').click(function(e){
|
|
||||||
|
$('#my_account_form_link').on("click",(function(e){
|
||||||
|
//$('#my_account_form_link').click(function(e){
|
||||||
if($("#userIdentity").val() == -1 ) {
|
if($("#userIdentity").val() == -1 ) {
|
||||||
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
|
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
|
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
|
||||||
$("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show();
|
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//姓名不能为空
|
||||||
|
if( $("#lastname").val() == '' ){
|
||||||
|
$("#lastname").focus();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
|
||||||
|
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($("#no").is(":visible") == true && $("#no").val() == ""){
|
||||||
|
$("#no").focus();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$('#my_account_form_btn').click();
|
$('#my_account_form_btn').click();
|
||||||
});
|
}));
|
||||||
$('#my_password_form_link').click(function(){
|
$('#my_password_form_link').click(function(){
|
||||||
$('#my_password_form_btn').click();
|
$('#my_password_form_btn').click();
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,12 +24,12 @@
|
||||||
<body>
|
<body>
|
||||||
<!--<div class="resourceSharePopup">-->
|
<!--<div class="resourceSharePopup">-->
|
||||||
<div>
|
<div>
|
||||||
<div class="relateText">请选择关联到组织的课程</div>
|
<div class="relateText">请选择关联到组织的班级</div>
|
||||||
<div class="c_red">您的私有课程不能被关联到组织</div>
|
<div class="c_red">您的私有班级不能被关联到组织</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
||||||
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" />
|
<input type="text" name="courses" placeholder="搜索您已加入的班级的名称" class="searchCourse" />
|
||||||
<div id="search_courses_result_list" class="mb8 maxHeight100" style="overflow:auto;"></div>
|
<div id="search_courses_result_list" class="mb8 maxHeight100" style="overflow:auto;"></div>
|
||||||
<div class="courseSendSubmit">
|
<div class="courseSendSubmit">
|
||||||
<a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a>
|
<a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<% if is_default_field?(field) %>
|
<% if is_default_field?(field) %>
|
||||||
<% case field.name %>
|
<% case field.name %>
|
||||||
<% when 'course' %>
|
<% when 'course' %>
|
||||||
<h2 class="por_h2_index clear">课程动态</h2>
|
<h2 class="por_h2_index clear">班级动态</h2>
|
||||||
<% if @course_acts.blank? %>
|
<% if @course_acts.blank? %>
|
||||||
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
|
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -63,9 +63,9 @@
|
||||||
<% when 'course' %>
|
<% when 'course' %>
|
||||||
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
<div style="display:<%= field.hide == 0 ? 'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||||
<div class="homepageLeftMenuBlock">
|
<div class="homepageLeftMenuBlock">
|
||||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">班级</a>
|
||||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||||
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联班级"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||||
|
|
|
@ -55,6 +55,12 @@
|
||||||
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
|
<%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<!--quality_analysis-->
|
||||||
|
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
|
||||||
|
<div class="subNav">
|
||||||
|
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "f14 c_blue02" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- more -->
|
<!-- more -->
|
||||||
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
var last_name = $.trim($('#last_name').val());
|
var last_name = $.trim($('#last_name').val());
|
||||||
if(last_name.length > 30)
|
if(last_name.length > 30)
|
||||||
{
|
{
|
||||||
$("#valid_email").text("用户姓氏过长,最长为30个字符");
|
$("#valid_email").text("用户姓名过长,最长为30个字符");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<%= javascript_include_tag 'highcharts','highcharts-more' %>
|
||||||
|
<div class="project_r_h">
|
||||||
|
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<%=h @console_build %>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<div class="f16 fb fontBlue mb10">代码质量分析</div>
|
||||||
|
<div>
|
||||||
|
<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'update_jenkins_job', :project_id => @project.id), :id => 'quality_analyses_edit_form') do %>
|
||||||
|
<div class="ui form">
|
||||||
|
<div class="mb10" style="margin-right:13px;">
|
||||||
|
<textarea id="path_description" name="path" rows="8" style="height: 87px; resize:vertical;" class="analysis-option-box"><%= @quality_analysis.path %></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="mb10">
|
||||||
|
<div>
|
||||||
|
<%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @quality_analysis.branch), :value => 77, :id => 'branch', :class => "analysis-option-box" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb10">
|
||||||
|
<div>
|
||||||
|
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div>
|
||||||
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -94,7 +94,7 @@
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
name: '代码质量',
|
name: '代码质量',
|
||||||
data: [<%= @complexity["msr"][9]["val"] %>]
|
data: [<%= @complexity["msr"][9].nil? ? 0 : @complexity["msr"][9]["val"] %>]
|
||||||
// tooltip: {
|
// tooltip: {
|
||||||
// valueSuffix: ' km/h'
|
// valueSuffix: ' km/h'
|
||||||
// }
|
// }
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
name: '复杂度',
|
name: '复杂度',
|
||||||
data: [<%= @complexity["msr"][6]["val"] %>]
|
data: [<%= @complexity["msr"][6].nil? ? 0 : @complexity["msr"][6]["val"] %>]
|
||||||
// tooltip: {
|
// tooltip: {
|
||||||
// valueSuffix: ' km/h'
|
// valueSuffix: ' km/h'
|
||||||
// }
|
// }
|
||||||
|
@ -329,7 +329,7 @@
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
name: '重复率',
|
name: '重复率',
|
||||||
data: [<%= @complexity["msr"][7]["val"] %>]
|
data: [<%= @complexity["msr"][7].nil? ? 0 : @complexity["msr"][7]["val"] %>]
|
||||||
// tooltip: {
|
// tooltip: {
|
||||||
// valueSuffix: ' km/h'
|
// valueSuffix: ' km/h'
|
||||||
// }
|
// }
|
||||||
|
@ -454,7 +454,7 @@
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
name: '质量等级',
|
name: '质量等级',
|
||||||
data: [<%= @complexity["msr"][5]["val"] %>]
|
data: [<%= @complexity["msr"][5].nil? ? 0 : @complexity["msr"][5]["val"] %>]
|
||||||
// tooltip: {
|
// tooltip: {
|
||||||
// valueSuffix: ' km/h'
|
// valueSuffix: ' km/h'
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -1,22 +1,33 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
// $("#ajax-indicator span").text("载入中...");
|
||||||
|
$("#ajax-indicator").show();
|
||||||
|
</script>
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2">分析结果</h2>
|
<h2 class="project_h2">分析结果</h2>
|
||||||
</div>
|
</div>
|
||||||
<ul class="analysis-result-list">
|
<ul class="analysis-result-list">
|
||||||
<li class="analysis-result-name fl fontBlue2" >名称</li>
|
<li class="analysis-result-name fl fontBlue2" >名称</li>
|
||||||
<li class="analysis-result-version fl fontBlue2" >版本</li>
|
<li class="analysis-result-version fl fontBlue2" >分支</li>
|
||||||
<li class="analysis-result-loc fl fontBlue2" >分支</li>
|
<li class="analysis-result-loc fl fontBlue2" >语言</li>
|
||||||
<li class="analysis-result-debt 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" >编辑</li>
|
||||||
|
<!--<li class="analysis-result-time fl fontBlue2" >bianji</li>-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<% if @quality_analyses.count >0 %>
|
<% if @quality_analyses.count >0 %>
|
||||||
<% @quality_analyses.each do |qa| %>
|
<% @quality_analyses.each do |qa| %>
|
||||||
<ul class="analysis-result-list">
|
<ul class="analysis-result-list">
|
||||||
<li title="Name" title="名称"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.author_login+":"+qa.rep_identifier, :branch => qa.branch.nil? ? "master" : qa.branch), :class => "analysis-result-name fl fontBlue2" %></li>
|
<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" %></li>
|
||||||
<li class="analysis-result-version fl fontBlue2" title="版本">1.0</li>
|
<li class="analysis-result-version fl fontBlue2" title="分支名"><%= qa.branch %></li>
|
||||||
<li class="analysis-result-loc fl fontBlue2" title="分支名"><%= qa.branch %></li>
|
<li class="analysis-result-loc fl fontBlue2" title="语言"><%= qa.language %></li>
|
||||||
<li class="analysis-result-debt fl fontBlue2" title="语言"><%= qa.language %></li>
|
<li class="analysis-result-debt fl fontBlue2" title="时间"><%= qa.path %></li>
|
||||||
<li class="analysis-result-time fl fontBlue2" title="时间"><%= format_time(qa.created_at) %></li>
|
<% if User.current.try(:login) == qa.author_login %>
|
||||||
|
<li class="analysis-result-time fl" title="编辑">
|
||||||
|
<%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li class="analysis-result-time fl" style="color: #888" title="编辑">编辑</li>
|
||||||
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<%= javascript_include_tag 'highcharts','highcharts-more' %>
|
<%= javascript_include_tag 'highcharts','highcharts-more' %>
|
||||||
<%= render :partial => "hightchars" %>
|
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,66 +6,86 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>
|
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>
|
||||||
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">概要信息</span></div>
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">概要信息</span></div>
|
||||||
|
<% if @complexity["msr"].count > 3 %>
|
||||||
|
<%= render :partial => "hightchars" %>
|
||||||
<div class="analysis-block mt10 mb40 f14">
|
<div class="analysis-block mt10 mb40 f14">
|
||||||
<div class="flex">
|
<div class="flex mb10">
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p id="container_sqale_rating" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
<p id="container_sqale_rating" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
||||||
<p class="fontGrey3">质量等级</p>
|
<p class="fontGrey3">质量等级</p>
|
||||||
<p class="fontBlue2 pr"><%= @complexity["msr"][9]["frmt_val"] %><span class="f8 c_white analysis-genral-icon <%= sqale_rating_status(@complexity["msr"][9]["val"])[1] %> borderRadius"><%= sqale_rating_status(@complexity["msr"][9]["val"])[0] %></span></p>
|
<p class="fontBlue2 pr"><%= @complexity["msr"][9].nil? ? "A" : @complexity["msr"][9]["frmt_val"] %>
|
||||||
|
<span class="f10 c_white analysis-genral-icon <%=@complexity["msr"][9].nil? ? "" : sqale_rating_status(@complexity["msr"][9]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][9].blank? ? "很好" : sqale_rating_status(@complexity["msr"][9]["val"].to_i)[0] %></span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral" >
|
<div class="analysis-genral" >
|
||||||
<p id="container_function_complexity" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
<p id="container_function_complexity" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
||||||
<p class="fontGrey3">复杂度</p>
|
<p class="fontGrey3">复杂度</p>
|
||||||
<p class="fontBlue2 pr"><%= @complexity["msr"][6]["val"] %><span class="f8 c_white analysis-genral-icon <%= complexity_status(@complexity["msr"][6]["val"])[1] %> borderRadius"><%= complexity_status(@complexity["msr"][6]["val"])[0] %></span></p>
|
<p class="fontBlue2 pr"><%= @complexity["msr"][6].nil? ? 0 : @complexity["msr"][6]["val"] %>
|
||||||
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][6].nil? ? "" : complexity_status(@complexity["msr"][6]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][6].nil? ? 0 : complexity_status(@complexity["msr"][6]["val"].to_i)[0] %></span></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p id="container_duplicated_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
<p id="container_duplicated_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
||||||
<p class="fontGrey3">代码重复度</p>
|
<p class="fontGrey3">代码重复度</p>
|
||||||
<p class="fontBlue2 pr"><%= @complexity["msr"][7]["frmt_val"] %><span class="f8 c_white analysis-genral-icon <%= duplicated_lines_density_status(@complexity["msr"][7]["val"])[1] %> borderRadius"><%= duplicated_lines_density_status(@complexity["msr"][7]["val"])[0] %></span></p>
|
<p class="fontBlue2 pr"><%= @complexity["msr"][7].nil? ? 0 : @complexity["msr"][7]["frmt_val"] %>
|
||||||
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][7].nil? ? "" : duplicated_lines_density_status(@complexity["msr"][7]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][7].nil? ? 0 : duplicated_lines_density_status(@complexity["msr"][7]["val"].to_i)[0] %></span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p id="container_comment_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
<p id="container_comment_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
||||||
<p class="fontGrey3">注释率</p>
|
<p class="fontGrey3">注释率</p>
|
||||||
<p class="fontBlue2 pr"><%= @complexity["msr"][5]["frmt_val"] %><span class="f8 c_white analysis-genral-icon <%= comment_lines_density_status(@complexity["msr"][5]["val"])[1] %> borderRadius"><%=comment_lines_density_status(@complexity["msr"][5]["val"])[0] %></span></p>
|
<p class="fontBlue2 pr"><%= @complexity["msr"][5].nil? ? 0 : @complexity["msr"][5]["frmt_val"] %>
|
||||||
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][5].nil? ? "" : comment_lines_density_status(@complexity["msr"][5]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][5].nil? ? 0 : comment_lines_density_status(@complexity["msr"][5]["val"].to_i)[0] %></span></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">质量等级</span><span class="mr10 fontGrey2"><span class="c_red f18" style="margin-top:-5px; display:inline-block;"><%= score_sqale_rating(@complexity["msr"][9]["val"]) %></span>/5分</span><span class="fontGrey2">可定性评价为:<span class="c_red">质量<%= sqale_rating_status(@complexity["msr"][9]["val"])[0] %></span></span></div>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">质量等级</span><span class="mr10 fontGrey2"><span class="c_red f18" style="margin-top:-5px; display:inline-block;"><%=@complexity["msr"][9].nil? ? 0 : score_sqale_rating(@complexity["msr"][9]["val"].to_i) %></span>/5分</span>
|
||||||
|
<span class="fontGrey2">可定性评价为:<span class="c_red">质量<%=@complexity["msr"][9].nil? ? "很好" : sqale_rating_status(@complexity["msr"][9]["val"])[0] %></span></span></div>
|
||||||
<div class="analysis-block mt10 mb40 f14">
|
<div class="analysis-block mt10 mb40 f14">
|
||||||
<div><span class="fontGrey3 mr30">技术债务</span><span class="fontBlue2 w70 pInline"><%= @complexity["msr"][8]["frmt_val"] %></span><span class="fontGrey2"><a target="_blank" href="<%= @sonar_address %>/drilldown/measures/<%= @resource_id %>?metric=sqale_index">查看详情</a></span></div>
|
<div><span class="fontGrey3 mr30">技术债务</span><span class="w70 pInline"><%=@complexity["msr"][8].nil? ? 0 : @complexity["msr"][8]["frmt_val"] %></span>
|
||||||
<div><span class="fontGrey3 mr30">质量问题</span>
|
<span class="fontGrey2"><a class="linkBlue2" target="_blank" href="<%= @sonar_address %>/drilldown/measures/<%= @resource_id %>?metric=sqale_index">查看详情</a></span></div>
|
||||||
<span class="fontBlue2 w70 pInline"><a class="fontBlue2 w70 pInline" target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false"><%= @sonar_issues["msr"][0]["frmt_val"] %></a></span><span class="fontGrey2">问题分类如下:</span></div>
|
<div><span class="fontGrey3 mr30 fl">质量问题</span>
|
||||||
|
<span class="fontBlue2 w70 pInline"><a class="fontBlue2 w70 pInline" target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false"><%=@sonar_issues["msr"][0].nil? ? 0 : @sonar_issues["msr"][0]["frmt_val"] %></a></span><span class="fontGrey2"> 问题分类如下:</span></div>
|
||||||
<div class="ml90 mt15">
|
<div class="ml90 mt15">
|
||||||
<div class="mb10"><span class="analysis-block-icon mr5"></span><span class="fontGrey3 mr45">阻断</span><span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][1]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= statistics_result_percentage(@sonar_issues["msr"][1]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
<div class="mb10"><span class="analysis-block-icon mr5"></span><span class="fontGrey3 mr45">阻断</span>
|
||||||
<div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span><span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][2]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= statistics_result_percentage(@sonar_issues["msr"][2]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=BLOCKER" class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][1].nil? ? 0 : @sonar_issues["msr"][1]["frmt_val"] %></a>
|
||||||
<div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span><span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][3]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= statistics_result_percentage(@sonar_issues["msr"][3]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][1].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][1]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
||||||
<div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span><span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][4]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= statistics_result_percentage(@sonar_issues["msr"][4]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
<div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span>
|
||||||
<div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span><span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][5]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= statistics_result_percentage(@sonar_issues["msr"][5]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=CRITICAL" class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][2].nil? ? 0 : @sonar_issues["msr"][2]["frmt_val"] %></a>
|
||||||
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][2].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][2]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
||||||
|
<div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span>
|
||||||
|
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MAJOR" class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][3].nil? ? 0 : @sonar_issues["msr"][3]["frmt_val"] %></a>
|
||||||
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][3].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][3]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
||||||
|
<div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span>
|
||||||
|
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MINOR" class="fontBlue2 w70 pInline"><%=@sonar_issues["msr"][4].nil? ? 0 : @sonar_issues["msr"][4]["frmt_val"] %></a>
|
||||||
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][4].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][4]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
||||||
|
<div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span>
|
||||||
|
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=INFO" class="fontBlue2 w70 pInline"><%=@sonar_issues["msr"][5].nil? ? 0 : @sonar_issues["msr"][5]["frmt_val"] %></a>
|
||||||
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][5].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][5]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">代码规模</span><span class="fontGrey2">可定性评价为:<span class="c_red"><%= lines_scale(@complexity["msr"][0]["frmt_val"]) %></span></span></div>
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">代码规模</span><span class="fontGrey2">可定性评价为:<span class="c_red"><%=@complexity["msr"][0].nil? ? 0 : lines_scale(@complexity["msr"][0]["frmt_val"].to_i) %></span></span></div>
|
||||||
<div class="analysis-block mt10 mb40 flex f14">
|
<div class="analysis-block mt10 mb40 flex f14">
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p class="fontGrey3">代码行数</p>
|
<p class="fontGrey3">代码行数</p>
|
||||||
<p class="fontBlue2"><%= @complexity["msr"][0]["frmt_val"] %></p>
|
<p class="fontBlue2"><%= @complexity["msr"][0].nil? ? 0 : @complexity["msr"][0]["frmt_val"] %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p class="fontGrey3">文件</p>
|
<p class="fontGrey3">文件</p>
|
||||||
<p class="fontBlue2"><%= @complexity["msr"][2]["frmt_val"] %></p>
|
<p class="fontBlue2"><%= @complexity["msr"][2].nil? ? 0 : @complexity["msr"][2]["frmt_val"] %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p class="fontGrey3">目录</p>
|
<p class="fontGrey3">目录</p>
|
||||||
<p class="fontBlue2"><%= @complexity["msr"][3]["frmt_val"] %></p>
|
<p class="fontBlue2"><%= @complexity["msr"][3].nil? ? 0 : @complexity["msr"][3]["frmt_val"] %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p class="fontGrey3">类</p>
|
<p class="fontGrey3">类</p>
|
||||||
<p class="fontBlue2"><%= @complexity["msr"][1]["frmt_val"] %></p>
|
<p class="fontBlue2"><%= @complexity["msr"][1].nil? ? 0 : @complexity["msr"][1]["frmt_val"] %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="analysis-genral">
|
<div class="analysis-genral">
|
||||||
<p class="fontGrey3">方法</p>
|
<p class="fontGrey3">方法</p>
|
||||||
<p class="fontBlue2"><%= @complexity["msr"][4]["frmt_val"] %></p>
|
<p class="fontBlue2"><%=@complexity["msr"][4].nil? ? 0 : @complexity["msr"][4]["frmt_val"] %></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>-->
|
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>-->
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<% if @current_build_status == "success" %>
|
||||||
|
<%= render :partial => "show", :locals => {:branch => params[:branch]} %>
|
||||||
|
<% else %>
|
||||||
|
<% if @build_console_result %>
|
||||||
|
运行结果超时
|
||||||
|
<% else %>
|
||||||
|
<%= render :partial => "console_output" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
|
@ -0,0 +1,11 @@
|
||||||
|
$("#ajax-indicator").hide();
|
||||||
|
<% if @current_build_status == "success" %>
|
||||||
|
<%= escape_javascript( render :partial => 'quality_analysis/show', :locals => {:branch => branch}) %>
|
||||||
|
<% elsif @current_build_status == "failure" %>
|
||||||
|
<%=h @console_build.html_safe %>
|
||||||
|
<% elsif @current_build_status == "not_run" %>
|
||||||
|
alert('任务启动失败');
|
||||||
|
<% else %>
|
||||||
|
alert('你已经创建类一个同名job');
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'quality_analysis/edit', :locals => {}) %>');
|
||||||
|
showModal('ajax-modal', '615px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 580px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","20%").css("left","32%").css("border","3px solid #269ac9");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<% if @name_flag %>
|
<% if @name_flag %>
|
||||||
<%= render :partial => "result_list" %>
|
<%= render :partial => "result_list" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render "show" %>
|
<% if params[:current_build_status].nil? || params[:current_build_status] == "success" %>
|
||||||
|
<%= render :partial => "show", :locals => {:branch => @branch} %>
|
||||||
|
<% else %>
|
||||||
|
<% if params[:build_console_result] %>
|
||||||
|
运行结果超时
|
||||||
|
<% else %>
|
||||||
|
<%= render :partial => "console_output" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<div class="f16 fb fontBlue mb10">代码质量分析</div>
|
<div class="f16 fb fontBlue mb10">代码质量分析</div>
|
||||||
<div>
|
<div>
|
||||||
<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier), :remote => true, :id => 'quality_analyses_form') do %>
|
<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier, :rep_id => @repository.id), :id => 'quality_analyses_form') do %>
|
||||||
<div class="ui form">
|
<div class="ui form">
|
||||||
<div class="mb10" style="margin-right:13px;">
|
<div class="mb10" style="margin-right:13px;">
|
||||||
<textarea id="path_description" name="path" rows="8" placeholder="目录相对于根目录,用半角逗号隔开。如:src/main/java,libs,res/script" style="height: 87px; resize:vertical;" class="analysis-option-box"></textarea>
|
<textarea id="path_description" name="path" rows="8" placeholder="目录相对于根目录,不填写则扫描根目录,用半角逗号隔开。如:src/main/java,libs,res/script" style="height: 87px; resize:vertical;" class="analysis-option-box"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb10">
|
<div class="mb10">
|
||||||
<div>
|
<div>
|
||||||
|
@ -12,10 +12,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="mb10">
|
<div class="mb10">
|
||||||
<div>
|
<div>
|
||||||
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#", "Web"]), :id => 'branch', :class => "analysis-option-box" %>
|
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_form').submit();hideModal()">提交</a></div>
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').text('正在分析中…………(大概需要30分钟,请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div>
|
||||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a></div>
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
||||||
|
<% unless @entries.nil? %>
|
||||||
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
|
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
|
||||||
<%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
|
<%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
|
||||||
<%# if User.current.member_of?(@project) %>
|
<%# if User.current.member_of?(@project) %>
|
||||||
<%#= link_to "质量分析", quality_analysis_path(:id => @project.id), :remote => true, :class => "btn_zipdown fr" %>
|
<% if quality_analysis(User.current.try(:login), @repository.id).nil? && User.current.member_of?(@project) && @project.is_public? %>
|
||||||
|
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %>
|
||||||
|
<% end %>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<%# else %>
|
<%# else %>
|
||||||
<%#= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id, :resource_id => @proje), :class => "btn_zipdown fr" %>
|
<%#= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id, :resource_id => @proje), :class => "btn_zipdown fr" %>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="repository_con" style="line-height:1.9;">
|
<div class="repository_con" style="line-height:1.9;">
|
||||||
<% if @entries.nil? %>
|
<% if @entries.nil? %>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<%= link_to "", {:controller => 'syllabuses', :action => 'syllabus_courselist', :id =>@syllabus, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
<%= link_to "", {:controller => 'syllabuses', :action => 'syllabus_courselist', :id =>@syllabus, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<p class="fr grayTxt">创建老师:<%=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%=format_date @syllabus.created_at %></p>
|
<!-- <p class="fr grayTxt">创建老师:<%=@syllabus.user.show_name %><span class="mr10 "></span> 创建时间:<%=format_date @syllabus.created_at %></p> -->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
<li>
|
<li>
|
||||||
<span class="item_list fl"></span>
|
<span class="item_list fl"></span>
|
||||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||||
<span class="fr grayTxt">
|
<span class="fr grayTxt">
|
||||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<div class="orig_user fl">
|
<div class="orig_user fl">
|
||||||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="orig_right fl">
|
<div class="orig_right fl">
|
||||||
<%= link_to comment.user.show_name, user_path(comment.user_id), :class => "content-username" %>
|
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
|
||||||
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
||||||
<div class="orig_content "><%= comment.notes.html_safe %></div>
|
<div class="orig_content "><%= comment.content_detail.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
|
@ -46,12 +46,8 @@
|
||||||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||||
</span>
|
</span>
|
||||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||||
<% count=0 %>
|
<% all_comments = []%>
|
||||||
<% if activity.parent %>
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
<% count=activity.parent.children.count%>
|
|
||||||
<% else %>
|
|
||||||
<% count=activity.children.count%>
|
|
||||||
<% end %>
|
|
||||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -78,20 +78,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count=0 %>
|
<% all_comments = []%>
|
||||||
<% if activity.parent %>
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
<% count=activity.parent.children.count%>
|
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||||
<% else %>
|
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||||
<% count=activity.children.count%>
|
|
||||||
<% end %>
|
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
<%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||||
|
|
||||||
<% activity= activity.parent ? activity.parent : activity%>
|
<% all_comments = []%>
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<% parents_rely = [] %>
|
||||||
|
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
||||||
|
<% length = parents_rely.length %>
|
||||||
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
|
<% if length <= 3 %>
|
||||||
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||||
|
<% else %>
|
||||||
|
<div class="orig_cont clearfix">
|
||||||
|
<div class="orig_cont clearfix">
|
||||||
|
<div>
|
||||||
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_cont_hide clearfix">
|
||||||
|
<span class="orig_icon" >↓ </span>
|
||||||
|
<span class="orig_icon" style="display:none;" > ↑</span>
|
||||||
|
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -0,0 +1,61 @@
|
||||||
|
<ul>
|
||||||
|
<% comments.each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher">
|
||||||
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<%= time_from_now(comment.created_on) %>
|
||||||
|
</div>
|
||||||
|
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||||
|
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||||
|
<% end %>
|
||||||
|
<% if !comment.content_detail.blank? %>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
<%= comment.content_detail.html_safe %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_reply mb10 mt-10">
|
||||||
|
<div class="reply">
|
||||||
|
<span class="reply-right">
|
||||||
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_reply),
|
||||||
|
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board},
|
||||||
|
:remote => true,
|
||||||
|
:method => 'get',
|
||||||
|
:title => l(:button_reply)) %>
|
||||||
|
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
|
<% if comment.course_destroyable_by?(User.current) %>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete),
|
||||||
|
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
|
||||||
|
:method => :post,
|
||||||
|
:remote => true,
|
||||||
|
:class => 'fr mr20',
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:title => l(:button_delete)
|
||||||
|
) %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="reply_message_<%= comment.id%>"></p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="homepagePostReplyBanner">
|
||||||
|
<div class="homepagePostReplyBannerCount">
|
||||||
|
<span>回复</span>
|
||||||
|
<span class="reply_iconup" > ︿</span>
|
||||||
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
<%if count>3 %>
|
||||||
|
<div class="homepagePostReplyBannerMore">
|
||||||
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_message_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>,<%=is_course %>,<%=is_board %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
|
展开更多
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -46,12 +46,8 @@
|
||||||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||||
</span>
|
</span>
|
||||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||||
<% count=0 %>
|
<% all_comments = []%>
|
||||||
<% if activity.parent %>
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
<% count=activity.parent.children.count%>
|
|
||||||
<% else %>
|
|
||||||
<% count=activity.children.count%>
|
|
||||||
<% end %>
|
|
||||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -77,20 +77,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count = 0 %>
|
<% all_comments = []%>
|
||||||
<% if activity.parent %>
|
<% count=get_all_children(all_comments, activity).count %>
|
||||||
<% count=activity.parent.children.count%>
|
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||||
<% else %>
|
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||||
<% count=activity.children.count%>
|
|
||||||
<% end %>
|
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
<%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||||
|
|
||||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
<% all_comments = []%>
|
||||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,22 @@
|
||||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
<% elsif @type == 'Message' %>
|
||||||
|
<%= form_for('new_form',:url => {:controller => 'messages', :action => 'reply', :id => reply.id, :board_id => reply.board.id}, :method => "post", :remote => true) do |f|%>
|
||||||
|
<%= hidden_field_tag 'is_course', params[:is_course], :value => @is_course %>
|
||||||
|
<%= hidden_field_tag 'is_board', params[:is_board], :value => @is_board %>
|
||||||
|
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||||
|
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.id %>
|
||||||
|
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %>
|
||||||
|
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||||
|
<!--<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||||
|
<input type="hidden" name="reply[subject]" id="reply_subject">-->
|
||||||
|
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="content"></textarea>
|
||||||
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
|
<% end%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<li>
|
<li>
|
||||||
<span class="item_list fl"></span>
|
<span class="item_list fl"></span>
|
||||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||||
<span class="fr grayTxt">
|
<span class="fr grayTxt">
|
||||||
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<% if @syllabus.any? %>
|
<% if @syllabus.any? %>
|
||||||
<% @syllabus.each_with_index do |syllabus, index|%>
|
<% @syllabus.each_with_index do |syllabus, index|%>
|
||||||
<div class="syllabus_courses_box">
|
<div class="syllabus_courses_box">
|
||||||
<% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS time").order("time desc") %>
|
<% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc") %>
|
||||||
<div class="syllabus_courses_list">
|
<div class="syllabus_courses_list">
|
||||||
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
|
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
|
||||||
<span class="<%=index == 0 && !courses.empty? ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span>
|
<span class="<%=index == 0 && !courses.empty? ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div class="">
|
||||||
<p class="fl grayTxt ">更新:<%=course.time %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
||||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
|
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
|
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
|
||||||
</li>
|
</li>
|
||||||
<% if User.current == syllabus.user %>
|
<% if User.current == syllabus.user %>
|
||||||
<li><%=link_to '删除', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%></li>
|
<li><%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
|
||||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :activity_id =>params[:id].to_i}) %>');
|
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :activity_id =>params[:id].to_i}) %>');
|
||||||
|
<% elsif params[:type] == 'Message' %>
|
||||||
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||||
<% else %>
|
<% else %>
|
||||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<% unless @comment.parent.nil? %>
|
<% unless @comment.parent.nil? %>
|
||||||
<% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %>
|
<% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %>
|
||||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||||
|
<% elsif @comment.class.to_s == 'Message' %>
|
||||||
|
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||||
<% else %>
|
<% else %>
|
||||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -28,7 +28,7 @@ zh:
|
||||||
label_account_identity_choose: --请选择身份--
|
label_account_identity_choose: --请选择身份--
|
||||||
label_account_identity_teacher: 教师
|
label_account_identity_teacher: 教师
|
||||||
label_account_identity_student: 学生
|
label_account_identity_student: 学生
|
||||||
label_account_identity_developer: 开发者
|
label_account_identity_developer: 从业者
|
||||||
label_account_identity_enterprise: 组织
|
label_account_identity_enterprise: 组织
|
||||||
label_account_identity_studentID: 请输入学号
|
label_account_identity_studentID: 请输入学号
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ zh:
|
||||||
field_firstname: 名字或组织名
|
field_firstname: 名字或组织名
|
||||||
firstname_empty: 名字不能为空
|
firstname_empty: 名字不能为空
|
||||||
field_firstname_eg: '(例:张三丰,请填写[三丰])'
|
field_firstname_eg: '(例:张三丰,请填写[三丰])'
|
||||||
field_lastname: 姓氏
|
field_lastname: 姓名
|
||||||
lastname_empty: 姓氏不能为空
|
lastname_empty: 姓氏不能为空
|
||||||
enterprise_empty: 企业名不能为空
|
enterprise_empty: 企业名不能为空
|
||||||
field_lastname_eg: '(例:张三丰,请填写[张])'
|
field_lastname_eg: '(例:张三丰,请填写[张])'
|
||||||
|
|
|
@ -1668,7 +1668,7 @@ zh:
|
||||||
#add by men
|
#add by men
|
||||||
label_account_identity_teacher: 教师
|
label_account_identity_teacher: 教师
|
||||||
label_account_identity_student: 学生
|
label_account_identity_student: 学生
|
||||||
label_account_identity_developer: 开发者
|
label_account_identity_developer: 从业者
|
||||||
label_account_identity_enterprise: 组织
|
label_account_identity_enterprise: 组织
|
||||||
|
|
||||||
label_teaching_course: 我执教的课程
|
label_teaching_course: 我执教的课程
|
||||||
|
|
|
@ -213,7 +213,8 @@ RedmineApp::Application.routes.draw do
|
||||||
|
|
||||||
resources :school, :except => [:show] do
|
resources :school, :except => [:show] do
|
||||||
collection do
|
collection do
|
||||||
|
get 'apply_add_school'
|
||||||
|
get 'search_repeat_schoolname'
|
||||||
end
|
end
|
||||||
|
|
||||||
member do
|
member do
|
||||||
|
@ -485,15 +486,18 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||||
match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get]
|
match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get]
|
||||||
match 'about_us',:to=>'account#about_us',:as=>'about_us',:via=>[:get]
|
match 'about_us',:to=>'account#about_us',:as=>'about_us',:via=>[:get]
|
||||||
match 'account/register', :via => [:get, :post], :as => 'register'
|
match 'account/register',:to=>'account#register', :via => [:get, :post], :as => 'register'
|
||||||
match 'account/lost_password', :via => [:get, :post], :as => 'lost_password'
|
match 'account/lost_password', :via => [:get, :post], :as => 'lost_password'
|
||||||
match 'account/activate', :via => :get
|
match 'account/activate', :via => :get
|
||||||
match 'account/valid_ajax', :via => :get
|
match 'account/valid_ajax', :via => :get
|
||||||
match 'account/email_valid', :to => 'account#email_valid', :via => :get
|
match 'account/email_valid', :to => 'account#email_valid', :via => :get
|
||||||
match 'account/resendmail', :to => 'account#resendmail', :via=> :get
|
match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail'
|
||||||
match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
|
match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
|
||||||
match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
|
match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
|
||||||
|
|
||||||
|
#激活邮箱反馈问题
|
||||||
|
match 'users/:id/leave_email_activation_message', :to => 'words#leave_email_activation_message', :via => :post, :as => "leave_email_activation_message"
|
||||||
|
|
||||||
# boards
|
# boards
|
||||||
match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
|
match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
|
||||||
match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields'
|
match 'boards/:id/join_to_org_subfields', :to => 'boards#join_to_org_subfields'
|
||||||
|
@ -786,11 +790,13 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :quality_analysis, :only => [:index, :new, :create] do
|
resources :quality_analysis, :only => [:index, :create, :edit, :update] do
|
||||||
collection do
|
collection do
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
|
match 'update_jenkins_job'
|
||||||
|
match 'edit'
|
||||||
|
match 'create'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# resources :files, :only => [:index, :new, :create] do
|
# resources :files, :only => [:index, :new, :create] do
|
||||||
|
@ -932,6 +938,7 @@ RedmineApp::Application.routes.draw do
|
||||||
}
|
}
|
||||||
|
|
||||||
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
|
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
|
||||||
|
get 'projects/:id/repository/quality_analysis', :to => 'repositories#quality_analysis'
|
||||||
|
|
||||||
get 'projects/:id/repository/graph', :to => 'repositories#graph'
|
get 'projects/:id/repository/graph', :to => 'repositories#graph'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
class AddNameToQualityAnalyses < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
# add_column :quality_analyses, :language, :string
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddSonarNameToQualityAnalyses < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :quality_analyses, :sonar_name, :string
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddSchoolTypeToSchools < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :schools, :school_type, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,15 @@
|
||||||
|
class CreateApplyAddSchools < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :apply_add_schools do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :province
|
||||||
|
t.string :city
|
||||||
|
t.string :address
|
||||||
|
t.string :remarks
|
||||||
|
t.integer :school_id
|
||||||
|
t.integer :status, :default => false
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
14
db/schema.rb
14
db/schema.rb
|
@ -57,6 +57,18 @@ ActiveRecord::Schema.define(:version => 20160630112733) do
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "apply_add_schools", :force => true do |t|
|
||||||
|
t.string "name"
|
||||||
|
t.string "province"
|
||||||
|
t.string "city"
|
||||||
|
t.string "address"
|
||||||
|
t.string "remarks"
|
||||||
|
t.integer "school_id"
|
||||||
|
t.integer "status", :default => 0
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "apply_homeworks", :force => true do |t|
|
create_table "apply_homeworks", :force => true do |t|
|
||||||
t.integer "status"
|
t.integer "status"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
@ -1532,6 +1544,7 @@ ActiveRecord::Schema.define(:version => 20160630112733) do
|
||||||
t.string "path"
|
t.string "path"
|
||||||
t.string "branch"
|
t.string "branch"
|
||||||
t.string "language"
|
t.string "language"
|
||||||
|
t.string "sonar_name"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "queries", :force => true do |t|
|
create_table "queries", :force => true do |t|
|
||||||
|
@ -1636,6 +1649,7 @@ ActiveRecord::Schema.define(:version => 20160630112733) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.string "logo_link"
|
t.string "logo_link"
|
||||||
t.string "pinyin"
|
t.string "pinyin"
|
||||||
|
t.integer "school_type", :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "secdomains", :force => true do |t|
|
create_table "secdomains", :force => true do |t|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -1374,6 +1374,41 @@ function expand_journal_reply(container, btnid, id, type, div_id, allow_delete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function expand_message_reply(container, btnid, id, type, div_id, is_course, is_board) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
$.get(
|
||||||
|
'/users/all_journals',
|
||||||
|
{
|
||||||
|
type: type,
|
||||||
|
id: id,
|
||||||
|
div_id: div_id,
|
||||||
|
is_course: is_course,
|
||||||
|
is_board: is_board
|
||||||
|
},
|
||||||
|
function(data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
btn.html('收起回复');
|
||||||
|
//target.show();
|
||||||
|
} else if(btn.data('init') == '1') {
|
||||||
|
btn.data('init', 3);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, course_activity, user_activity_id) {
|
function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, course_activity, user_activity_id) {
|
||||||
var target = $(container);
|
var target = $(container);
|
||||||
var btn = $(btnid);
|
var btn = $(btnid);
|
||||||
|
@ -1555,20 +1590,6 @@ function edit_file_description(url,id){
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//删除组织成员
|
|
||||||
function ifDeleteOrgMember(id,name){
|
|
||||||
var htmlvalue = "</br><div style='width:550px;text-align:center'>您确定要删除"+name+"吗?</div></br><div style='width:164px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn fl' onclick='deleteOrgMember("+id+")'>确定</a><a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a></div>" +
|
|
||||||
"<script>function deleteOrgMember(id){" +
|
|
||||||
"$.ajax({\n\
|
|
||||||
url: '/org_member/deleteOrgMember',\n\
|
|
||||||
type: 'get',\n\
|
|
||||||
dataType: 'jsonp',\n\
|
|
||||||
data: {id:id},\n\
|
|
||||||
success: function(data){},\n\
|
|
||||||
});\n\
|
|
||||||
hideModal();}</script>";
|
|
||||||
pop_up_box(htmlvalue,580,30,50);
|
|
||||||
}
|
|
||||||
|
|
||||||
//展开课程大纲列表中的班级
|
//展开课程大纲列表中的班级
|
||||||
function expand_course_list(id, target, btnid, count) {
|
function expand_course_list(id, target, btnid, count) {
|
||||||
|
@ -1588,6 +1609,20 @@ function expand_course_list(id, target, btnid, count) {
|
||||||
btn.parent().show();
|
btn.parent().show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//删除组织成员
|
||||||
|
function ifDeleteOrgMember(id,name){
|
||||||
|
var htmlvalue = "</br><div style='width:550px;text-align:center'>您确定要删除"+name+"吗?</div></br><div style='width:164px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn fl' onclick='deleteOrgMember("+id+")'>确定</a><a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a></div>" +
|
||||||
|
"<script>function deleteOrgMember(id){" +
|
||||||
|
"$.ajax({\n\
|
||||||
|
url: '/org_member/deleteOrgMember',\n\
|
||||||
|
type: 'get',\n\
|
||||||
|
dataType: 'jsonp',\n\
|
||||||
|
data: {id:id},\n\
|
||||||
|
success: function(data){},\n\
|
||||||
|
});\n\
|
||||||
|
hideModal();}</script>";
|
||||||
|
pop_up_box(htmlvalue,580,30,50);
|
||||||
|
}
|
||||||
|
|
||||||
function regex_syllabus_name() {
|
function regex_syllabus_name() {
|
||||||
var name = $.trim($("#new_syllabus_name").val());
|
var name = $.trim($("#new_syllabus_name").val());
|
||||||
|
|
|
@ -189,7 +189,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
|
||||||
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
|
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
|
||||||
.homepagePostReplyDes {float:left; width:632px; margin-left:15px;}
|
.homepagePostReplyDes {float:left; width:632px; margin-left:15px;}
|
||||||
.homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;}
|
.homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;}
|
||||||
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
|
.homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;}
|
||||||
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;}
|
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;}
|
||||||
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
|
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
|
||||||
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
|
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
|
||||||
|
|
|
@ -117,3 +117,179 @@ a.f_grey:hover {color:#000000 !important;}
|
||||||
#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
|
#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
|
||||||
#loginSignButton:hover {background-color:#297fb8;}
|
#loginSignButton:hover {background-color:#297fb8;}
|
||||||
#loginInButton:hover {background-color:#297fb8;}
|
#loginInButton:hover {background-color:#297fb8;}
|
||||||
|
|
||||||
|
/* 邮箱验证 */
|
||||||
|
.email_verify body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
|
||||||
|
.mt30{ margin-top:30px;}
|
||||||
|
.ml30{ margin-left:30px;}
|
||||||
|
.new_content{
|
||||||
|
width:1000px;
|
||||||
|
margin:10px auto;
|
||||||
|
padding:30px 0;
|
||||||
|
background-color:#fff;
|
||||||
|
}
|
||||||
|
.email_verify{
|
||||||
|
width:720px;
|
||||||
|
margin:0px auto;
|
||||||
|
}
|
||||||
|
.email_verify_prompt{
|
||||||
|
border:2px solid #dd0000;
|
||||||
|
background:#ffe3e3 url(../images/icons_prompt.png) 25px 10px no-repeat;;
|
||||||
|
height:35px;
|
||||||
|
line-height:35px;
|
||||||
|
padding-left:45px;
|
||||||
|
color:#8b0000;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.email_verify_btn{
|
||||||
|
border-style:none;
|
||||||
|
height:35px;
|
||||||
|
padding:0 15px;
|
||||||
|
line-height:35px;
|
||||||
|
color:#fff;
|
||||||
|
background:#3a95d7;
|
||||||
|
text-align:center;
|
||||||
|
-webkit-border-radius:5px;
|
||||||
|
-moz-border-radius:5px;
|
||||||
|
-o-border-radius:5px;
|
||||||
|
border-radius:5px;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.email_verify_btn:hover{
|
||||||
|
background:#017bd3;
|
||||||
|
}
|
||||||
|
.email_sub_btn{
|
||||||
|
border-style:none;
|
||||||
|
height:30px;
|
||||||
|
padding:0 25px;
|
||||||
|
line-height:30px;
|
||||||
|
color:#fff;
|
||||||
|
background:#3a95d7;
|
||||||
|
text-align:center;
|
||||||
|
-webkit-border-radius:5px;
|
||||||
|
-moz-border-radius:5px;
|
||||||
|
-o-border-radius:5px;
|
||||||
|
border-radius:5px;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.email_sub_btn:hover{
|
||||||
|
background:#017bd3;
|
||||||
|
}
|
||||||
|
.email_prompt_p{
|
||||||
|
font-size:14px;
|
||||||
|
color:#000;
|
||||||
|
margin-bottom:10px;
|
||||||
|
}
|
||||||
|
.email_prompt_txt{ width:480px;}
|
||||||
|
.email_prompt_txt li{
|
||||||
|
margin-left:15px;
|
||||||
|
list-style-type: disc;
|
||||||
|
color:#777;
|
||||||
|
line-height:1.9;
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.email_prompt_mes{
|
||||||
|
border:1px solid #ccc;
|
||||||
|
-webkit-border-radius:5px;
|
||||||
|
-moz-border-radius:5px;
|
||||||
|
-o-border-radius:5px;
|
||||||
|
border-radius:5px;
|
||||||
|
width:468px;
|
||||||
|
height:60px;
|
||||||
|
background:#fff;
|
||||||
|
padding:5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
.email_tanbox{
|
||||||
|
border:2px solid #3a95d7;
|
||||||
|
background:#fff;
|
||||||
|
width:480px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.email_tancon{
|
||||||
|
width:420px;
|
||||||
|
margin:0 auto;
|
||||||
|
text-align:center;
|
||||||
|
padding:20px 30px;
|
||||||
|
background:#fff;
|
||||||
|
}
|
||||||
|
.email_tan_title{
|
||||||
|
font-size:18px;
|
||||||
|
color:#3a95d7;
|
||||||
|
font-weight:normal;
|
||||||
|
margin-bottom:5px;
|
||||||
|
}
|
||||||
|
.email_tan_p{
|
||||||
|
font-size:14px;
|
||||||
|
color:#4c4c4c;
|
||||||
|
|
||||||
|
}
|
||||||
|
.email_verify_p{
|
||||||
|
font-size:14px;
|
||||||
|
color:#3a95d7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Ajax indicator ******/
|
||||||
|
/*-------resendmail---------*/
|
||||||
|
#ajax-indicator {
|
||||||
|
position: absolute; /* fixed not supported by IE */
|
||||||
|
background-color:#eee;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
top:35%;
|
||||||
|
left:40%;
|
||||||
|
width:20%;
|
||||||
|
font-weight:bold;
|
||||||
|
text-align:center;
|
||||||
|
padding:0.6em;
|
||||||
|
z-index:100000;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
html>body #ajax-indicator { position: fixed; }
|
||||||
|
|
||||||
|
#ajax-indicator span {
|
||||||
|
background-position: 0% 40%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-image: url(../images/loading.gif);
|
||||||
|
padding-left: 26px;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.modal {
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #fff;
|
||||||
|
z-index: 50;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.ui-widget-content {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.ui-widget {
|
||||||
|
font-family: Verdana, sans-serif;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
.ui-dialog .ui-dialog-content {
|
||||||
|
position: relative;
|
||||||
|
border: 0;
|
||||||
|
padding: .5em 1em;
|
||||||
|
background: none;
|
||||||
|
overflow: auto;
|
||||||
|
zoom: 1;
|
||||||
|
}
|
||||||
|
.ui-widget-overlay {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.ui-widget-overlay {
|
||||||
|
background: #666 url(http://forge.trustie.net/stylesheets/jquery/images/xui-bg_diagonals-thick_20_666666_40x40.png.pagespeed.ic.9mfuw_R0z1.png) 50% 50% repeat;
|
||||||
|
opacity: .5;
|
||||||
|
filter: Alpha(Opacity=50);
|
||||||
|
}
|
||||||
|
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||||
|
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||||
|
a:hover.Blue-btn{ background:#3598db; color:#fff;}
|
||||||
|
/***** end Ajax indicator ******/
|
||||||
|
|
|
@ -1803,3 +1803,98 @@ input.new_loggin_input{
|
||||||
.W420 {width:420px;}
|
.W420 {width:420px;}
|
||||||
.W300 {width:300px !important;}
|
.W300 {width:300px !important;}
|
||||||
.W600{ width:600px;}
|
.W600{ width:600px;}
|
||||||
|
|
||||||
|
/* 个人资料修改弹框 */
|
||||||
|
.winbox{
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
width:480px;
|
||||||
|
-webkit-border-radius:5px;
|
||||||
|
-moz-border-radius:5px;
|
||||||
|
-o-border-radius:5px;
|
||||||
|
border-radius:5px;
|
||||||
|
border:none;
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
}
|
||||||
|
.winbox_h2{
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #333;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
.winbox_edit_new{
|
||||||
|
/*width: 425px;*/
|
||||||
|
margin: 28px 0;
|
||||||
|
}
|
||||||
|
.winbox_edit_new li{
|
||||||
|
height: 45px;
|
||||||
|
line-height: 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.winbox_edit_new label{
|
||||||
|
width: 80px;
|
||||||
|
text-align: right;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.winbox_input{
|
||||||
|
width: 330px;
|
||||||
|
height: 28px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 0 5px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.winbox_select{
|
||||||
|
height: 28px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.winbox_textarea{
|
||||||
|
width: 330px;
|
||||||
|
height: 50px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 5px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.winbox_btn_blue{
|
||||||
|
padding: 5px 25px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #3b94d6;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.winbox_btn_blue:hover{
|
||||||
|
background-color: #2e83c2;
|
||||||
|
}
|
||||||
|
.icons_warning{
|
||||||
|
display: block;
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
background:url(../images/icons_ziliao.png) 0 2px no-repeat;
|
||||||
|
}
|
||||||
|
.icons_right{
|
||||||
|
display: block;
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
background:url(../images/icons_ziliao.png) 0 -25px no-repeat;
|
||||||
|
}
|
||||||
|
.icons_error{
|
||||||
|
display: block;
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
background:url(../images/icons_ziliao.png) 0 -52px no-repeat;
|
||||||
|
}
|
||||||
|
a.winbox_btn_close{
|
||||||
|
color: #3b94d6;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.winbox_p{
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -28,6 +28,7 @@ h2{ font-size:18px; }
|
||||||
h3{ font-size:14px; }
|
h3{ font-size:14px; }
|
||||||
h4{ font-size:14px; }
|
h4{ font-size:14px; }
|
||||||
.f8 {font-size:8px;}
|
.f8 {font-size:8px;}
|
||||||
|
.f10 {font-size:10px;}
|
||||||
.f12{font-size:12px; font-weight:normal;}
|
.f12{font-size:12px; font-weight:normal;}
|
||||||
.f14{font-size:14px;}
|
.f14{font-size:14px;}
|
||||||
.f16{font-size:16px;}
|
.f16{font-size:16px;}
|
||||||
|
@ -664,7 +665,7 @@ a.postReplyCancel:hover {color:#ffffff;}
|
||||||
.homepagePostReplyPortrait {float:left; width:45px;}
|
.homepagePostReplyPortrait {float:left; width:45px;}
|
||||||
.homepagePostReplyDes {float:left; width:620px; margin-left:15px;}
|
.homepagePostReplyDes {float:left; width:620px; margin-left:15px;}
|
||||||
.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;}
|
.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;}
|
||||||
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
|
.homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;}
|
||||||
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;}
|
.homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;}
|
||||||
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
|
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
|
||||||
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
|
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
|
||||||
|
@ -1183,3 +1184,45 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px;
|
||||||
|
|
||||||
/*20160622代码分析弹窗*/
|
/*20160622代码分析弹窗*/
|
||||||
.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
|
.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
|
||||||
|
|
||||||
|
/* 二级回复 */
|
||||||
|
.clearfix:after { content:"."; display:block; height:0; visibility:hidden; clear:both; }
|
||||||
|
.clearfix { zoom:1; }
|
||||||
|
.clearit { clear:both; height:0; font-size:0; overflow:hidden; }
|
||||||
|
.comment_item{ width:720px; background-color:#f1f1f1; color:#888;}
|
||||||
|
.comment_top{ height:15px; border: 1px solid #e4e4e4; padding:10px; position:relative;}
|
||||||
|
.reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
|
||||||
|
.fl{ float:left;}
|
||||||
|
.fr{ float:right;}
|
||||||
|
.comment_item_cont{ padding:15px; border-bottom:1px solid #e3e3e3;}
|
||||||
|
.J_Comment_Face img{ width:40px; height:40px; }
|
||||||
|
.t_content{ width:92%; margin-left:15px;}
|
||||||
|
a.content-username { color:#269ac9; font-size:14px; margin-right:15px;}
|
||||||
|
a.content-username:hover{ color:#297fb8;}
|
||||||
|
.orig_user img{width:32px; height:32px;}
|
||||||
|
.reply-right{ float:right; position:relative;}
|
||||||
|
.reply_iconup02{ position:absolute; top:16px; left:4px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
|
||||||
|
.comment_orig_content{margin:10px 0; color:#999;}
|
||||||
|
.comment_orig_content .comment_orig_content{margin-top:0;}
|
||||||
|
.orig_cont{ border:solid 1px #F3DDB3; background:#FFFEF4; padding:4px;color:#999;margin-top:-1px;}
|
||||||
|
.orig_cont_sub{ border-top:0}
|
||||||
|
.orig_index{ float:right; color:#666; font-family:Arial; padding-right:5px;line-height:30px;}
|
||||||
|
.orig_user{ margin:10px 15px 10px 5px;}
|
||||||
|
.orig_user span{ color:#999; padding-right:5px;}
|
||||||
|
.orig_content{padding:5px 0px 5px 0px;line-height:24px; color:#333; }
|
||||||
|
.orig_right{ width:80%; margin-top:5px;}
|
||||||
|
a.comment_ding_link{ height:24px;line-height:24px;display:inline-block;padding-left:2px;vertical-align:middle; color:#333; }
|
||||||
|
a:hover.comment_ding_link{ color:#269ac9;}
|
||||||
|
.comment_ding_link span{display: inline-block;padding: 0 0px 0 8px;}
|
||||||
|
.comment_ding_link em{font-style: normal;font-family: arial;}
|
||||||
|
.comment_reply_link{ display:inline-block; width:50px; height:24px;line-height: 24px; vertical-align:middle;text-align: center;}
|
||||||
|
.comment_reply_link:link,.comment_reply_link:visited{color:#333;text-decoration: none;}
|
||||||
|
.comment_content{ color:#333;}
|
||||||
|
.t_txt{ margin-top:10px;}
|
||||||
|
.orig_reply_box{border-top:1px solid #e3e3e3; width:95%; padding:15px 0px 15px 25px;}
|
||||||
|
.orig_reply_box2{border-top:1px solid #e3e3e3; width:95%; padding:10px 25px 10px 0;}
|
||||||
|
.orig_textarea{width:90%; margin-bottom:10px;}
|
||||||
|
.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
|
||||||
|
.orig_sub:hover{ background:#297fb8;}
|
||||||
|
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
|
||||||
|
.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
|
||||||
|
|
|
@ -138,7 +138,7 @@ a.sortupbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 3px no-rep
|
||||||
a.sortdownbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
a.sortdownbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
||||||
a.sort_no{ background: url(../images/syllabus/icons_syllabus.png) -16px -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
a.sort_no{ background: url(../images/syllabus/icons_syllabus.png) -16px -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; }
|
||||||
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
|
.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;}
|
||||||
a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:708px;}
|
a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block;}
|
||||||
a:hover.list-title{ color:#269ac9;}
|
a:hover.list-title{ color:#269ac9;}
|
||||||
.c_red{ font-weight:normal; font-size:12px;}
|
.c_red{ font-weight:normal; font-size:12px;}
|
||||||
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
|
.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;}
|
||||||
|
|
|
@ -86,7 +86,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;}
|
||||||
.users_ctt{ font-size:14px; color:#666; margin-top:10px;}
|
.users_ctt{ font-size:14px; color:#666; margin-top:10px;}
|
||||||
.setting_left{ width:115px; text-align:right; float:left;}
|
.setting_left{ width:115px; text-align:right; float:left;}
|
||||||
.setting_left li{ height:28px;line-height:28px;}
|
.setting_left li{ height:28px;line-height:28px;}
|
||||||
.setting_right{width:500px; text-align:left; float:left; margin-left:8px;}
|
.setting_right{width:600px; text-align:left; float:left; margin-left:8px;}
|
||||||
.setting_right li{ height:28px;line-height:28px;}
|
.setting_right li{ height:28px;line-height:28px;}
|
||||||
.users_ctt ul li{ margin-bottom:10px;}
|
.users_ctt ul li{ margin-bottom:10px;}
|
||||||
.users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;}
|
.users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :apply_add_school, :class => 'ApplyAddSchools' do
|
||||||
|
name "MyString"
|
||||||
|
province "MyString"
|
||||||
|
city "MyString"
|
||||||
|
address "MyString"
|
||||||
|
remarks "MyString"
|
||||||
|
school_id 1
|
||||||
|
status 1
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe ApplyAddSchools, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue