This commit is contained in:
guange 2016-07-25 15:36:29 +08:00
commit fb91309646
168 changed files with 6019 additions and 425 deletions

View File

@ -1,25 +1,26 @@
#coding=utf-8
module Mobile
# require_relative 'middleware/error_handler'
# require_relative 'apis/auth'
# require_relative 'apis/users'
# require_relative 'apis/courses'
# require_relative 'apis/watches'
# require_relative 'apis/upgrade'
# require_relative 'apis/homeworks'
# require_relative 'apis/comments'
# require_relative 'apis/issues'
# require_relative 'apis/activities'
# require_relative 'apis/whomeworks'
# require_relative 'apis/newss'
# require_relative 'apis/journal_for_messages'
# require_relative 'apis/messages'
# require_relative 'apis/blog_comments'
# require_relative 'apis/new_comment'
# require_relative 'apis/praise'
# require_relative 'apis/resources'
# require_relative 'apis/syllabuses'
require_relative 'middleware/error_handler'
require_relative 'apis/auth'
require_relative 'apis/users'
require_relative 'apis/courses'
require_relative 'apis/watches'
require_relative 'apis/upgrade'
require_relative 'apis/homeworks'
require_relative 'apis/comments'
require_relative 'apis/issues'
require_relative 'apis/activities'
require_relative 'apis/whomeworks'
require_relative 'apis/newss'
require_relative 'apis/journal_for_messages'
require_relative 'apis/messages'
require_relative 'apis/blog_comments'
require_relative 'apis/new_comment'
require_relative 'apis/praise'
require_relative 'apis/resources'
require_relative 'apis/syllabuses'
require_relative 'apis/projects'
class API < Grape::API
version 'v1', using: :path
@ -75,6 +76,7 @@ module Mobile
mount Apis::Praise
mount Apis::Resources
mount Apis::Syllabuses
mount Apis::Projects
add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development?

View File

@ -6,10 +6,17 @@ module Mobile
resources :blog_comments do
desc "get special topic"
get ':id' do
post ':id' do
user = current_user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
blog = BlogComment.find params[:id]
present :data, blog, with: Mobile::Entities::BlogComment,user: user
present :data, blog, with: Mobile::Entities::BlogComment,user: user,type: type,page: page
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -397,7 +397,7 @@ module Mobile
authenticate!
course = Course.find(params[:course_id])
exercises = course.exercises.where("exercise_status <> 1").order("created_at desc")
exercises = course.exercises.where("exercise_status <> 1").reorder("created_at desc")
present :data,exercises,with:Mobile::Entities::Exercise,user: current_user
present :status,0
end

View File

@ -7,11 +7,17 @@ module Mobile
include IssuesHelper
desc "get special issuse"
get ':id' do
post ':id' do
authenticate!
user = current_user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
issue = Issue.find params[:id]
present :data, issue, with: Mobile::Entities::Issue,user: user
present :data, issue, with: Mobile::Entities::Issue,user: user,type: type,page: page
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -6,11 +6,18 @@ module Mobile
resources :journal_for_messages do
desc "get special journal"
get ':id' do
post ':id' do
authenticate!
user = current_user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
jour = JournalsForMessage.find params[:id]
present :data, jour, with: Mobile::Entities::Jours,user: user
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -6,11 +6,17 @@ module Mobile
resources :messages do
desc "get special topic"
get ':id' do
post ':id' do
authenticate!
user = current_user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
message = Message.find params[:id]
present :data, message, with: Mobile::Entities::Message,user: user
present :data, message, with: Mobile::Entities::Message,user: user,type: type,page: page
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -6,11 +6,17 @@ module Mobile
resources :newss do
desc "get special news"
get ':id' do
post ':id' do
authenticate!
user = current_user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
news = News.find params[:id]
present :data, news, with: Mobile::Entities::News,user: user
present :data, news, with: Mobile::Entities::News,user: user,type: type,page: page
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -0,0 +1,123 @@
#coding=utf-8
module Mobile
module Apis
class Projects < Grape::API
resources :projects do
desc "获取项目列表"
params do
requires :token, type: String
end
get do
authenticate!
ps = ProjectsService.new
projects = ps.user_projects(current_user)
present :data, projects, with: Mobile::Entities::Project,user: current_user
present :status, 0
end
desc "返回单个项目"
params do
requires :id, type: Integer
requires :token,type:String
end
route_param :id do
get do
# course = Course.find(params[:id])
ps = ProjectsService.new
project = ps.show_project(params,current_user)
if project[:status] != 9
{status:-1, message: '该项目不存在或已被删除啦' }
else
present :data, project, with: Mobile::Entities::Project,user: current_user
present :status, 0
end
end
end
desc "获取项目动态"
params do
requires :token, type: String
end
post 'auth' do
authenticate!
auth = 0
if (current_user.user_extensions && current_user.user_extensions.identity == 0 && current_user.allowed_to?(:add_course, nil, :global => true))
auth = 1
end
present :auth, auth
end
desc "获取项目"
params do
requires :token, type: String
end
post 'auth' do
authenticate!
auth = 0
if (current_user.user_extensions && current_user.user_extensions.identity == 0 && current_user.allowed_to?(:add_course, nil, :global => true))
auth = 1
end
present :auth, auth
end
desc "新建大纲"
params do
requires :token, type: String
requires :title, type: String, desc: '大纲标题'
requires :courses, type: Array[String], desc: '课程名'
end
post do
authenticate!
ss = SyllabusesService.new
sy = ss.create(current_user, params[:title],
params[:courses].map{|c| {name: c} })
if sy.new_record?
{status:-1, message: '创建大纲失败' }
else
present :data, sy, with: Mobile::Entities::Syllabus,user: current_user
present :status, 0
end
end
desc '编辑大纲'
params do
requires :token, type: String
requires :title, type: String, desc: '大纲标题'
# requires :add_courses, type: Array[String], desc: '课程名'
# requires :modify_courses, type: Array[Integer,String], desc: '课程名'
end
post ':id/edit' do
authenticate!
ss = SyllabusesService.new
#修改课程大纲
status = ss.edit(current_user, params)
if status == -1
{status:status, message: '修改课程信息失败' }
else
present :status, status
end
end
end
end
end
end

View File

@ -6,11 +6,23 @@ module Mobile
resources :whomeworks do
desc "get one homework"
get ':id' do
post ':id' do
authenticate!
user = current_user
homework = HomeworkCommon.find params[:id]
present :data, homework, with: Mobile::Entities::Whomework,user: user
#0一级回复的更多 1 二级回复的更多
type = params[:type] || 0
page = params[:page] || 0
if type == 0
homework = HomeworkCommon.find params[:id]
present :data, homework, with: Mobile::Entities::Whomework,user: user,type: type,page: page,comment_type: "homework"
else
jour = JournalsForMessage.find params[:id]
present :data, jour, with: Mobile::Entities::Jours,user: user,type: type,page: page,comment_type: "homework"
end
present :type, type
present :page, page
present :status, 0
end
end

View File

@ -25,10 +25,12 @@ module Mobile
elsif ac.act_type == "News"
ac.nil? || ac.act.nil? ? 0 : ac.act.comments.count
elsif ac.act_type == "Message" || ac.act_type == "BlogComment" || ac.act_type == "JournalsForMessage"
ac.nil? || ac.act.nil? ? 0 : ac.act.children.count
all_comments = []
ac.nil? || ac.act.nil? ? 0 : get_all_children(all_comments, ac.act).count
elsif ac.act_type == "Issue"
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count
end
when :subject
if ac.act_type == "HomeworkCommon"
ac.act.name unless ac.nil? || ac.act.nil?

View File

@ -25,7 +25,9 @@ module Mobile
when :act_id
u.id
when :comment_count
u.children.count
# u.children.count
all_comments = []
get_all_children(all_comments, u).count
end
end
end
@ -49,9 +51,19 @@ module Mobile
blog_comment_expose :id
blog_comment_expose :locked
blog_comment_expose :praise_count
expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt|
expose :all_children, using:Mobile::Entities::BlogComment do |c,opt|
if c.is_a? (::BlogComment)
c.children.reverse
if !opt[:children]
if c.parent.nil? && opt[:type] == 0
opt[:children] = true
all_comments = []
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = get_all_children(all_comments, c)[tStart..tEnd]
all_comments
end
end
end
end
expose :has_praise, if: lambda { |instance, options| options[:user] } do |instance, options|
@ -61,6 +73,63 @@ module Mobile
has_praise = obj.empty? ? false : true
has_praise
end
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, instance)
parents_reply.count
end
expose :parents_reply_bottom, using:Mobile::Entities::BlogComment do |c,opt|
if c.is_a? (::BlogComment)
#取二级回复的底楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
else
opt[:bottom] = true
parents_reply[0..0]
end
else
[]
end
end
end
expose :parents_reply_top, using:Mobile::Entities::BlogComment do |c,opt|
if c.is_a? (::BlogComment)
#取二级回复的顶楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2
tEnd = (opt[:page])*5+2 - 1
if tEnd >= parents_reply.count - 1
tEnd = parents_reply.count - 2
end
if tStart <= parents_reply.count - 2
parents_reply = parents_reply.reverse[tStart..tEnd]
parents_reply.reverse
else
[]
end
else
opt[:top] = true
parents_reply = parents_reply.reverse[0..1]
parents_reply.reverse
end
else
[]
end
end
end
end
end
end

View File

@ -99,12 +99,13 @@ module Mobile
homework_expose :coursename #所属班级名
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
current_user_is_teacher = false
current_user_is_teacher = is_course_teacher(current_user,instance.course)
current_user_is_teacher
if instance[:current_user_is_teacher].nil?
current_user = options[:user]
current_user_is_teacher = false
current_user_is_teacher = is_course_teacher(current_user,instance.course)
current_user_is_teacher
end
end
end
end
end

View File

@ -22,8 +22,10 @@ module Mobile
(get_user(issue.assigned_to_id)).login
when :issue_status
IssueStatus.find(issue.status_id).name
when :journals_count
when :comment_count
issue.journals.where("notes is not null and notes != ''").count
# all_comments = []
# get_all_children(all_comments, f).count
when :project_name
issue.project.name
when :praise_count
@ -47,7 +49,7 @@ module Mobile
issue_expose :issue_priority
issue_expose :issue_assigned_to
issue_expose :issue_status
issue_expose :journals_count
issue_expose :comment_count
issue_expose :project_name
issue_expose :praise_count
expose :issue_journals, using: Mobile::Entities::Journal do |f, opt|

View File

@ -17,14 +17,18 @@ module Mobile
case field
when :lasted_comment
time_from_now f.created_on
when :reply_count
f.children.count
when :comment_count
# f.children.count
all_comments = []
get_all_children(all_comments, f).count
when :praise_count
get_activity_praise_num(f)
when :act_type
'JournalsForMessage'
when :act_id
f.id
when :content
f.notes
end
end
end
@ -40,10 +44,10 @@ module Mobile
end
jours_expose :created_on
jours_expose :lasted_comment
jours_expose :notes
jours_expose :content
jours_expose :m_reply_id
jours_expose :m_parent_id
jours_expose :reply_count
jours_expose :comment_count
jours_expose :praise_count
expose :course,using:Mobile::Entities::Course do |f,opt|
if f.is_a?(::JournalsForMessage) && f[:jour_type] == "Course"
@ -53,9 +57,20 @@ module Mobile
expose :reply_user,using: Mobile::Entities::User do |f, opt|
f.at_user
end
expose :child_reply,using: Mobile::Entities::Jours do |f, opt|
expose :all_children,using: Mobile::Entities::Jours do |f, opt|
if f.is_a?(::JournalsForMessage)
f.children.reverse
# f.children.reverse
if !opt[:children] && opt[:comment_type].nil?
if f.parent.nil? && opt[:type] == 0
opt[:children] = true
all_comments = []
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = get_all_children(all_comments, f)[tStart..tEnd]
all_comments
end
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
@ -65,6 +80,78 @@ module Mobile
has_praise = obj.empty? ? false : true
has_praise
end
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
parents_reply = []
if options[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, instance)
elsif options[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, instance)
end
parents_reply.count
end
expose :parents_reply_bottom, using:Mobile::Entities::Jours do |f,opt|
if f.is_a? (::JournalsForMessage)
#取二级回复的底楼层
parents_reply = []
if opt[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, f)
elsif opt[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, f)
end
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
else
opt[:bottom] = true
parents_reply[0..0]
end
else
[]
end
end
end
expose :parents_reply_top, using:Mobile::Entities::Jours do |f,opt|
if f.is_a? (::JournalsForMessage)
#取二级回复的顶楼层
parents_reply = []
if opt[:comment_type].nil?
parents_reply = get_reply_parents_no_root(parents_reply, f)
elsif opt[:comment_type] == "homework"
parents_reply = get_reply_parents(parents_reply, f)
end
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2
tEnd = (opt[:page])*5+2 - 1
if tEnd >= parents_reply.count - 1
tEnd = parents_reply.count - 2
end
if tStart <= parents_reply.count - 2
parents_reply = parents_reply.reverse[tStart..tEnd]
parents_reply.reverse
else
[]
end
else
opt[:top] = true
parents_reply = parents_reply.reverse[0..1]
parents_reply.reverse
end
else
[]
end
end
end
end
end
end

View File

@ -30,6 +30,9 @@ module Mobile
'Message'
when :act_id
u.id
when :comment_count
all_comments = []
get_all_children(all_comments, u).count
end
end
end
@ -48,15 +51,26 @@ module Mobile
message_expose :board_id
message_expose :subject
message_expose :content
message_expose :replies_count
message_expose :comment_count
message_expose :praise_count
message_expose :created_on
message_expose :locked
message_expose :id
message_expose :lasted_comment
expose :message_children,using:Mobile::Entities::Message do |c,opt|
expose :all_children,using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
c.children.reverse
# c.children.reverse
if !opt[:children]
if c.parent.nil? && opt[:type] == 0
opt[:children] = true
all_comments = []
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = get_all_children(all_comments, c)[tStart..tEnd]
all_comments
end
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
@ -66,6 +80,63 @@ module Mobile
has_praise = obj.empty? ? false : true
has_praise
end
expose :parents_count, if: lambda { |instance, options| options[:user] } do |instance, options|
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, instance)
parents_reply.count
end
expose :parents_reply_bottom, using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
#取二级回复的底楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
if opt[:type] == 1
# opt[:bottom] = true
# parents_reply[opt[:page]..opt[:page]]
else
opt[:bottom] = true
parents_reply[0..0]
end
else
[]
end
end
end
expose :parents_reply_top, using:Mobile::Entities::Message do |c,opt|
if c.is_a? (::Message)
#取二级回复的顶楼层
parents_reply = []
parents_reply = get_reply_parents_no_root(parents_reply, c)
if parents_reply.count >= 2 && !opt[:top]
if opt[:type] == 1
opt[:bottom] = true
tStart = (opt[:page]-1)*5+2
tEnd = (opt[:page])*5+2 - 1
if tEnd >= parents_reply.count - 1
tEnd = parents_reply.count - 2
end
if tStart <= parents_reply.count - 2
parents_reply = parents_reply.reverse[tStart..tEnd]
parents_reply.reverse
else
[]
end
else
opt[:top] = true
parents_reply = parents_reply.reverse[0..1]
parents_reply.reverse
end
else
[]
end
end
end
end
end
end

View File

@ -24,6 +24,9 @@ module Mobile
'News'
when :act_id
f.id
when :comment_count
all_comments = []
get_all_children(all_comments, f).count
end
end
elsif f.is_a?(Hash) && !f.key?(field)
@ -67,7 +70,7 @@ module Mobile
#发布时间
news_expose :created_on
#评论数量
news_expose :comments_count
news_expose :comment_count
news_expose :praise_count
#课程名字
news_expose :course_name

View File

@ -0,0 +1,18 @@
module Mobile
module Entities
class Project < Grape::Entity
expose :name
expose :id
expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
can_setting = instance.user_id == current_user.id ? true : false
can_setting = false if instance.id.nil?
can_setting
end
expose :member_count, if: lambda { |instance, options| options[:user] } do |instance, options|
instance.members.count
end
end
end
end

View File

@ -26,7 +26,7 @@ module Mobile
wh.nil? || wh.homework_detail_manual.nil? ? nil : convert_to_time(wh.homework_detail_manual.evaluation_end, 1)
when :praise_count
get_activity_praise_num(wh)
when :whomework_journal_count
when :comment_count
wh.journals_for_messages.count
when :course_name
wh.course.name
@ -58,6 +58,7 @@ module Mobile
expose :anonymous_comment
expose :quotes
expose :is_open
expose :id
whomework_expose :act_type
whomework_expose :act_id
whomework_expose :course_name
@ -66,11 +67,19 @@ module Mobile
whomework_expose :evaluation_start
whomework_expose :evaluation_end
whomework_expose :praise_count
whomework_expose :whomework_journal_count
expose :journals_for_messages, using: Mobile::Entities::Jours do |f, opt|
whomework_expose :comment_count
expose :all_children, using: Mobile::Entities::Jours do |f, opt|
#f[:journals_for_messages] if f.is_a?(Hash) && f.key?(:journals_for_messages)
if f.is_a?(::HomeworkCommon)
f.journals_for_messages.reverse
# f.journals_for_messages.reverse
if !opt[:children] && opt[:type] == 0
opt[:children] = true
tStart = opt[:page]*5
tEnd = (opt[:page]+1)*5 - 1
all_comments = f.journals_for_messages.reorder("created_on desc")
all_comments[tStart..tEnd]
end
end
end
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|

View File

@ -18,6 +18,8 @@
class AttachmentsController < ApplicationController
layout "users_base"
before_filter :verify_authenticity_token, only: [:uploa]
before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete]
before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young
before_filter :delete_authorize, :only => [:destroy]

View File

@ -634,8 +634,11 @@ class CoursesController < ApplicationController
end
if @course
#发送微信消息
ss = SyllabusesService.new
ss.send_wechat_create_class_notice User.current,@course
count = ShieldWechatMessage.where("container_type='User' and container_id=#{User.current.id} and shield_type='Course' and shield_id=#{@course.id}").count
if count == 0
ss = SyllabusesService.new
ss.send_wechat_create_class_notice User.current,@course
end
respond_to do |format|
flash[:notice] = l(:notice_successful_create)
format.html {redirect_to course_url(@course)}

View File

@ -82,8 +82,8 @@ class QualityAnalysisController < ApplicationController
end
end
# sonar 缓冲,数据
sleep(3)
# sonar 缓冲,sonar生成数据
sleep(10)
# 获取sonar output结果
console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]

View File

@ -38,7 +38,7 @@ class RepositoriesController < ApplicationController
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, :quality_analysis]
# 链接gitlab
before_filter :connect_gitlab, :only => [:quality_analysis, :show]
before_filter :connect_gitlab, :only => [:quality_analysis, :show, :commit_diff, :find_project_repository]
# 版本库新增权限
before_filter :show_rep, :only => [:show]
accept_rss_auth :revisions
@ -48,7 +48,6 @@ class RepositoriesController < ApplicationController
include RepositoriesHelper
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
@ -548,8 +547,8 @@ update
# 每次提交对应的文件差异
def commit_diff
@commit_diff = $g.commit_diff(@project.gpid, params[:changeset])
@commit_details = $g.commit(@project.gpid, params[:changeset])
@commit_diff = @g.commit_diff(@project.gpid, params[:changeset])
@commit_details = @g.commit(@project.gpid, params[:changeset])
render :layout => 'base_projects'
end
@ -700,7 +699,8 @@ update
(render_404; return false) unless @repository
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s
# gitlab端获取默认分支
gitlab_branchs = $g.project(@project.gpid).default_branch
g = Gitlab.client
gitlab_branchs = g.project(@project.gpid).default_branch
@project.gpid.nil? ? (@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip) : (@rev = params[:rev].blank? ? gitlab_branchs : params[:rev].to_s.strip)
@rev_to = params[:rev_to]
unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)

View File

@ -221,8 +221,8 @@ class WechatsController < ActionController::Base
raise CoursesService::JoinCourseError.message(status[:state])
end
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
content: "课程名称: #{course.name}\n班级名称: #{course.name}\n任课老师: #{course.teacher.show_name}\n进入班级,和小伙伴愉快的学习吧!"} }
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
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities#/class?id='+course.id.to_s}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
@ -277,7 +277,7 @@ class WechatsController < ActionController::Base
user: user
)
ws = WechatService.new
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
render :json => {status:0, msg: "绑定成功"}
rescue Exception=>e
render :json => {status: -1, msg: e.message}

View File

@ -47,13 +47,11 @@ module RepositoriesHelper
end
# 获取文件目录的最新动态
def get_trees_last_changes(project_id, rev, ent_name)
g = Gitlab.client
def get_trees_last_changes(project_id, rev, ent_name, g)
begin
tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name)
tree_changes
rescue
logger.error("faile to get tress activities!")
rescue Exception => e
puts e
end
end
@ -65,7 +63,7 @@ module RepositoriesHelper
# 获取diff内容行号
def diff_line_num content
content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i
content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i
end
# 处理内容

View File

@ -64,14 +64,12 @@ class Changeset < ActiveRecord::Base
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
}
after_create :scan_for_issues,:refresh_changests#:be_user_score # user_score
after_update :be_user_score
# after_create :scan_for_issues,:refresh_changests#:be_user_score # user_score
# after_update :be_user_score
after_destroy :down_user_score
before_create :before_create_cs
# fq
# after_create :act_as_activity
# end
# before_create :before_create_cs
after_create :act_as_forge_activity
def revision=(r)
write_attribute :revision, (r.nil? ? nil : r.to_s)
@ -117,6 +115,12 @@ class Changeset < ActiveRecord::Base
self.user = repository.find_committer_user(self.committer)
end
# 项目中提交动态类型Changeset
# type0 为老版本即Trsutie数据 1为gitlab中获取的动态
def act_as_forge_activity
self.acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
end
def scan_for_issues
scan_comment_for_issue_ids
end

View File

@ -23,46 +23,52 @@ class ForgeActivity < ActiveRecord::Base
after_create :add_user_activity, :add_org_activity
before_destroy :destroy_user_activity, :destroy_org_activity
#在个人动态里面增加当前动态
# 在个人动态里面增加当前动态
# 版本库提交动态不显示在用户动态中
def add_user_activity
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'").first
if user_activity
user_activity.save
else
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
user_activity = UserActivity.where("act_type = 'Message' and act_id = #{self.forge_act.parent.id}").first
user_activity.created_at = self.created_at
if self.forge_act_type != "Changeset"
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'").first
if user_activity
user_activity.save
else
user_activity = UserActivity.new
user_activity.act_id = self.forge_act_id
user_activity.act_type = self.forge_act_type
user_activity.container_type = "Project"
user_activity.container_id = self.project_id
user_activity.user_id = self.user_id
user_activity.save
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
user_activity = UserActivity.where("act_type = 'Message' and act_id = #{self.forge_act.parent.id}").first
user_activity.created_at = self.created_at
user_activity.save
else
user_activity = UserActivity.new
user_activity.act_id = self.forge_act_id
user_activity.act_type = self.forge_act_type
user_activity.container_type = "Project"
user_activity.container_id = self.project_id
user_activity.user_id = self.user_id
user_activity.save
end
end
end
end
# 项目提交动态不显示在组织动态中
def add_org_activity
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
if org_activity
org_activity.updated_at = self.updated_at
org_activity.save
else
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
org_activity.created_at = self.created_at
if self.forge_act_type != "Changeset"
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
if org_activity
org_activity.updated_at = self.updated_at
org_activity.save
else
OrgActivity.create(:user_id => self.user_id,
:org_act_id => self.forge_act_id,
:org_act_type => self.forge_act_type,
:container_id => self.project_id,
:container_type => 'Project',
:created_at => self.created_at,
:updated_at => self.updated_at)
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
org_activity.created_at = self.created_at
org_activity.save
else
OrgActivity.create(:user_id => self.user_id,
:org_act_id => self.forge_act_id,
:org_act_type => self.forge_act_type,
:container_id => self.project_id,
:container_type => 'Project',
:created_at => self.created_at,
:updated_at => self.updated_at)
end
end
end
end

View File

@ -165,6 +165,7 @@ class Project < ActiveRecord::Base
scope :has_module, lambda {|mod|
where("#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s)
}
scope :not_deleted, lambda{where("status<>9")}
scope :active, lambda { where(:status => STATUS_ACTIVE) }
scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) }
scope :all_public, lambda { where(:is_public => true) }

View File

@ -335,6 +335,7 @@ class CoursesService
8, '您已经是该班级的教师了',
9, '您已经是该班级的教辅了',
10, '您已经是该班级的管理员了',
11, '该班级不存在或已被删除啦',
'未知错误,请稍后再试'
]
end
@ -348,6 +349,8 @@ class CoursesService
if course
if course_endTime_timeout? course
@state = 2
elsif course[:is_delete] == 1
@state = 11
else
if current_user.member_of_course?(course) #如果已经是成员
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
@ -392,7 +395,7 @@ class CoursesService
def homework_list params,current_user
course = Course.find(params[:id])
if course.is_public != 0 || current_user.member_of_course?(course)
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).order('created_at DESC')
bids = course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).page(params[:page] || 1).per(20).reorder('created_at DESC')
bids = bids.like(params[:name]) if params[:name].present?
homeworks = []
bids.each do |bid|
@ -495,7 +498,7 @@ class CoursesService
def course_attachments params
result = []
course = Course.find(params[:course_id])
attachments = course.attachments.where("is_publish = 1").order("created_on desc")
attachments = course.attachments.where("is_publish = 1").reorder("created_on desc")
if !params[:name].nil? && params[:name] != ""
attachments.each do |atta|
result << atta if atta.filename.include?(params[:name])
@ -632,7 +635,7 @@ class CoursesService
:homework_submit_num => bid.student_works.count,
:homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
:student_evaluation_part => get_evaluation_part( bid ,3),
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?,:current_user_is_teacher => is_course_teacher}
end

View File

@ -0,0 +1,140 @@
#coding=utf-8
class ProjectsService
include ApplicationHelper
# include CoursesHelper
def judge_can_setting(sy,user)
sy[:can_setting] = sy[:user_id] == user.id ? true : false
sy[:can_setting] = false if sy[:id].nil?
sy.courses.each do |c|
c[:can_setting] = false
member = c.members.where("user_id=#{user.id} and course_id=#{c.id}")[0]
roleName = member.roles[0].name if member
if roleName && (roleName == "TeachingAsistant" || roleName == "Teacher" )
c[:can_setting] = true
end
if c.tea_id == user.id
c[:can_setting] = true
end
end
sy
end
#获取指定用户的项目列表
def user_projects(user)
projects = user.projects.not_deleted.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updated_at ").order("updated_at desc")
projects
end
#显示项目
def show_project(params,current_user)
project = Project.find(params[:id])
# course.generate_invite_code
# course.generate_qrcode
# unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
# raise '403'
# end
# {:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0}
project
end
def after_create_course(course, user)
#unless User.current.admin?
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => user, :roles => [r])
m.project_id = -1
course_info = CourseInfos.new(:user_id => user.id, :course_id => course.id)
#user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
course.members << m
course.course_infos << course_info
end
def send_wechat_create_class_notice user,course
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count
if count == 0
ws = WechatService.new
title = "恭喜您创建班级成功。"
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情。"
end
end
#创建大纲
# params {title: '大纲名称', [{course}, {course}]}
def create(user, title, courses = [])
sy = Syllabus.new(title: title, user_id: user.id)
ActiveRecord::Base.transaction() do
sy.save!
courses.each do |course|
if ::Course === course
course.syllabus_id = sy.id
course.save!
send_wechat_create_class_notice user,course
elsif Hash === course
c = ::Course.new(course)
c.tea_id = user.id
c.syllabus_id = sy.id
c.update_default_value
c.is_public = 0
c.save!
after_create_course(c, user)
send_wechat_create_class_notice user,c
end
end
end
sy[:can_setting] = true
sy
end
#修改课程大纲的名称、班级名称、新增班级
def edit(user, option)
courses = []
status = -1
syllabus_id = option[:id]
sy = Syllabus.where("id=?",option[:id]).first
if sy && sy.user_id == user.id
syllabus_title = option[:title]
sy.title = syllabus_title
sy.save!
#修改班级名称
modify_courses = option[:modify_courses]
modify_courses.each do |c|
course = Course.where("id=?",c.id).first
if course && course.tea_id == user.id
course.name = c.name
!course.save
end
end
#新增班级
add_courses = option[:add_courses]
add_courses.each do |c|
course = Course.new()
course.name = c
course.tea_id = user.id
course.syllabus_id = sy.id
course.update_default_value
course.is_public = 0
course.save!
after_create_course(course, user)
send_wechat_create_class_notice user,course
end
status = 0
end
status
end
end

View File

@ -71,8 +71,8 @@ class SyllabusesService
count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count
if count == 0
ws = WechatService.new
title = "恭喜您创建班级成功"
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情"
title = "恭喜您创建班级成功"
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 0, "点击查看班级详情"
end
end

View File

@ -229,7 +229,7 @@ class WechatService
color:"#707070"
},
remark:{
value:"绑定成功后可使用微信查看Trustie平台最新动态",
value:"绑定成功后可使用微信查看Trustie平台最新动态",
color:"#707070"
}
}

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'new_user'%>
<%= stylesheet_link_tag 'css/public'%>
<div class="homepageContent BgBox">
<h2 class="BgBox_h2">关于我们</h2>
<div class="AgreementBox">

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'new_user'%>
<%= stylesheet_link_tag 'css/public'%>
<!--<div class="homepageContentContainer mb20" >-->
<div class="homepageContent BgBox mt10">
<h2 class="BgBox_h2">Trustie服务协议</h2>
@ -28,24 +28,5 @@
</div><!---BgBox end--->
<!--</div>&lt;!&ndash;-homepageContentContainer end-&ndash;&gt;-->
<script>
$(".resourcesList").mousedown(function(e) {
if (3 == e.which) {
document.oncontextmenu = function() {return false;}
$("#contextMenu").hide();
$("#contextMenu").attr("style","display: block; position: fixed; top:"
+ e.pageY
+ "px; left:"
+ e.pageX
+ "px; width: 80px;");
$("#contextMenu").show();
}
});
$(".resourcesList").click(function(e) {
$("#contextMenu").hide();
document.oncontextmenu = function() {return true;}
});
</script>
<!--</div>-->

View File

@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'new_user'%>
<%= stylesheet_link_tag 'leftside'%>
<%= stylesheet_link_tag 'css/common'%>
<%= stylesheet_link_tag 'css/public'%>
<script type="text/javascript">
$(document).ready(function(){

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'new_user'%>
<%= stylesheet_link_tag 'css/public'%>
<div class="homepageContentContainer ">
<div class="homepageContent BgBox">

View File

@ -9,7 +9,7 @@
</span>
<span class="add_attachment">
<% id ="file#{container.id}"%>
<a href="javascript:void(0);" class="AnnexBtn fl" style= "<%= ie8? ? 'display:none' : ''%>" onclick="$('#'+'<%= id %>').click();">上传附件</a>
<a href="javascript:void(0);" class="AnnexBtn fl mr10" style= "<%= ie8? ? 'display:none' : ''%>" onclick="$('#'+'<%= id %>').click();">上传附件</a>
<%= file_field_tag 'attachments[dummy][file]',
:id => "file#{container.id}",
:class => 'file_selector',

View File

@ -16,7 +16,7 @@
<span class="attachment">
<%= link_to truncate(history.filename,length: 35, omission: '...'),
download_history_attachment_path(history.id, history.filename),
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f_14 f_b link_file_a2 fl" %>
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f_14 f_b upload_filename fl" %>
<span class="fr">版本号:<%= history.version %></span>
<div class="cl"></div>
</span>

View File

@ -46,7 +46,7 @@
</li>
<li class=" ml90" >
<a class="blue_btn fl c_white" onclick="submit_new_bid('<%= bid_id%>');" href="javascript:void(0)"><%= l(:button_create)%></a>
<%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%>
<%= link_to l(:button_cancel), homework_course_path(@course), :class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
</ul>

View File

@ -13,7 +13,7 @@
<%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='cancelbtn' class="grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white" ><%= l(:button_submit)%></a>
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
</ul>
@ -33,7 +33,7 @@
<%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='cancelbtn' class="grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white"><%= l(:button_submit)%></a>
<% end %>

View File

@ -35,8 +35,8 @@
<div nhname='toolbar_container_' ></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
<p nhname='contentmsg_'></p>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="new_message_submit_btn_" >留言</a>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10 ml10 mb10">取消</a>
<a href="javascript:void(0);" class="blue_btn fr mt10" id="new_message_submit_btn_" >留言</a>
<% end %>
</div>
<% end %>

View File

@ -75,7 +75,7 @@
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>

View File

@ -92,7 +92,7 @@
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
<%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %>
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
<div class="cl"></div>
</li>
<% end %>

View File

@ -5,7 +5,7 @@
<!--</div>-->
<!--</div>-->
<%= stylesheet_link_tag 'org' %>
<%= stylesheet_link_tag 'css/org' %>
<div>
<div class="relateOrg fl">

View File

@ -12,7 +12,7 @@
<div class="NewsBannerName">班级动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<ul class="homepagePostType" style="width:90px; left:-80px;">
<li>
<ul class="homepagePostTypeHomework fl">
<li><%= link_to "全部动态", {:controller => "courses", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%></li>

View File

@ -34,7 +34,7 @@
<div id="poll_answers_<%=exercise_question.id%>">
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<li class="ur_item">
<label name='select_items' class='w56'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项<%=convert_to_char (index+1).to_s %><span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>

View File

@ -18,28 +18,28 @@
<div class="cl"></div>
<div>
<li class="ur_item">
<label name='select_items' class='w56'>选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[0]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[1]' placeholder='输入选项内容'>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[2]' placeholder='输入选项内容'/>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>
<li class="ur_item">
<label name='select_items' class='w56'>选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<label name='select_items' class='w60'>选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>
<input maxlength="200" type='text' name='question_answer[3]' placeholder='输入选项内容'/>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>

View File

@ -55,28 +55,28 @@
'<input value="<%=score %>" id="question_score" type="text" name="question_score" style="width:40px; text-align:center; padding-left:0px;"/>分'+
'</li><div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项A<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[0]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项B<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[1]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项C<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[2]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<label name="select_items" class="w56">选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<label name="select_items" class="w60">选项D<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<input maxlength="200" type="text" name="question_answer[3]" placeholder="输入选项内容"/>'+
'<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>'+
'<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>'+

View File

@ -14,7 +14,7 @@
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', courses_check_box_tags('courses[course][]', User.current.courses,course,file), :id => 'courses')%>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
<% end %>

View File

@ -14,7 +14,7 @@
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', org_subfields_check_box_tags('org_subfields[org_subfield][]',org_subfield.organization.org_subfields.where("field_type='Resource'"),file), :id => 'org_subfields')%>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
<% end %>

View File

@ -14,7 +14,7 @@
id: "relation_file_form" do %>
<%= hidden_field_tag(:file_id, file.id) %>
<%= content_tag('div', projects_check_box_tags('projects[project][]', User.current.projects,project,file), :id => 'projects', :class => "hidden")%>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
<% end %>

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'courses'%>
<%= stylesheet_link_tag 'css/courses'%>
<script>
function searchone4reload(fileid){
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";

View File

@ -8,7 +8,7 @@
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
<%= render :partial => 'files/org_upload_attachment_list', :locals => {:container => org}%>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_org_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %>
</div>

View File

@ -8,7 +8,7 @@
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
<%= render :partial => 'files/org_upload_attachment_list_banner', :locals => {:container => org}%>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_org_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %>
</div>

View File

@ -30,7 +30,7 @@
<div class="cl"></div>
</div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
<%= submit_tag '确定',:onclick=>'submit_resource();', :onfocus=>'this.blur()', :id=>'submit_resource', :class=>'sendSourceText fr' %>
<% end %>

View File

@ -10,7 +10,7 @@
<input type="hidden" name="course_attachment_type" value="<%= course_attachment_type%>">
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 fl" 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>-->
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
<% end %>

View File

@ -10,7 +10,7 @@
<input type="hidden" name="course_attachment_type" value="<%= project_attachment_type %>">
<%= render :partial => 'attachement_list',:locals => {:project => project} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 f14 ml10" 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>-->
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
<% end %>

View File

@ -23,7 +23,7 @@
</div>
<div class="cl"></div>
</div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %>
</div>

View File

@ -19,7 +19,7 @@
<div class="postDetailReply fr">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
</div>
<div class="postDetailDes" id = "postDetailDes_<%= topic.id %>"><%= topic.content.html_safe%>

View File

@ -1,5 +1,5 @@
<%= javascript_include_tag 'new_user' %>
<%= stylesheet_link_tag 'public'%>
<%= stylesheet_link_tag 'css/common','css/public'%>
<script>
function add_class(id){
if($("#"+id).hasClass("sortArrowActiveD")){

View File

@ -46,7 +46,7 @@
:method => 'get',
:title => l(:label_version_new),
:tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %>
<%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 ", :target => "_blank" %>
<%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 fl", :target => "_blank" %>
<!--<a href="javascript:viod(0)" class="pic_add mt5 ml5"></a>-->
<% end %>
</li>

View File

@ -79,4 +79,4 @@
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80"> 确定</a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50" > 取消 </a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>

View File

@ -57,7 +57,7 @@
<div class="problem_search fr" >
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" placeholder="请输入问题名称" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
<a href="javascript:void(0)" class="grey_btn fl ml10" onclick="nh_reset_form();" >清空</a>
<a href="javascript:void(0)" class="grey_btn fl ml10 f14" onclick="nh_reset_form();" >清空</a>
</div><!--problem_search end-->
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.project_score.issue_num %></a>
@ -96,13 +96,13 @@
<div class="fl">&nbsp;</div>
<div>
<input name="issue_create_date_start" nhname="date_val" type="hidden"/>
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
<%= calendar_for('issue_create_date_start_show') %>
</div>
<div style="float:left;">&nbsp;-&nbsp;</div>
<div>
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
<%= calendar_for('issue_create_date_end_show') %>
</div>
</div>

View File

@ -58,7 +58,7 @@
<div class="navHomepageProfile" id="navHomepageProfile">
<ul>
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像",:style=>"display:block;", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
<ul class="topnav_login_list none" id="topnav_login_list">
<li>
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>

View File

@ -17,7 +17,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -17,7 +17,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'header','jquery/jquery-ui-1.9.2','public', 'leftside','prettify', 'courses','share'%>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup'%>
<%= javascript_include_tag "course","header","attachments",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
@ -18,7 +18,7 @@
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header','new_user', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -15,7 +15,7 @@
<%= javascript_include_tag "ckeditor/ckeditor.js",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org', 'share' %>
<%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/courses','css/org','css/project', 'css/popup' %>
<%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','css/structure','css/public','repository','org' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -104,10 +104,10 @@
<div id="Footer">
<div class="footerAboutContainer">
<ul class="footerAbout">
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">关于我们</a>|</li>
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">贴吧交流</a></li>
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">关于我们</a>|</li>
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl"><a href="javascript:void(0);" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">贴吧交流</a></li>
</ul>
</div>
<div class="cl"></div>

View File

@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'header','scm','public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','repository','share' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','new_user','prettify','share',:media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','css/common','css/public','css/structure','css/courses','css/popup','prettify',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus'%>

View File

@ -20,7 +20,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -14,7 +14,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'public_new', 'leftside_new','prettify','users', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/common', 'css/structure','prettify','css/public', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "avatars",'prettify'%>

View File

@ -5,7 +5,7 @@
<title><%=h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= stylesheet_link_tag 'public', 'pleft', 'project', :media => 'all' %>
<%= stylesheet_link_tag 'css/common', 'css/structure', 'css/public','css/project', :media => 'all' %>
<%= javascript_include_tag "jquery.leanModal.min" %>

View File

@ -21,7 +21,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/common', 'css/structure', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user"%>

View File

@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'public', 'leftside', 'courses','header','prettify', 'org', 'syllabus'%>
<%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'syllabus'%>
<%= javascript_include_tag "course","header",'prettify' %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users','syllabus',:media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

View File

@ -16,7 +16,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public', :media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -16,7 +16,7 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header','new_user' ,:media => 'all'%>
<%= stylesheet_link_tag 'css/common','css/structure','css/public' ,:media => 'all'%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

View File

@ -8,7 +8,7 @@
<%= render :partial => 'form_course', :locals => {:f => f,:is_new => true} %>
<a href="javascript:void(0)" onclick="submitCoursesBoard();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'blue_btn grey_btn fl c_white'} )%>
<%= link_to l(:button_cancel), course_boards_path(@course), :class => "blue_btn grey_btn fl c_white"%>
<%= link_to l(:button_cancel), course_boards_path(@course), :class => "grey_btn fl c_white ml10"%>
<% end %>
</ul>
</div>

View File

@ -163,7 +163,7 @@
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div class="cl"></div>

View File

@ -105,7 +105,7 @@
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_submit),"javascript:void(0)",:onclick => 'course_board_submit_message_replay();' ,:class => "blue_btn fl c_white" ,:style=>"margin-left: 50px;"%>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fl c_white" %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fl c_white ml10" %>
<% end %>
</div>
<% end %>

View File

@ -197,7 +197,7 @@
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div class="cl"></div>

View File

@ -223,7 +223,7 @@
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
<% end %>
<div class="cl"></div>

View File

@ -1,5 +1,5 @@
<div class="fl">
<div id="RSide">
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">
<div id="users_tb_" class="users_tb_">
<ul>
<li id="users_tb_1" class="users_hovertab" onclick="x:HoverLi(1);">基本资料</li>
@ -197,12 +197,10 @@
<% end %>
</div><!--ctt end-->
</div><!--users_setting end-->
<!--users_setting end-->
</div>
<div id="search_school_result_list"
style="width: 205px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto!; !important;display: none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
<div id="search_school_result_list" style="width: 205px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display: none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<div id="WOpenWindow">
<a class="modal_close" href="#"></a>

View File

@ -37,10 +37,10 @@
<li class="ml40" >
<% if is_new %>
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'grey_btn fl c_white ml10' %>
<% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<%= link_to l(:button_cancel), news_path(@news), :class => 'grey_btn fl c_white ml10' %>
<% end %>
<div class="cl"></div>
</li>

View File

@ -30,10 +30,10 @@
<li class="ml40" >
<% if is_new %>
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'grey_btn fl c_white ml10' %>
<% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white'%>
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<%= link_to l(:button_cancel), news_path(@news), :class => 'grey_btn fl c_white ml10' %>
<% end %>
<div class="cl"></div>
</li>

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'courses' %>
<%= stylesheet_link_tag 'css/courses' %>
<div class="resources">
<div class="project_r_h" style="width: 720px;">
<h2 class="project_h2"> 组织成员</h2>

View File

@ -49,8 +49,8 @@
<div class="cl"></div>
</li>
<li class=" ml125" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_organization();" >创建</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<a href="javascript:void(0)" class="blue_btn fl c_white mr10 f14" onclick="submit_new_organization();" >创建</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white f14"%>
<div class="cl"></div>
</li>
<% end%>

View File

@ -10,7 +10,7 @@
<input type="hidden" name="course_id" value="<%= polls_group_id%>" />
<%= content_tag('div', poll_check_box_tags('polls[]', polls,polls_group_id), :id => 'courses',:style=> 'width: 300px;')%>
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" style="margin-left: 0px !important;" onclick="submit_quote();">导&nbsp;&nbsp;入</a>
<a href="javascript:void(0)" class="blue_btn grey_btn fl c_white " onclick="closeModal();">取&nbsp;&nbsp;消</a>
<a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>

View File

@ -11,7 +11,7 @@
<input type="hidden" name="in_project_toolbar" value="Y">
<%= render :partial => 'projects/upload_project_files_list',:locals => {:container => container} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a href="javascript:void(0);" class="fr grey_btn mr40 ml10" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %>
</div>

View File

@ -53,7 +53,7 @@
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_project();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>

View File

@ -5,7 +5,7 @@
<!--</div>-->
<!--</div>-->
<%= stylesheet_link_tag 'org' %>
<%= stylesheet_link_tag 'css/org' %>
<div>
<div class="relateOrg fl">
@ -16,7 +16,7 @@
<div id="search_orgs_result_list" class="ml20"></div>
<ul id="paginator" class="wlist ml20" style="float:none;"></ul>
<a href="javascript:void(0);" class="saveBtn db fl ml20 mr15 mb5" onclick="join_org(<%= @project.id %>);">关联</a>
<a href="javascript:void(0);" class="cancelBtn db fl" onclick="cancel_join_orgs();">取消</a>
<a href="javascript:void(0);" class="grey_btn db fl" onclick="cancel_join_orgs();">取消</a>
<% end %>
</div>
<div class="relatedList fr">

View File

@ -22,8 +22,8 @@
<td class="tl">
<a class="c_blue02"><%= 'shared' if version.project != @project %> <%= link_to_version version %></a>
</td>
<td class="description"><%= format_date(version.effective_date) %></td>
<td class="description tl" style="word-break:break-all;"><%=h version.description %></td>
<td class=""><%= format_date(version.effective_date) %></td>
<td class="tl" style="word-break:break-all;"><%=h version.description %></td>
<td class="status"><%= l("version_status_#{version.status}") %></td>
<!--<td class="sharing"><%#=h format_version_sharing(version.sharing) %></td>-->
<!--<td class="tl" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="">-->

View File

@ -11,7 +11,7 @@
<div class="NewsBannerName">项目动态</div>
<ul class="resourcesSelect" class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<ul class="homepagePostType2">
<li>
<ul class="homepagePostTypeHomework fl">
<li><%= link_to "全部动态", {:controller => "projects", :action => "show", :type => nil}, :class => "homepagePostTypeAll postTypeGrey" %></li>

View File

@ -21,7 +21,7 @@
<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"><%= @ha["function_complexity"].nil? ? 0 : @ha["function_complexity"] %>
<p class="fontBlue2 pr"><%= @ha["function_complexity"].to_i == 0 ? 0 : @ha["function_complexity"] %>
<span class="f10 c_white analysis-genral-icon <%= complexity_status(@ha["function_complexity"].to_i)[1] %> borderRadius">
<%= @ha["function_complexity"].nil? ? "良好" : complexity_status(@ha["function_complexity"].to_i)[0] %>
</span>
@ -32,7 +32,7 @@
<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"><%= @ha["duplicated_lines_density"].nil? ? 0 : @ha["duplicated_lines_density"] %>
<p class="fontBlue2 pr"><%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %>
<span class="f10 c_white analysis-genral-icon <%= duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[1] %> borderRadius">
<%= @ha["duplicated_lines_density"].nil? ? 0 : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>
</span>
@ -41,7 +41,7 @@
<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"><%= @ha["comment_lines_density"].nil? ? 0 : @ha["comment_lines_density"] %>
<p class="fontBlue2 pr"><%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %>
<span class="f10 c_white analysis-genral-icon <%= comment_lines_density_status(@ha["comment_lines_density"].to_i)[1] %> borderRadius">
<%= @ha["comment_lines_density"].nil? ? 0 : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>
</span>
@ -70,33 +70,33 @@
<div><span class="fontGrey3 mr30 fl">&nbsp;质量问题</span>
<span class="fontBlue2 w100 pInline">
<a class="fontBlue2 w70 pInline" target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false">
<%= @ha["violations"].nil? ? 0 : @ha["violations"] %>
<%= @ha["violations"].to_i %>
</a>
</span><span class="fontGrey2">&nbsp;问题分类如下:</span></div>
<div class="ml90 mt15">
<div class="mb10"><span class="analysis-block-icon mr5"></span><span class="fontGrey3 mr45">阻断</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=BLOCKER" class="fontBlue2 w70 pInline">
<%= @ha["blocker_violations"].nil? ? 0 : @ha["blocker_violations"] %>
<%= @ha["blocker_violations"].to_i %>
</a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@ha["blocker_violations"].nil? ? 0 : statistics_result_percentage(@ha["blocker_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=CRITICAL" class="fontBlue2 w70 pInline">
<%= @ha["critical_violations"].nil? ? 0 : @ha["critical_violations"] %>
<%= @ha["critical_violations"].to_i %>
</a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["critical_violations"].nil? ? 0 : statistics_result_percentage(@ha["critical_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MAJOR" class="fontBlue2 w70 pInline">
<%= @ha["major_violations"].nil? ? 0 : @ha["major_violations"] %>
<%= @ha["major_violations"].to_i %>
</a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["major_violations"].nil? ? 0 : statistics_result_percentage(@ha["major_violations"].to_i, 3000) %>%;"></span></span></div>
<div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=MINOR" class="fontBlue2 w70 pInline">
<%= @ha["minor_violations"].nil? ? 0 : @ha["minor_violations"] %>
<%= @ha["minor_violations"].to_i %>
</a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["minor_violations"].nil? ? 0 : statistics_result_percentage(@ha["minor_violations"].to_i, 3000) %>%;"></span></span></div>
<div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span>
<a target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false|severities=INFO" class="fontBlue2 w70 pInline">
<%= @ha["info_violations"].nil? ? 0 : @ha["info_violations"] %>
<%= @ha["info_violations"].to_i %>
</a>
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%= @ha["info_violations"].nil? ? 0 : statistics_result_percentage(@ha["info_violations"].to_i, 3000) %>%;"></span></span></div>
</div>
@ -107,23 +107,23 @@
<div class="analysis-block mt10 mb40 flex f14">
<div class="analysis-genral">
<p class="fontGrey3">代码行数</p>
<p class="fontBlue2"><%= @ha["lines"].nil? ? 0 : @ha["lines"] %></p>
<p class="fontBlue2"><%= @ha["lines"].to_i %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">文件</p>
<p class="fontBlue2"><%= @ha["lines"].nil? ? 0 : @ha["lines"] %></p>
<p class="fontBlue2"><%= @ha["files"].to_i %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">目录</p>
<p class="fontBlue2"><%= @ha["directories"].nil? ? 0 : @ha["directories"] %></p>
<p class="fontBlue2"><%= @ha["directories"].to_i %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">类</p>
<p class="fontBlue2"><%= @ha["classes"].nil? ? 0 : @ha["classes"] %></p>
<p class="fontBlue2"><%= @ha["classes"].to_i %></p>
</div>
<div class="analysis-genral">
<p class="fontGrey3">方法</p>
<p class="fontBlue2"><%=@ha["functions"].nil? ? 0 : @ha["functions"] %></p>
<p class="fontBlue2"><%= @ha["functions"].to_i %></p>
</div>
</div>
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>-->

View File

@ -4,7 +4,7 @@
<% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %>
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %>
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">

View File

@ -2,7 +2,7 @@
<span class="uploadText">评分设置</span>
<div class="mt15">
<span class="f14 fontGrey3 mr10">迟交扣分</span>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class=" markInput" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="markInput" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
<span class="f12 c_red ml10">请输入0-50数值</span>
</div>
<% if homework.anonymous_comment == 0 %>

View File

@ -18,7 +18,7 @@
<div class="cl"></div>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_syllabus();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>

Some files were not shown because too many files have changed in this diff Show More