Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-06-27 08:54:30 +08:00
commit 3c21e8fcba
65 changed files with 1453 additions and 315 deletions

View File

@ -6,7 +6,11 @@ unless RUBY_PLATFORM =~ /w32/
gem 'iconv'
end
gem 'certified'
gem 'net-ssh', '2.9.1'
gem 'jenkins_api_client'
gem 'nokogiri'
# gem 'certified'
gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack'

View File

@ -103,7 +103,7 @@ module Mobile
post "join" do
authenticate!
cs = CoursesService.new
status = cs.join_course({openid: params[:openid], invite_code: params[:invite_code]}, current_user)
status = cs.join_course({role: "10", openid: params[:openid], invite_code: params[:invite_code]}, current_user)
{
status: status[:state],
messsge:CoursesService::JoinCourseError.message(status[:state])

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the QualityAnalyses controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -1305,12 +1305,12 @@ class CoursesController < ApplicationController
sheet[count_row,7] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2)
if home.anonymous_comment ==0
sheet[count_row,8] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
sheet[count_row,10] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty
sheet[count_row,10] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,11] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,12] = format_time(stu.created_at)
else
sheet[count_row,8] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,9] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,10] = format_time(stu.created_at)
end
@ -1338,12 +1338,12 @@ class CoursesController < ApplicationController
sheet[count_row,8] = stu.system_score.nil? ? l(:label_without_score) : stu.system_score.round(2)
if home.anonymous_comment ==0
sheet[count_row,9] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
sheet[count_row,10] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
sheet[count_row,11] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,10] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty
sheet[count_row,11] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,12] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,13] = format_time(stu.created_at)
else
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,11] = format_time(stu.created_at)
end
@ -1369,12 +1369,12 @@ class CoursesController < ApplicationController
sheet[count_row,6] = stu.teaching_asistant_score.nil? ? l(:label_without_score) : stu.teaching_asistant_score.round(2)
if home.anonymous_comment ==0
sheet[count_row,7] = stu.student_score.nil? ? l(:label_without_score) : stu.student_score.round(2)
sheet[count_row,8] = home.teacher_priority == 1 ? 0 : stu.absence_penalty
sheet[count_row,9] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,8] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.absence_penalty
sheet[count_row,9] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,10] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,11] = format_time(stu.created_at)
else
sheet[count_row,7] = home.teacher_priority == 1 ? 0 : stu.late_penalty
sheet[count_row,7] = (home.teacher_priority == 1 && !stu.teacher_score.nil?) ? 0 : stu.late_penalty
sheet[count_row,8] = stu.work_score.nil? ? l(:label_without_score) : stu.work_score.round(2)
sheet[count_row,9] = format_time(stu.created_at)
end

View File

@ -393,7 +393,7 @@ class ProjectsController < ApplicationController
unless @project.gpid.nil?
g = Gitlab.client
@gitlab_branches = g.branches(@project.gpid)
@branch_names = g.branches(@project.gpid).map{|b| b.name}
@branch_names = @gitlab_branches.map{|b| b.name}
@gitlab_default_branch = g.project(@project.gpid).default_branch
end
end
@ -645,7 +645,7 @@ class ProjectsController < ApplicationController
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
# 更新公开私有时同步gitlab公开私有
unless @project.gpid.nil?
if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? true : false)
g = Gitlab.client
params[:project][:is_public] ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch])
end

View File

@ -0,0 +1,99 @@
class QualityAnalysisController < ApplicationController
before_filter :find_project_by_project_id#, :except => [:getattachtype]
before_filter :authorize
layout "base_projects"
include ApplicationHelper
require 'jenkins_api_client'
require 'nokogiri'
require 'json'
require 'open-uri'
def show
end
def create
gitlab_address = Redmine::Configuration['gitlab_address']
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)
branch = params[:branch].nil? ? "master" : params[:branch]
language = params[:language]
path = params[:path]
identifier = params[:identifier]
qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first
version = qa.nil? ? 1 : qa.sonar_version + 1
properties = "sonar.projectKey=#{user_name}:#{identifier}
sonar.projectName=#{user_name}:#{identifier}
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
@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
#
# 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)
else
qa.update_attribute(:sonar_version, version)
end
end
def index
@sonar_address = Redmine::Configuration['sonar_address']
# if params[:resource_id].nil?
# @name_flag = true
# @quality_analyses = QualityAnalysis.where(:project_id => @project.id)
# # @quality_analyses.map {|qa| qa.}
# # if @quality_analyses.count > 0
# # @quality_analyses.each do |qa|
# # ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
# #
# # end
# # end
# # projects_date = open(@sonar_address + "/api/projects/index").read
# # arr = JSON.parse(projects_date).map {|m| m["nm"]}
# # 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 =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
@sonar_issues = JSON.parse(issue_date).first
# end
end
# Find project of id params[:project_id]
def find_project_by_project_id
@project = Project.find(params[:project_id])
rescue ActiveRecord::RecordNotFound
render_404
end
# Authorize the user for the requested action
def authorize(ctrl = params[:controller], action = params[:action], global = false)
unless @project.archived? && @project.gpid.nil?
true
else
render_403 :message => :notice_not_authorized_archived_project
end
end
end

View File

@ -30,11 +30,13 @@ class RepositoriesController < ApplicationController
menu_item :settings, :only => [:new, :create, :edit, :update, :destroy, :committers]
default_search_scope :changesets
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats]
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis]
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis]
# 链接gitlab
before_filter :connect_gitlab, :only => [:quality_analysis]
accept_rss_auth :revisions
# hidden repositories filter // 隐藏代码过滤器
before_filter :check_hidden_repo, :only => [:show, :stats, :revisions, :revision, :diff ]
@ -43,6 +45,7 @@ class RepositoriesController < ApplicationController
helper :project_score
#@root_path = RepositoriesHelper::ROOT_PATH
$g=Gitlab.client
require 'net/ssh'
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def new
@ -306,6 +309,37 @@ update
end
end
def quality_analysis
gitlab_branches = @g.branches(@project.gpid)
@branch_names = gitlab_branches.map{|b| b.name}
@gitlab_default_branch = @g.project(@project.gpid).default_branch
# language = params[:language]
# branch = params[:branch]
# path = params[:path]
# user_name = User.find(@project.user_id).try(:login)
# rep_name = params[:repository_id]
# host = "192.168.0.200"
# port = "1125"
# username = "git"
# password = "123123"
# server_cmd1 = "sh gitclone.sh" + " " + user_name + " " + rep_name
# # 连接到远程主机 foobar
# ssh = Net::SSH.start(host, username, :port => port, :password => password) do |ssh|
# result = ssh.exec!(server_cmd1)
# path = "/home/git/repo/" + user_name + "/" + rep_name
# # sonar 分析
# # server_cmd2
# # 删除clone的版本库
# # server_cmd3
# end
respond_to do |format|
format.js
format.html{
render :layout => "base_projects"
}
end
end
def destroy
DestroyRepositoryTask.new.destroy(User.current.id, @repository.id)
@repository.hidden = true
@ -615,6 +649,14 @@ update
project.project_score.update_attribute(:commit_time, date.created_at)
end
# 链接gitlab
def connect_gitlab
@g = Gitlab.client
unless @project.gpid.nil?
@g_project = @g.project(@project.gpid)
end
end
def find_repository
@repository = Repository.find(params[:id])
@project = @repository.project

View File

@ -1230,12 +1230,12 @@ class StudentWorkController < ApplicationController
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
if @homework.anonymous_comment ==0
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
sheet1[count_row,10] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
sheet1[count_row,11] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,10] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.absence_penalty
sheet1[count_row,11] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,12] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,13] = format_time(homework.created_at)
else
sheet1[count_row,9] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,9] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,11] = format_time(homework.created_at)
end
@ -1263,12 +1263,12 @@ class StudentWorkController < ApplicationController
sheet1[count_row,9] = homework.system_score.nil? ? l(:label_without_score) : homework.system_score.round(2)
if @homework.anonymous_comment ==0
sheet1[count_row,10] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
sheet1[count_row,11] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
sheet1[count_row,12] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,11] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.absence_penalty
sheet1[count_row,12] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,13] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,14] = format_time(homework.created_at)
else
sheet1[count_row,10] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,10] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,11] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,12] = format_time(homework.created_at)
end
@ -1292,12 +1292,12 @@ class StudentWorkController < ApplicationController
sheet1[count_row,5] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
if @homework.anonymous_comment ==0
sheet1[count_row,6] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
sheet1[count_row,7] = @homework.teacher_priority == 1 ? 0 : homework.absence_penalty
sheet1[count_row,8] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,7] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.absence_penalty
sheet1[count_row,8] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,10] = format_time(homework.created_at)
else
sheet1[count_row,6] = @homework.teacher_priority == 1 ? 0 : homework.late_penalty
sheet1[count_row,6] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
sheet1[count_row,7] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
sheet1[count_row,8] = format_time(homework.created_at)
end

View File

@ -1498,8 +1498,8 @@ class UsersController < ApplicationController
# 减少数据库交互
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
blog_ids = "(" + watched_user_blog_ids + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+

View File

@ -4,22 +4,11 @@ class WechatsController < ActionController::Base
include ApplicationHelper
# ROOT_URL = "#{Setting.protocol}://#{Setting.host_name}/"
ROOT_URL = "http://wechat.trustie.net"
ROOT_URL = "http://www.trustie.net"
# default text responder when no other match
on :text do |request, content|
#邀请码
begin
uw = user_binded?(request[:FromUserName])
if !uw
return sendBind()
else
return join_class({invite_code: content}, uw.user)
end
rescue => e
logger.error e.inspect
logger.error e.backtrace.join("\n")
return request.reply.text e
end
sendBindClass(request, {invite_code: content})
end
# When receive 'help', will trigger this responder
@ -48,24 +37,13 @@ class WechatsController < ActionController::Base
# When subscribe user scan scene_id in public account
on :scan, with: 'scene_id' do |request, ticket|
begin
uw = user_binded?(request[:FromUserName])
if !uw
return sendBind()
else
return join_class({ticket: ticket}, uw.user)
end
rescue => e
logger.error e.inspect
logger.error e.backtrace.join("\n")
return request.reply.text e
end
sendBindClass(request, {ticket: ticket})
end
# When no any on :scan responder can match subscribe user scaned scene_id
on :event, with: 'scan' do |request|
if request[:EventKey].present?
request.reply.text "event scan got EventKey #{request[:EventKey]} Ticket #{request[:Ticket]}"
sendBindClass(request, {ticket: request[:Ticket]})
end
end
@ -86,6 +64,9 @@ class WechatsController < ActionController::Base
request.reply.text "User: #{request[:FromUserName]} click #{key}"
end
on :click, with: 'DEV' do |request, key|
request.reply.text "此功能正在开发中,请耐心等待。"
end
# When user view URL in the menu button
on :view, with: 'http://wechat.somewhere.com/view_url' do |request, view|
request.reply.text "#{request[:FromUserName]} view #{view}"
@ -161,6 +142,22 @@ class WechatsController < ActionController::Base
end
end
def sendBindClass(request, params)
begin
uw = user_binded?(request[:FromUserName])
if !uw
return sendBind(request)
else
return join_class(params, uw.user, request)
end
rescue => e
logger.error e.inspect
logger.error e.backtrace.join("\n")
return request.reply.text e
end
end
def default_msg(request)
uw = user_binded?(request[:FromUserName])
if uw && uw.user
@ -187,20 +184,19 @@ class WechatsController < ActionController::Base
end
end
def join_class(params, user)
def join_class(params, user, request)
course = nil
course = Course.where(qrcode: params[:ticket]) if params[:ticket]
course = Course.where(invite_code: params[:invite_code]) if params[:invite_code]
raise "课程不存在" if course.blank?
course = Course.where(qrcode: params[:ticket]).first if params[:ticket]
course = Course.where(invite_code: params[:invite_code]).first if params[:invite_code]
raise "课程不存在" unless course
cs = CoursesService.new
status = cs.join_course(course.invite_code, user)
status = cs.join_course({invite_code: course.invite_code}, user)
logger.info status
if status[:state] != 0
raise CoursesService::JoinCourseError.message(status[:state])
end
course = status[:course]
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
return request.reply.news(news) do |article, n, index| # article is return object

View File

@ -0,0 +1,97 @@
# encoding: utf-8
module QualityAnalysisHelper
def sqale_rating_status val
arr = []
if val.to_i > 0 && val.to_i < 5
arr << "很好"
arr << "b_green2"
elsif val.to_i > 5 && val.to_i < 10
arr << "较好"
arr << "b_slow_yellow"
elsif val.to_i > 10 && val.to_i < 20
arr << "中等"
arr << "b_yellow"
elsif val.to_i > 20 && val.to_i < 50
arr << "较差"
arr << "b_slow_red"
elsif val.to_i > 20
arr << "很差"
arr << "b_red"
end
end
def complexity_status val
arr = []
if val.to_i < 10
arr << "良好"
arr << "b_green2"
elsif val.to_i > 10 && val.to_i < 15
arr << "较高"
arr << "b_yellow"
elsif val.to_i > 15
arr << "很高"
arr << "b_red"
end
end
def duplicated_lines_density_status val
arr = []
if val.to_i < 30
arr << "良好"
arr << "b_green2"
elsif val.to_i > 30 && val.to_i < 50
arr << "较高"
arr << "b_yellow"
elsif val.to_i > 50
arr << "很高"
arr << "b_red"
end
end
def comment_lines_density_status val
arr = []
if val.to_i < 20
arr << "较低"
arr << "b_yellow"
elsif val.to_i > 20 && val.to_i < 50
arr << "正常"
arr << "b_green2"
elsif val.to_i > 50
arr << "较高"
arr << "b_red"
end
end
def score_sqale_rating val
if val.to_i > 0 && val.to_i < 5
"5"
elsif val.to_i > 5 && val.to_i < 10
"4"
elsif val.to_i > 10 && val.to_i < 20
"3"
elsif val.to_i > 20 && val.to_i < 50
"2"
elsif val.to_i > 20
"1"
end
end
def lines_scale val
if val.to_i < 5000
"小型"
elsif val.to_i >5000 && val.to_i < 50000
"中型"
else
"大型"
end
end
#统计答题百分比,统计结果保留两位小数
def statistics_result_percentage(e, t)
e = e.to_f
t = t.to_f
t == 0 ? 0 : format("%.2f", e*100/t)
end
end

View File

@ -155,7 +155,7 @@ class Project < ActiveRecord::Base
#ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
# 创建project之后默认创建一个board之后的board去掉了board的概念
after_create :create_board_sync,:acts_as_forge_activities,:create_project_ealasticsearch_index
after_create :create_board_sync,:acts_as_forge_activities, :create_project_ealasticsearch_index
before_destroy :delete_all_members,:delete_project_ealasticsearch_index
after_update :update_project_ealasticsearch_index
def remove_references_before_destroy

View File

@ -0,0 +1,7 @@
class QualityAnalysis < ActiveRecord::Base
attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language
def user_rep_name
self.author_login+":"+self.rep_identifier
end
end

View File

@ -0,0 +1,3 @@
class SonarAnalysis < ActiveRecord::Base
attr_accessible :author_login, :project_id, :rep_identifier
end

View File

@ -351,7 +351,7 @@ class CoursesService
#如果加入角色为教师或者教辅,并且当前是学生,或者是要成为教辅,当前不是教辅,或者要成为教师,当前不是教师。那么要发送请求
elsif (params[:role] != "10" && roleName == "Student") || (params[:role] == "7" && roleName != "TeachingAsistant" ) || (params[:role] == "9" && roleName != "Teacher" )
#如果已经发送过消息了,那么就要给个提示
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0
@state = 7
else
Mailer.run.join_course_request(course, User.current, params[:role])

View File

@ -1,7 +1,7 @@
<!--<div class="resourceUploadPopup">-->
<span class="uploadDialogText">更新资源版本</span>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="uploadBoxContainer mt0">
<div>
<div>
<div>当前版本
<span class="attachment" >
@ -39,19 +39,19 @@
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
</div>
<div class="W300 uploadResourceIntr fontGrey2">
<span id="upload_file_count" class="mr15">(未选择文件)</span>
<span>您可以上传小于<span class="c_red">50MB</span>的文件</span>
</div>
<div class="cl"></div>
<div class="mb5 mt5">
<label class="fl c_dark f14" style="line-height:30px;">描述:</label>
<p class="c_dark f14" style="line-height:30px;">描述:</p>
<div class="fl">
<input type="text" name="description" class="InputBox fl W160" value="<%= @attachment.description %>">
<textarea style="resize:none" type="text" placeholder="请编辑资源描述" name="description" class="InputBox fl H60 W420" ><%= @attachment.description %></textarea>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div class="uploadResourceIntr">
<div class="uploadResourceName fl"><span id="upload_file_count">(未选择文件)</span></div>
<div class="uploadResourceIntr2 fl">您可以上传小于<span class="c_red">50MB</span>的文件</div>
</div>
</div>
<div class="cl"></div>
<div style="margin-top: 10px" >

View File

@ -49,7 +49,7 @@
<div id="popbox">
<div class="C" >
<div class="C_top">
<h2>快速入课程通道</h2>
<h2>快速入课程通道</h2>
<p>只要持有课程邀请码,就可以快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!</p>
</div>
<div class="C_form">
@ -68,7 +68,7 @@
</li>
<li class="mB5">课程邀请码是所在课程页面中显示的邀请码</li>
<li style="margin-top: 15px;">
<span style="margin-right: 20px;">身&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份</span>
<span style="margin-right: 5px;"><span style="margin-right:43px;">身</span><span>份</span></span>
<% if User.current.logged? && User.current.extensions && User.current.extensions.identity == 0%>
<select name="role" class="IDType">
<option value="9">教师</option>

View File

@ -6,14 +6,14 @@ $("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@c
alert("加入成功");
hideModal();
$("#try_join_course_link").replaceWith("<a href='<%=url_for(:controller => 'homework_common', :action => 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品</a>");
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 1 %>
alert("密码错误");
<% elsif @state == 2 %>
alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)");
<% elsif @state == 3 %>
alert("您已经加入了课程");
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 4 %>
alert("您加入的课程不存在");
<% elsif @state == 5 %>
@ -27,15 +27,15 @@ hidden_join_course_form();
<% elsif @state == 8%>
alert("您已经是该课程的教师了");
hidden_join_course_form();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 9%>
alert("您已经是该课程的教辅了");
hidden_join_course_form();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 10%>
alert("您已经是该课程的管理员了");
hidden_join_course_form();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% else %>
alert("未知错误,请稍后再试");
<% end %>

View File

@ -43,15 +43,12 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_org_subfield_file_path(file.container.organization,file)%>','<%= file.id %>');"><%= file.description %></textarea>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_org_subfield_file_path(file.container,file)%>','<%= file.id %>');"><%= file.description %></textarea>
</div>
<% else %>
<div class="fontGrey2 mb4">
<% unless file.description.blank? %>
<div class="cl"></div>
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
<% end %>
资源描述:<% if file.description.blank? %><span style="color:#C5C5BE;">未添加</span><% else %><%= file.description %><% end %>
</div>
<% end %>

View File

@ -48,15 +48,12 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_project_file_path(project,file)%>','<%= file.id %>');"><%= file.description %></textarea>
</div>
<% else %>
<div class="fontGrey2 mb4">
<% unless file.description.blank? %>
<div class="cl"></div>
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
<% end %>
资源描述:<% if file.description.blank? %><span style="color:#C5C5BE;">未添加</span><% else %><%= file.description %><% end %>
</div>
<% end %>
<div class="tag_h">

View File

@ -40,16 +40,13 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_project_file_path(project,file)%>','<%= file.id %>');"><%= file.description %></textarea>
</div>
<% else %>
<div class="fontGrey2 mb4">
<% unless file.description.blank? %>
<div class="cl"></div>
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
<% end %>
</div>
<div class="fontGrey2 mb4">
资源描述:<% if file.description.blank? %><span style="color:#C5C5BE;">未添加</span><% else %><%= file.description %><% end %>
</div>
<% end %>
<div class="tag_h">
<!-- container_type = 1 代表是课程里的资源 -->

View File

@ -42,15 +42,12 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_course_file_path(@course,file)%>','<%= file.id %>');"><%= file.description %></textarea>
</div>
<% else %>
<div class="fontGrey2 mb4">
<% unless file.description.blank? %>
<div class="cl"></div>
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
<% end %>
资源描述:<% if file.description.blank? %><span style="color:#C5C5BE;">未添加</span><% else %><%= file.description %><% end %>
</div>
<% end %>
<%# end %>

View File

@ -1,7 +1,7 @@
<%if @save_flag%>
//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();
//$('#reorder_time').click();
window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>"
window.location.href= "<%= host_with_protocol %>"+"/forums/" + "<%= @forum.id%>"
<%else%>
$("#error").html("<%= @forum.errors.full_messages[0]%>").show();
<%end %>

View File

@ -5,18 +5,20 @@
<ul class="shadowbox_news_list">
<% messages.each do |ma| %>
<% if ma.class == SystemMessage %>
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
<% elsif ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
<% elsif ma.course_message_type == "Comment" %>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程作业:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 关闭了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>关闭了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
@ -34,106 +36,106 @@
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.user.show_name %> 申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "Poll" %>
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
<% elsif ma.course_message_type == "Message" %>
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
<% elsif ma.course_message_type == "StudentWorksScore" %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
<% elsif ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
<% else %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
<% end %>
<% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id) %>" target="_blank" title="<%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评"><span class="shadowbox_news_user"><%=ma.course_message.homework_common.user.show_name %>老师 </span>发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评</a></li>
<% elsif ma.course_message_type == "StudentWork" && ma.status == 1 %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 重新提交了作品:<%=ma.course_message.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>重新提交了作品:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>追加新附件了:作业标题:<%=ma.course_message.homework_common.name %></a></li>
<% elsif ma.course_message_type == "Course" %>
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了课程:课程名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了课程:课程名称:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "JoinCourseRequest" %>
<% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的课程成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的课程成员申请:<%=content %></a></li>
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
<% content = ma.status == 1 ? '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 课程申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>课程申请进度反馈:<%=content %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了课程:<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
<% elsif ma.course_message_type == "RemoveFromCourse" %>
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了课程:<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 2 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
<% end %>
<% elsif ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %>
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "JoinProject" %>
<li><a href="<%=project_member_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您加入了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您加入了项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "RemoveFromProject" %>
<li><a href="<%=member_project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您移出了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您移出了项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "RemoveFromProject" %>
<li><a href="<%=project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 邀请你加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>邀请你加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status == 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "Journal" %>
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
<% elsif ma.forge_message_type == "Message" %>
<li><a href="<%=project_boards_path(ma.forge_message.project,:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,:topic_id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "News" %>
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
<% elsif ma.forge_message_type == "Comment" %>
<li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li>
<% end %>
<% elsif ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%></a></li>
<% end %>
<% elsif ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%></a></li>
<% end %>
<% elsif ma.class == OrgMessage %>
<% if ma.message_type == 'ApplySubdomain' %>
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li>
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
<% end %>
<% elsif AtMessage === ma && ma.at_valid? %>
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
<% href = course_boards_path(ma.at_message.course,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "Poll" %>
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
<% elsif ma.course_message_type == "Message" %>
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
<% elsif ma.course_message_type == "StudentWorksScore" %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
<% elsif ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
<% else %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
<% end %>
<% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id) %>" target="_blank" title="<%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评"><span class="shadowbox_news_user"><%=ma.course_message.homework_common.user.show_name %>老师 </span>发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评</a></li>
<% elsif ma.course_message_type == "StudentWork" && ma.status == 1 %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 重新提交了作品:<%=ma.course_message.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>重新提交了作品:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>追加新附件了:作业标题:<%=ma.course_message.homework_common.name %></a></li>
<% elsif ma.course_message_type == "Course" %>
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了课程:课程名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了课程:课程名称:<%=ma.course_message.name %></a></li>
<% elsif ma.course_message_type == "JoinCourseRequest" %>
<% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的课程成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的课程成员申请:<%=content %></a></li>
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
<% content = ma.status == 1 ? '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 课程申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>课程申请进度反馈:<%=content %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了课程:<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
<% elsif ma.course_message_type == "RemoveFromCourse" %>
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了课程:<%=ma.course.name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 2 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
<% end %>
<% elsif ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %>
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "JoinProject" %>
<li><a href="<%=project_member_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您加入了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您加入了项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "RemoveFromProject" %>
<li><a href="<%=member_project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您移出了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您移出了项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "RemoveFromProject" %>
<li><a href="<%=project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 邀请你加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>邀请你加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status == 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "Journal" %>
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
<% elsif ma.forge_message_type == "Message" %>
<li><a href="<%=project_boards_path(ma.forge_message.project,:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,:topic_id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "News" %>
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
<% elsif ma.forge_message_type == "Comment" %>
<li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li>
<% end %>
<% elsif ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%></a></li>
<% end %>
<% elsif ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%></a></li>
<% end %>
<% elsif ma.class == OrgMessage %>
<% if ma.message_type == 'ApplySubdomain' %>
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li>
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
<% end %>
<% elsif AtMessage === ma && ma.at_valid? %>
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
<% href = course_boards_path(ma.at_message.course,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
<% else %>
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
<% end %>
<% end %>
<% end %>
</ul>
<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>

View File

@ -66,7 +66,7 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(document.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% end %>
<div style="background: #f8fafb;">
<div style="background: #f8fafb; padding:3px 5px">
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => document.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(document.created_at) %></span><%= link_to document.creator.show_name, user_path(document.creator), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
@ -85,9 +85,11 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
<div style="background: #f8fafb; padding:3px 5px">
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
</div>
<% else %>
<div class="por_hotbar_right fl">
@ -96,9 +98,11 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_path(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_path(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
<div style="background: #f8fafb; padding:3px 5px">
<%= link_to title, board_message_path(message.board.id, message.id), :class => 'por_hot_title_r link-black', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
</div>
<% end %>
<% end %>
@ -111,9 +115,11 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% end %>
<%= link_to news.title, news_path(news), :class => 'por_hot_title_r link-black', :target => "_blank", :title => news.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(news.created_on) %></span><%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
<div style="background: #f8fafb; padding:3px 5px">
<%= link_to news.title, news_path(news), :class => 'por_hot_title_r link-black', :target => "_blank", :title => news.title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(news.created_on) %></span><%= link_to news.author.show_name, user_path(news.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
</div>
<% end %>
<% end %>
@ -121,4 +127,8 @@
<%# end %>
<div class="cl"></div>
</div><!--por_hotbar end-->
</div><!--por_hotbar end-->
<script>
$(".por_hotbar_left li:last").css("borderBottom","none");
</script>

View File

@ -71,7 +71,7 @@
<% end %>
<% end %>
</div>
<% unless acts[1..4].nil? %>
<% unless acts[1..4].blank? %>
<% acts[1..4].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
@ -110,10 +110,10 @@
<% end %>
<% end %>
</div>
<% unless acts[5..16].nil? %>
<% unless acts[5..16].blank? %>
<div class="fl">
<ul class="por_post_right por_post_list">
<% acts[6..16].each do |activity| %>
<% acts[5..16].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' %>
<% document = activity.org_act %>
<li><%= link_to "<span class='post_icons_grey fl'></span>#{document.title}".html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), class: 'por_hidden_w270 link-black', :target => "_blank" %></li>

View File

@ -112,7 +112,8 @@
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
<%# if @organization.secdomain_name.nil? %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %>
<%# else %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<%# end %>

View File

@ -0,0 +1,483 @@
<script>
// sqale_rating
$(function () {
$('#container_sqale_rating').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: false,
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
// title: {
// text: 'km/h'
// },
plotBands: [{
from: 0,
to: 5,
color: '#55BF3B' // green
}, {
from: 6,
to: 10,
color: '#adde18' // yellow
}, {
from: 11,
to: 20,
color: '#DDDF0D' // red
}, {
from: 21,
to: 50,
color: '#df8538' // yellow
}, {
from: 51,
to: 100,
color: '#DF5353' // yellow
}]
},
// delete hightcharts.com
credits:{
enabled: false
},
series: [{
name: '代码质量',
data: [<%= @complexity["msr"][9]["val"] %>]
// tooltip: {
// valueSuffix: ' km/h'
// }
}]
},
// Add some life
function (chart) {
// if (!chart.renderer.forExport) {
// setInterval(function () {
// var point = chart.series[0].points[0],
// newVal,
// inc = Math.round((Math.random() - 0.5) * 20);
//
// newVal = point.y + inc;
// if (newVal < 0 || newVal > 200) {
// newVal = point.y - inc;
// }
//
// point.update(newVal);
//
// }, 3000);
// }
});
});
// function_complexity
$(function () {
$('#container_function_complexity').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: false,
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 30,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
// title: {
// text: 'km/h'
// },
plotBands: [{
from: 0,
to: 10,
color: '#55BF3B' // green
}, {
from: 11,
to: 15,
color: '#DDDF0D' // yellow
}, {
from: 16,
to: 30,
color: '#DF5353' // red
}]
},
// delete hightcharts.com
credits:{
enabled: false
},
series: [{
name: '复杂度',
data: [<%= @complexity["msr"][6]["val"] %>]
// tooltip: {
// valueSuffix: ' km/h'
// }
}]
},
// Add some life
function (chart) {
// if (!chart.renderer.forExport) {
// setInterval(function () {
// var point = chart.series[0].points[0],
//// newVal,
//// inc = Math.round((Math.random() - 0.5) * 20);
//
//// newVal = point.y + inc;
//// if (newVal < 0 || newVal > 200) {
//// newVal = point.y - inc;
//// }
//
//// point.update(newVal);
//
// }, 3000);
// }
});
});
// duplicated_lines_density
$(function () {
$('#container_duplicated_lines_density').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: false,
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
xAxis: {
style:{
fontSize: '18px'
}
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
// title: {
// text: 'km/h'
// },
plotBands: [{
from: 0,
to: 30,
color: '#55BF3B' // green
}, {
from: 31,
to: 50,
color: '#DDDF0D' // red
}, {
from: 51,
to: 100,
color: '#DF5353' // yellow
}]
},
// delete hightcharts.com
credits:{
enabled: false
},
series: [{
name: '重复率',
data: [<%= @complexity["msr"][7]["val"] %>]
// tooltip: {
// valueSuffix: ' km/h'
// }
}]
},
// Add some life
function (chart) {
// if (!chart.renderer.forExport) {
// setInterval(function () {
// var point = chart.series[0].points[0],
// newVal,
// inc = Math.round((Math.random() - 0.5) * 20);
//
// newVal = point.y + inc;
// if (newVal < 0 || newVal > 200) {
// newVal = point.y - inc;
// }
//
// point.update(newVal);
//
// }, 3000);
// }
});
});
// comment_lines_density
$(function () {
$('#container_comment_lines_density').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: false,
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
xAxis: {
title: {
text: '复杂度',
x: -23, //center设置标题的位置
y: 6
},
style:{
fontSize: '18px'
}
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
// title: {
// text: 'km/h'
// },
plotBands: [{
from: 0,
to: 20,
color: '#DDDF0D' // green
}, {
from: 21,
to: 50,
color: '#55BF3B' // red
}, {
from: 51,
to: 100,
color: '#DF5353' // yellow
}]
},
// delete hightcharts.com
credits:{
enabled: false
},
series: [{
name: '质量等级',
data: [<%= @complexity["msr"][5]["val"] %>]
// tooltip: {
// valueSuffix: ' km/h'
// }
}]
},
// Add some life
function (chart) {
// if (!chart.renderer.forExport) {
// setInterval(function () {
// var point = chart.series[0].points[0],
// newVal,
// inc = Math.round((Math.random() - 0.5) * 20);
//
// newVal = point.y + inc;
// if (newVal < 0 || newVal > 200) {
// newVal = point.y - inc;
// }
//
// point.update(newVal);
//
// }, 3000);
// }
});
});
</script>

View File

@ -0,0 +1,25 @@
<div class="project_r_h">
<h2 class="project_h2">分析结果</h2>
</div>
<ul class="analysis-result-list">
<li class="analysis-result-name fl fontBlue2" >名称</li>
<li class="analysis-result-version fl fontBlue2" >版本</li>
<li class="analysis-result-loc fl fontBlue2" >分支</li>
<li class="analysis-result-debt fl fontBlue2" >语言</li>
<li class="analysis-result-time fl fontBlue2" >时间</li>
<div class="cl"></div>
</ul>
<% if @quality_analyses.count >0 %>
<% @quality_analyses.each do |qa| %>
<ul class="analysis-result-list">
<li title="Name" title="名称"><%=link_to "#{qa.author_login}:#{qa.rep_identifier}", project_quality_analysis_path(:resource_id => qa.author_login+":"+qa.rep_identifier, :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-loc fl fontBlue2" title="分支名"><%= qa.branch %></li>
<li class="analysis-result-debt fl fontBlue2" title="语言"><%= qa.language %></li>
<li class="analysis-result-time fl fontBlue2" title="时间"><%= format_time(qa.created_at) %></li>
<div class="cl"></div>
</ul>
<% end %>
<% end %>

View File

@ -0,0 +1,114 @@
<%= javascript_include_tag 'highcharts','highcharts-more' %>
<%= render :partial => "hightchars" %>
<div class="project_r_h">
<h2 class="project_h2" style="width:180px;">质量分析</h2>
</div>
<div class="button-rep">当前分支:<%= params[:branch] %></div>
<div class="cl"></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-block mt10 mb40 f14">
<div class="flex">
<div class="analysis-genral">
<p id="container_sqale_rating" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
<p class="fontGrey3">质量等级</p>
<p class="fontBlue2 pr"><%= @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>
</div>
<div class="analysis-genral" >
<p id="container_function_complexity" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></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>
</div>
</div>
<div class="flex">
<div class="analysis-genral">
<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="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>
</div>
<div class="analysis-genral">
<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="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>
</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>
<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="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 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-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>
<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>
<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><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>
</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-block mt10 mb40 flex f14">
<div class="analysis-genral">
<p class="fontGrey3">代码行数</p>
<p class="fontBlue2"><%= @complexity["msr"][0]["frmt_val"] %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">文件</p>
<p class="fontBlue2"><%= @complexity["msr"][2]["frmt_val"] %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">目录</p>
<p class="fontBlue2"><%= @complexity["msr"][3]["frmt_val"] %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">类</p>
<p class="fontBlue2"><%= @complexity["msr"][1]["frmt_val"] %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">方法</p>
<p class="fontBlue2"><%= @complexity["msr"][4]["frmt_val"] %></p>
</div>
</div>
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>-->
<!--<div class="analysis-block mt10 f12">-->
<!--<ul class="contribute-list">-->
<!--<li class="fl fontGrey2 contribute-list-avatar">&nbsp;</li>-->
<!--<li class="fl fontGrey2 contribute-list-code">代码行数</li>-->
<!--<li class="fl fontGrey2 contribute-list-problem">引入质量问题数</li>-->
<!--<li class="fl fontGrey2 contribute-list-rate">引入质量问题数/代码行数</li>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--<ul class="contribute-list">-->
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
<!--<p class="fontGrey2 hidden">小明</p>-->
<!--</div>-->
<!--</li>-->
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">18340</li>-->
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">230</li>-->
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.012540</li>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--<ul class="contribute-list">-->
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
<!--<p class="fontGrey2 hidden">小王</p>-->
<!--</div>-->
<!--</li>-->
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">834</li>-->
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">34</li>-->
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.04077</li>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--<ul class="contribute-list">-->
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
<!--<p class="fontGrey2 hidden">小亮</p>-->
<!--</div>-->
<!--</li>-->
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">134</li>-->
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">10</li>-->
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.07462</li>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--</div>-->

View File

@ -0,0 +1,6 @@
<% if @name_flag %>
<%= render :partial => "result_list" %>
<% else %>
<%= render "show" %>
<% end %>

View File

View File

@ -0,0 +1,23 @@
<div class="f16 fb fontBlue mb10">代码质量分析</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 %>
<div class="ui form">
<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>
</div>
<div class="mb10">
<div>
<%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch', :class => "analysis-option-box" %>
</div>
</div>
<div class="mb10">
<div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#", "Web"]), :id => 'branch', :class => "analysis-option-box" %>
</div>
</div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_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>

View File

@ -0,0 +1,76 @@
<%= javascript_include_tag 'highcharts','highcharts-more' %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_quality_analyses) %></h2>
</div>
<div class="repository_con " style="line-height:1.9;">
<%#= render :partial => 'navigation' %>
<div class="cl"></div>
</div>
<div id = "container">
</div>
<div id = "container_quality" class="mt30">
</div>
<script>
$(function () {
$('#container').highcharts({
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Browser market shares at a specific website, 2014'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45.0],
['IE', 26.8],
{
name: 'Chrome',
y: 12.8,
sliced: true,
selected: true
},
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
],
dataLabels: {
enabled: true,
style: {
fontSize: '13px',
color: '#aaa',
fontFamily: 'Arial',
textShadow: '0px 0px 6px rgb(0, 0, 0), 0px 0px 3px rgb(f, f, f)',
fontWeight: 'normal'
}
}
}]
});
});
</script>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
<% html_title(l(:label_repository), l(:label_statistics)) -%>

View File

@ -0,0 +1,8 @@
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'repositories/quality_analysis', :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");

View File

@ -2,7 +2,13 @@
<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>
<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 User.current.member_of?(@project) %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id), :remote => true, :class => "btn_zipdown fr" %>
<%# end %>
<% else %>
<%= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id, :resource_id => @proje), :class => "btn_zipdown fr" %>
<% end %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>
@ -45,7 +51,7 @@
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
@ -57,7 +63,6 @@
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> 提交
</span>
</div>
<% end %>

View File

@ -3,7 +3,7 @@
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
<th class="hworkList50">&nbsp;</th>
<% if @homework.homework_type != 3 %>
<th class="hworkList260 hide-text" style="text-align:left;">作品名称</th>
<th class="<%= @homework.homework_type == 2 ? 'hworkList210' : 'hworkList260' %> hide-text" style="text-align:left;">作品名称</th>
<th class="hworkList80 hide-text">
<span class="HomeworkStuTitle f14 fb">姓名</span>
</th>

View File

@ -10,7 +10,7 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>

View File

@ -1,9 +1,7 @@
<div class="orig_reply_box borderBottomNone" id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
</div>
<div class="orig_textarea mb10 fl">
<% if User.current.logged? %>
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone" id="reply_to_message_<%= reply.id%>">
<% if User.current.logged? %>
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="orig_textarea mb10 fl">
<div nhname='new_message_<%= reply.id%>'>
<% if @type == 'HomeworkCommon' %>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
@ -32,10 +30,10 @@
<% end%>
<% end %>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% else %>
<%= render :partial => "users/show_unlogged_reply" %>
<% end %>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,4 @@
<div class="visitor-box fontGrey2 mt10">
<a href='<%= signin_url_without_domain %>' class='linkBlue' target='_Blank' >登录</a>后可添加回复
<%#= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %>
</div>

View File

@ -28,27 +28,27 @@
<script src="https://dn-demotest.qbox.me/angular.all.min.js"></script>
<!--<script src="/javascripts/wechat/build/angular.all.min.js"></script>-->
<!--<script src="/javascripts/wechat/build/app.min.js"></script>-->
<script src="/javascripts/wechat/app.js"></script>
<script src="/javascripts/wechat/others/factory.js"></script>
<script src="/javascripts/wechat/others/filter.js"></script>
<script src="/javascripts/wechat/directives/alert.js"></script>
<script src="/javascripts/wechat/directives/form_validate.js"></script>
<script src="/javascripts/wechat/directives/input_auto.js"></script>
<script src="/javascripts/wechat/directives/loading_spinner.js"></script>
<script src="/javascripts/wechat/controllers/reg.js"></script>
<script src="/javascripts/wechat/controllers/invite_code.js"></script>
<script src="/javascripts/wechat/controllers/login.js"></script>
<script src="/javascripts/wechat/controllers/activity.js"></script>
<script src="/javascripts/wechat/controllers/add_class.js"></script>
<script src="/javascripts/wechat/controllers/blog.js"></script>
<script src="/javascripts/wechat/controllers/course_notice.js"></script>
<script src="/javascripts/wechat/controllers/discussion.js"></script>
<script src="/javascripts/wechat/controllers/homework.js"></script>
<script src="/javascripts/wechat/controllers/issue.js"></script>
<script src="/javascripts/wechat/controllers/journals.js"></script>
<script src="/javascripts/wechat/controllers/myclass.js"></script>
<script src="/javascripts/wechat/others/routes.js"></script>
<script src="/javascripts/wechat/build/app.min.js"></script>
<!--<script src="/javascripts/wechat/app.js"></script>-->
<!--<script src="/javascripts/wechat/others/factory.js"></script>-->
<!--<script src="/javascripts/wechat/others/filter.js"></script>-->
<!--<script src="/javascripts/wechat/directives/alert.js"></script>-->
<!--<script src="/javascripts/wechat/directives/form_validate.js"></script>-->
<!--<script src="/javascripts/wechat/directives/input_auto.js"></script>-->
<!--<script src="/javascripts/wechat/directives/loading_spinner.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/reg.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/invite_code.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/login.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/activity.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/add_class.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/blog.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/course_notice.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/discussion.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/homework.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/issue.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/journals.js"></script>-->
<!--<script src="/javascripts/wechat/controllers/myclass.js"></script>-->
<!--<script src="/javascripts/wechat/others/routes.js"></script>-->
</body>
</html>

View File

@ -602,6 +602,7 @@ en:
label_time_tracking: Time tracking
label_change_plural: Changes
label_statistics: Statistics
label_quality_analyses: Quality Analyses
label_commits_per_month: Commits per month
label_commits_per_author: Commits per author
label_diff: diff

View File

@ -732,6 +732,7 @@ zh:
label_time_tracking: 时间跟踪
label_change_plural: 变更
label_statistics: 统计
label_quality_analyses: 质量分析
label_commits_per_month: 每月提交次数
label_commits_per_author: 每用户提交次数

View File

@ -7,13 +7,13 @@ button:
name: "我的课程"
sub_button:
-
type: "view"
type: "click"
name: "课程"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
key: "DEV"
-
type: "view"
type: "click"
name: "资源"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
key: "DEV"
-
name: "更多"
@ -22,14 +22,6 @@ button:
type: "view"
name: "加入班级"
url: "https://www.trustie.net/"
-
type: "view"
name: "点名"
url: "https://www.trustie.net/organizations/1/downloads"
-
type: "click"
name: "反馈"
key: "FEEDBACK"
-
type: "view"
name: "历史推文"

View File

@ -785,6 +785,13 @@ RedmineApp::Application.routes.draw do
end
end
resources :quality_analysis, :only => [:index, :new, :create] do
collection do
end
member do
end
end
# resources :files, :only => [:index, :new, :create] do
# member do
# match "quote_resource_show_project",:via => [:get]
@ -905,6 +912,7 @@ RedmineApp::Application.routes.draw do
# repositories routes
get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats', :as => "stats_repository_project"
get 'projects/:id/repository/:repository_id/quality_analysis', :to => 'repositories#quality_analysis', :as => "quality_analysis"
get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes'
@ -923,6 +931,7 @@ RedmineApp::Application.routes.draw do
}
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/graph', :to => 'repositories#graph'
get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes'

View File

@ -5,14 +5,14 @@ default: &default
# Or if using public account, only need above two line
# guange test
appid: "wxf694495398c7d470"
secret: "743e038392f1d89540e95f8f7645849a"
#appid: "wxf694495398c7d470"
#secret: "743e038392f1d89540e95f8f7645849a"
# appid: "wx8e1ab05163a28e37"
# secret: "beb4d3bc4b32b3557811680835357841"
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: "1234567"
access_token: ".access_token"
encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
@ -30,4 +30,4 @@ development:
<<: *default
test:
<<: *default
<<: *default

View File

@ -0,0 +1,11 @@
class CreateQualityAnalyses < ActiveRecord::Migration
def change
create_table :quality_analyses do |t|
t.integer :project_id
t.string :author_login
t.string :rep_identifier
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddJkVersionToQualityAnalysis < ActiveRecord::Migration
def change
add_column :quality_analyses, :sonar_version, :integer, :default => false
end
end

View File

@ -0,0 +1,6 @@
class AddColumnToQualityAnalyses < ActiveRecord::Migration
def change
add_column :quality_analyses, :path, :string
add_column :quality_analyses, :branch, :string
end
end

View File

@ -0,0 +1,5 @@
class AddLanguaeToQualityAnalyses < ActiveRecord::Migration
def change
add_column :quality_analyses, :language, :string
end
end

View File

@ -0,0 +1,5 @@
class AddNameToQualityAnalyses < ActiveRecord::Migration
def change
# add_column :quality_analyses, :language, :string
end
end

View File

@ -327,28 +327,28 @@ function enablePasteImg(_editor) {
};
$(nodeBody).on('pasteImage', function(ev, data) {
console.log('pasteImage');
console.log("dataURL: " + data.dataURL);
console.log("width: " + data.width);
console.log("height: " + data.height);
var blob = dataURItoBlob(data.dataURL);
if (data.blob !== null) {
var data = new FormData();
data.append("imgFile",blob, "imageFilename.png");
console.log(data);
$.ajax({
url: '/kindeditor/upload?dir=image',
contentType: false,
type: 'POST',
data: data,
processData: false,
success: function(data) {
console.log(data);
editor.exec('insertimage', JSON.parse(data).url);
}
});
}
//粘贴图片时走这里会出现两张图片走df()即可
// console.log('pasteImage');
// console.log("dataURL: " + data.dataURL);
// console.log("width: " + data.width);
// console.log("height: " + data.height);
// var blob = dataURItoBlob(data.dataURL);
// if (data.blob !== null) {
// var data = new FormData();
// data.append("imgFile",blob, "imageFilename.png");
// console.log(data);
// $.ajax({
// url: '/kindeditor/upload?dir=image',
// contentType: false,
// type: 'POST',
// data: data,
// processData: false,
// success: function(data) {
// console.log(data);
// editor.exec('insertimage', JSON.parse(data).url);
// }
// });
// }
});
return;
};
@ -371,7 +371,8 @@ function df(myself) {
sstr += that.attr("src") + "|";
}
else if (that.attr("src").indexOf("data:image") >= 0){
that.parents().removeAttr("href"); //删除所有父节点的href
//去掉外链
// that.parents().removeAttr("href"); //删除所有父节点的href
}
}
});
@ -421,10 +422,10 @@ function uploadpic(piclist,myself) {
//复制过来带的链接class等都要去掉 和视频图片有关系
that.removeAttr("class");
that.parent().removeAttr("class");
that.parents().removeAttr("href"); //删除所有父节点的href
// that.parent().removeAttr("href");
that.parent().removeAttr("data-ke-src");
//去掉外链
// that.parent().removeAttr("class");
// that.parents().removeAttr("href"); //删除所有父节点的href
// that.parent().removeAttr("data-ke-src");
tIndex = tIndex + 1;
}
}

View File

@ -7,7 +7,8 @@
</div>
</div>
<div class="share-code-wrap">
<a ng-click="share()" href="javascript:void(0);" class="share-code-btn">分享邀请码</a>
<!--<a ng-click="share()" href="javascript:void(0);" class="share-code-btn">分享邀请码</a>-->
<p/>
<div class="share-code-instruction"> 1.将此页面分享给好友,邀请好友加入班级<br />
2.通过微信扫一扫加入班级<br />
3.输入邀请码加入班级</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -547,6 +547,7 @@ function observeSearchfield(fieldId, targetId, url) {
$.ajax({
url: url,
type: 'get',
dataType: 'jsonp',
data: {q: $this.val()},
success: function(data){ if(targetId) $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
@ -1289,7 +1290,24 @@ function clear_data(k,mdu){
}
}
function expand_reply(container, btnid, id, type, div_id) {
function expand_reply(container,btnid){
var target = $(container).children();
var btn = $(btnid);
if(btn.data('init')=='0'){
btn.data('init',1);
btn.html('收起回复');
target.show();
}else{
btn.data('init',0);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
}
function expand_all_reply(container, btnid, id, type, div_id) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {

View File

@ -1,19 +1,20 @@
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>0&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]);
var app=angular.module("wechat",["ngRoute"]);app.constant("config",{rootPath:"/assets/wechat/",rootUrl:"/",apiUrl:"/api/v1/"}),app.run(["$rootScope","auth","$location","$routeParams",function(t,a,e,r){g_redirect_path&&g_redirect_path.length>1&&(e.path(g_redirect_path),g_redirect_path=null),t.$on("$routeChangeError",function(t,a,r){a&&a.templateUrl&&(a.templateUrl.endsWith("login.html")||a.templateUrl.endsWith("reg.html")||e.path("/login"))}),t.$on("$routeChangeStart",function(t,a,e){})}]);
app.factory("alertService",function(){function t(){this.title=null,this.message=null,this.visible=null,this.cb=null}return t.prototype.showMessage=function(t,e,n){this.message=e,this.title=t,this.visible=!0,this.cb=n},t.prototype.dismiss=function(){this.message=null,this.title=null,this.visible=!1,this.cb&&this.cb()},{create:function(){return new t}}}),app.factory("auth",["$http","$routeParams","$q","session","config",function(t,e,n,o,a){var i=function(){var a=n.defer(),i=c();if(i&&i.length>10)a.resolve(i);else{window.g_code||e.code||o.get("code");t.post("/wechat/get_bind",{}).then(function(t){0!=t.data.status?a.reject(t.data.message):(o.save("token",t.data.token),a.resolve(t.data.token))})["catch"](function(t){a.reject(t)})}return a.promise},c=function(){return o.get("token")};return{get_bind:i,token:c}}]),app.factory("session",function(){return{save:function(t,e){sessionStorage.setItem(t,e)},get:function(t){return sessionStorage.getItem(t)}}}),app.factory("rms",function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]};return{save:e,get:n}}),app.factory("common",["$http","auth","$routeParams",function(t,e,n){var o=function(n,o,a,i){if(a.comment&&!(a.comment.length<=0)){var c=a.comment.replace(/\n/g,"<br/>"),s={type:o,content:c,token:e.token()};a.disabled=!0,t({method:"POST",url:apiUrl+"new_comment/"+n,data:s}).then(function(t){a.disabled=!1,"function"==typeof i&&i()},function(t){})}},a=function(n,o){return t({method:"GET",url:apiUrl+o+"/"+n+"?token="+e.token()})},i=function(n){n.praise_count+=1,n.has_praise=!0,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},c=function(n){n.praise_count-=1,n.has_praise=!1,t({method:"POST",url:apiUrl+"praise/"+n.act_id,data:{token:e.token(),type:n.act_type}}).then(function(t){console.log(t.data)},function(t){})},s=function(t){t.scope.formData={comment:""};var e=function(e){a(e,t.type).then(function(e){t.loadCallback(e.data)},function(t){})};e(t.id),t.scope.addReply=function(n){console.log(n.comment),o(t.id,t.replyType,n,function(){t.scope.formData={comment:""},e(t.id),"function"==typeof t.replyCallback&&t.replyCallback()})},t.scope.addPraise=i,t.scope.decreasePraise=c};return{init:s,addCommonReply:o,loadCommonData:a,addCommonPraise:i,decreaseCommonPraise:c}}]);
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]);
app.filter("safeHtml",["$sce",function(t){return function(n){return t.trustAsHtml(n)}}]),app.filter("identify",function(){return function(t){return"TeachingAsistant"==t?"教辅":""}});
app.controller("ActivityController",["$anchorScroll","$location","$scope","$http","$timeout","auth","rms","common","alertService",function(a,t,e,o,i,c,n,r,s){e.replaceUrl=function(a){return a},e.alertService=s.create(),console.log("ActivityController load"),e.page=n.get("page")||0,e.activities=n.get("activities")||[],e.has_more=n.get("has_more"),e.loadActData=function(a){e.page=a,o({method:"POST",url:apiUrl+"activities",data:{token:c.token(),page:a}}).then(function(a){a.data.page>0?e.activities=e.activities.concat(a.data.data):e.activities=a.data.data,n.save("activities",e.activities),e.has_more=a.data.count+10*a.data.page<a.data.all_count,n.save("has_more",e.has_more),n.save("page",a.data.page),console.log(a.data)},function(a){})},e.activities.length<=0?e.loadActData(0):i(function(){window.scrollTo(0,n.get("yoffset"))}),e.goDetail=function(a,e,o){n.save("yoffset",window.document.body.scrollTop),t.path("/"+a+"/"+e)},e.addPraise=function(a){r.addCommonPraise(a)},e.decreasePraise=function(a){r.decreaseCommonPraise(a)}}]);
app.controller("AddClassController",["$scope",function(o){}]);
app.controller("BlogController",["$scope","$http","$routeParams","auth","common",function(o,l,t,n,a){a.init({id:t.id,scope:o,type:"blog_comments",replyType:"BlogComment",loadCallback:function(l){o.blog=l.data},replyCallback:function(){}})}]);
app.controller("CourseNoticeController",["$scope","$http","$routeParams","auth","common",function(o,e,t,n,a){a.init({id:t.id,scope:o,type:"newss",replyType:"News",loadCallback:function(e){o.news=e.data},replyCallback:function(){}})}]);
app.controller("DiscussionController",["$scope","$http","$routeParams","auth","common",function(o,s,a,e,n){n.init({id:a.id,scope:o,type:"messages",replyType:"Message",loadCallback:function(s){o.discussion=s.data},replyCallback:function(){}})}]);
app.controller("HomeworkController",["$scope","$http","$routeParams","auth","common",function(o,e,l,n,r){r.init({id:l.id,scope:o,type:"whomeworks",replyType:"HomeworkCommon",loadCallback:function(e){console.log(e),o.homework=e.data},replyCallback:function(){}})}]);
app.controller("InviteCodeController",["$scope","$http","$routeParams","config","auth",function(t,e,i,n,o){var a=t;a.course={};var c=i.id;e.get(n.apiUrl+"courses/"+c+"?token="+o.token()).then(function(t){console.log(t.data),a.course=t.data.data}),a.share=function(){window.WeixinJSBridge.invoke("sendAppMessage",{appid:"wxf694495398c7d470",type:"link",data_url:"",img_url:"http://pnewsapp.tc.qq.com/newsapp_bt/0/9963967/640",img_height:370,img_width:550,link:"http://view.inews.qq.com/a/WXN2013101101385701",desc:"desc",title:"title"},function(t){})}}]);
app.controller("IssueController",["$scope","$http","$routeParams","auth","common",function(o,e,l,s,t){t.init({id:l.id,scope:o,type:"issues",replyType:"Issue",loadCallback:function(e){console.log(e),o.issue=e.data},replyCallback:function(){}})}]);
app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]);
app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,a,i,n,s,l){s.get_bind().then(function(){t.path("/activities")}),a.code&&l.save("code",a.code);var r=e;r.loginFailed=!1,r.alertService=i.create(),r.findPwdDialog=i.create(),r.login=function(a,i){return a.$setSubmitted(),console.log(i),a.$valid?(console.log(apiUrl+"auth"),void o.post(n.apiUrl+"users/wxbind",{login:i.login,password:i.password}).then(function(o){console.log(o.data),r.loginFailed=0!=o.data.status,e.loginFailed?r.alertService.showMessage("出错了",o.data.message):r.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){r.alertService.showMessage("出错了",e)})):void console.log(a.$error)},r.showBox=function(){r.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码谢谢")},r.goReg=function(){t.path("/reg")}}]);
app.controller("MyClassController",["$scope",function(o){}]);
app.controller("MyClassController",["$scope","config","$http","auth","$location","$routeParams",function(t,e,o,a,n,s){var c=t,r=s.id;c.currentTab=1,c.tab=function(t){c.currentTab=t,c.searchText="",console.log(c.currentTab),2==t&&c.students.length<=0&&o.get(e.apiUrl+"courses/students?token="+a.token()+"&course_id="+r).then(function(t){console.log(t.data),c.students=t.data.data})},c.course={},c.students=[],c.teachers=[],c.resources=[],c.invite=function(){n.path("/invite_code").search({id:r})},o.post(e.apiUrl+"courses/"+r+"/attachments",{token:a.token(),name:""}).then(function(t){c.resources=t.data.data}),o.get(e.apiUrl+"courses/"+r+"?token="+a.token()).then(function(t){console.log(t.data),c.course=t.data.data}),c.teachers.length<=0&&o.get(e.apiUrl+"courses/teachers?token="+a.token()+"&course_id="+r).then(function(t){console.log(t.data),c.teachers=t.data.data})}]);
app.controller("RegController",["$scope","$http","$location","alertService",function(e,o,a,r){var s=e;s.errDialog=r.create(),s.goLogin=function(){a.path("/login")},s.isagreed=!0,s.agreed=function(e){s.isagreed=!e},s.reg=function(e,a){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(a),void o.post(apiUrl+"users",{login:a.username,password:a.password,mail:a.email}).then(function(e){0!=e.data.status?s.errDialog.showMessage("出错了",e.data.message):s.errDialog.showMessage("提示","注册且绑定微信成功")},function(e){s.errDialo.showMessage("出错了",e.data)})):void console.log(e.$error)}}]);
app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]);
app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}});
app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}});
app.directive("loadingSpinner",["$http",function(i){return{restrict:"A",replace:!0,template:'<div ng-show="activeCalls>0" class="loading-bg"><div class="loading-box"><img src="/images/loading.gif" alt=""/><span>加载中...</span></div></div>'}}]);
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,r,t){var l=t.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},s=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",s("activities.html","ActivityController")).when("/issues/:id",s("issue_detail.html","IssueController")).when("/project_discussion/:id",s("project_discussion.html","DiscussionController")).when("/homework/:id",s("homework_detail.html","HomeworkController")).when("/course_notice/:id",s("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",s("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",s("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",s("blog_detail.html","BlogController")).when("/add_class",s("add_class.html","AddClassController")).when("/myclass",s("myclass.html","MyClassController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]);
app.config(["$routeProvider","$httpProvider","$locationProvider","config",function(e,o,t,r){var l=r.rootPath,n={delay:["auth",function(e){return e.get_bind()}]},i=function(e,o){return{templateUrl:l+e,controller:o,resolve:n}};e.when("/login",{templateUrl:l+"login.html",controller:"LoginController"}).when("/reg",{templateUrl:l+"reg.html",controller:"RegController"}).when("/activites",i("activities.html","ActivityController")).when("/issues/:id",i("issue_detail.html","IssueController")).when("/project_discussion/:id",i("project_discussion.html","DiscussionController")).when("/homework/:id",i("homework_detail.html","HomeworkController")).when("/course_notice/:id",i("course_notice.html","CourseNoticeController")).when("/course_discussion/:id",i("course_discussion.html","DiscussionController")).when("/journal_for_message/:id",i("jour_message_detail.html","JournalsController")).when("/blog_comment/:id",i("blog_detail.html","BlogController")).when("/add_class",i("add_class.html","AddClassController")).when("/myclass",i("myclass.html","MyClassController")).when("/invite_code",i("invite_code.html","InviteCodeController")).otherwise({redirectTo:"/activites"}),o.interceptors.push(["$q","$rootScope",function(e,o){return void 0==o.activeCalls&&(o.activeCalls=0),{request:function(e){return o.activeCalls+=1,e},requestError:function(e){return o.activeCalls-=1,e},response:function(e){return o.activeCalls-=1,e},responseError:function(e){return o.activeCalls-=1,e}}}])}]);

View File

@ -1372,6 +1372,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
.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;}
@ -1420,3 +1421,9 @@ a.pages-big{ width:50px;}
/*未登录回复提示*/
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}
/*更新资源文件的描述框*/
.H60 {height:60px !important;}
.W420 {width:420px;}
.W300 {width:300px !important;}
.W600{ width:600px;}

View File

@ -1553,6 +1553,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
.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;}
@ -1796,3 +1797,9 @@ input.new_loggin_input{
/*未登录回复提示*/
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}
/*更新资源文件的描述框*/
.H60 {height:60px !important;}
.W420 {width:420px;}
.W300 {width:300px !important;}
.W600{ width:600px;}

View File

@ -25,31 +25,31 @@ a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:15px;}
.por_h2_index{ font-size:18px; font-weight:normal; color:#3b94d6; width:100%; border-bottom:1px solid #e8e5e5; height:40px; line-height:40px;}
a.por_more_index{ font-size:12px; color:#999; }
.por_hotbar_left li{ width:365px; padding:12px 5px 12px 0; border-bottom:1px dashed #e8e5e5;}
a.por_hot_title{ font-size:16px; display:block; font-weight:bold; width:365px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.por_hot_txt{ color:#666; line-height:20px;max-height:60px;overflow:hidden;text-overflow:ellipsis;}
a.por_hot_title{ font-size:16px; display:block; width:365px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #02253f;}
.por_hot_txt{ color:#637379; line-height:20px;max-height:60px;overflow:hidden;text-overflow:ellipsis;}
.por_time{ color:#999;}
a.por_hot_name{color:#3b94d6;}
.por_hotbar_right{ padding:5px 0 5px 10px; margin-top:15px; width:300px; }
.por_hotbar_right img{ width:300px; height:246px;}
.por_hot_title_r{ font-size:16px; display:block; font-weight:bold; width:300px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.por_hot_title_r{ font-size:16px; display:block; width:300px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #02253f;}
.por_hot_txt_r{color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;}
.por_course{ }
.por_course_bar{ width:328px; margin:0 7px; padding:20px 0 0px;}
a.por_course_title{font-size:14px; margin-bottom:10px; display:block; font-weight:bold; width:328px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.por_course_title{font-size:16px; margin-bottom:10px; display:block; width:328px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #02253f;}
.por_course_bar img{ width:140px; height:100px; }
.por_course_txt { width:180px; margin-left:5px;color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;}
.por_course_txt { width:180px; margin-left:5px;color:#637379; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;}
.por_course_time{color:#3b94d6; margin-left:5px;}
.por_post{ padding-bottom:5px;}
.por_post_left{ width:394px; margin-top:15px;}
.por_post_left{ width:385px; margin-top:15px; margin-right: 9px;}
.por_post_leftbar img{ width:377px; height:163px;}
.por_post_leftbar { border-bottom:1px dashed #e8e5e5; padding-bottom:5px; margin-bottom:10px;}
a.por_post_title{font-size:18px; display:block; width:377px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.por_post_txt{color:#666; line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; }
a.por_post_title{font-size:18px; display:block; width:377px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; color: #02253f;}
.por_post_txt{color:#637379; line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; margin-bottom: 5px;}
.post_icons_grey{ width:4px; height:4px; margin:10px 5px 0 0; background-color:#b3b3b3; display:block; line-height:20px;}
.por_post_list li{ height:35px;}
.por_post_list li a{ font-size:14px; }
a.por_hidden_w390{ display:block; width:390px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.por_hidden_w270{ display:block; width:280px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.por_hidden_w390{ display:block; width:390px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; color: #02253f;}
a.por_hidden_w270{ display:block; width:280px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; color: #02253f;}
.por_post_right{ width:280px; border-left:1px solid #e8e5e5; margin-top:15px; padding-left:10px;}
.por_news_list li{ padding:15px 0; border-bottom:1px dashed #e8e5e5;}
.por_users_img{ width:40px; height:40px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
@ -57,11 +57,11 @@ a.por_hidden_w270{ display:block; width:280px; overflow:hidden; white-space: now
.por_news_p{ line-height:20px;max-height:40px;min-width:240px;overflow:hidden;text-overflow:ellipsis; }
a.por_zan{ background:url(../images/org_custom/icons_por.png) 0 -41px no-repeat; height:15px; width:20px; display:block; padding-left:15px; line-height:20px; color:#999;}
a.por_zan:hover{background:url(../images/org_custom/icons_por.png) -34px -42px no-repeat; color:#3b94d6; }
.por_hidden_w205{ font-size:14px; display:block; width:205px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.por_hidden_w205{ font-size:14px; display:block; width:205px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; color: #02253f;}
.por_projects{ padding-bottom:10px; margin-top:10px;}
.por_projects ul li{ padding:5px 0;}
.por_projects ul{ margin-top:5px;}
.por_project_p{ line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; margin-top:5px; margin-left:10px; color:#666; }
.por_project_p{ line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; margin-top:5px; margin-left:10px; color:#637379; margin-bottom: 5px;}
.por_project_li{border-bottom:1px dashed #ccc; padding-bottom:10px; margin-bottom:5px;}
.por_time a{ color:#3b94d6;}
.por_teachers{ margin-top:20px; }
@ -78,7 +78,7 @@ a.por_more_teacher{ font-size:12px; }
.por_teachers_li{ margin-top:10px;}
.por_teachers_li li{ padding:10px 0;}
.por_teachers_img{ width:60px; height:60px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
a.por_teachers_name{ display:block; width:75px; font-size:18px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.por_teachers_name{ display:block; width:75px; font-size:18px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; color: #02253f;}
.por_teachers_p{ font-size:14px; color:#999; width:150px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.por_teachers_span{ color:#999;}
.por_teachers_span a{ margin:0 5px; color:#999;}

View File

@ -1247,5 +1247,44 @@ a.pages-big{ width:50px;}
.red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
/*20160622质量分析*/
.analysis-tag-wrap {width:100%; color:#000; height:20px; line-height:20px; vertical-align:middle;}
.analysis-tag {width:10px; height:20px; background-color:#777;}
.analysis-block {padding:15px; border:1px solid #d9d9d9;}
.flex {display:flex;}
.analysis-genral {flex:1; display:block; text-align:center;}
.analysis-block-icon {background:url(../images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
.analysis-serious-icon {background:url(../images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
.analysis-main-icon {background:url(../images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
.analysis-secondary-icon {background:url(../images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
.analysis-info-icon {background:url(../images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;}
.quality-percentage {width:320px; height:14px; display:inline-block;}
.quality-percentage-rate {width:50%; height:14px; background-color:#0a6c99; display:inline-block;}
.image-cir {border-radius:50%;}
.analysis-genral-icon {position:absolute; padding:1px 5px; display:inline-block; top:5px;}
.contribute-list-avatar {width:80px; vertical-align:middle; text-align:center;}
.contribute-list-code {width:160px; vertical-align:middle; text-align:center;}
.contribute-list-problem {width:170px; vertical-align:middle; text-align:center;}
.contribute-list-rate {width:228px; vertical-align:middle; text-align:center;}
.contribute-list-height {height:80px;}
.contribute-list-line-height {line-height:80px;}
/*20160623分析结果*/
.analysis-result-list {padding:5px;}
.analysis-result-list:nth-of-type(odd){background:#fff;}/*奇数行*/
.analysis-result-list:nth-of-type(even){background:#f5f5f5;}/*偶数行*/
.analysis-result-name {width:200px; cursor:pointer;}
.analysis-result-version {width:90px; text-align:right; cursor:pointer;}
.analysis-result-loc {width:60px; text-align:right; cursor:pointer;}
.analysis-result-debt {width:160px; text-align:right; cursor:pointer;}
.analysis-result-time {width:150px; text-align:right; cursor:pointer;}
.analysis-name-icon {background:url(../images/code-analysis-icon.png) -2px -148px no-repeat; width:16px; height:16px; display:inline-block; vertical-align:middle;}
/*未登录回复提示*/
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}
/*更新资源文件的描述框*/
.H60 {height:60px !important;}
.W420 {width:420px;}
.W300 {width:300px !important;}
.W600{ width:600px;}

View File

@ -27,6 +27,7 @@ a.btn_message_free{ background:#ff5722; display:block; text-align:center; color
h2{ font-size:18px; }
h3{ font-size:14px; }
h4{ font-size:14px; }
.f8 {font-size:8px;}
.f12{font-size:12px; font-weight:normal;}
.f14{font-size:14px;}
.f16{font-size:16px;}
@ -130,6 +131,7 @@ h4{ font-size:14px; }
.mt12 { margin-top:12px !important;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
.mt35 {margin-top:35px;}
.ml70{margin-left: 70px;}
.mb0 {margin-bottom: 0px !important;}
.mb4{ margin-bottom:4px;}
@ -137,6 +139,8 @@ h4{ font-size:14px; }
.mb8 {margin-bottom:8px;}
.mb10{ margin-bottom:10px !important;}
.mb20{ margin-bottom:20px;}
.mb30 {margin-bottom:30px;}
.mb40 {margin-bottom:40px;}
.pl10 {padding-left:10px;}
.pl15{ padding-left:15px;}
.pl5{ padding-left:5px;}
@ -228,6 +232,7 @@ a.c_green{ color:#28be6c;}
.b_grey{ background: #F5F5F5;}
.b_dgrey{ background: #CCC;}
.c_white {color:#fff;}
.c_orange{color:#e8770d;}
.c_dark{ color:#2d2d2d;}
.c_lorange{ color:#ff9900;}
@ -239,6 +244,11 @@ a.c_green{ color:#28be6c;}
.c_dblue{ color:#09658c;}
.b_blue{background:#64bdd9;}
.b_green{background:#28be6c;}
.b_slow_yellow{background:#adde18;}
.b_yellow{background:#DDDF0D;}
.b_slow_red{background:#df8538;}
.b_green2 {background:#63c360;}
.b_red {background:#d60308;}
.b_w{ background:#fff !important;}
/*add by Tim*/
@ -341,6 +351,8 @@ a:hover.bgreen_n_btn{background:#08a384;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
.grey_border{border:1px solid #dddddd !important;}
.borderRadius {border-radius:5px;}
.tac {text-align:center;}
/* commonpic */
.pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
.pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}
@ -1167,4 +1179,7 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px;
/*未登录回复提示*/
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}
.reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
.reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
/*20160622代码分析弹窗*/
.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe QualityAnalysisController, :type => :controller do
end

View File

@ -0,0 +1,7 @@
FactoryGirl.define do
factory :quality_analyasis, class: 'QualityAnalysis' do
project_id 1
author_login "MyString"
rep_identifier "MyString"
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe QualityAnalysis, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end