Merge branch 'develop' into yuanke_youhua

This commit is contained in:
yuanke 2016-11-11 17:42:36 +08:00
commit 8561b890b8
93 changed files with 492 additions and 261 deletions

View File

@ -558,6 +558,35 @@ class CoursesController < ApplicationController
end end
end end
def delete_member
member = @course.members.find params[:member_id]
student_role = member.member_roles.where("role_id = 10").first
if member && member.deletable? && student_role
user_admin = CourseInfos.where("user_id = ? and course_id = ?", member.user_id, @course.id)
if user_admin.size > 0
user_admin.destroy_all
end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@course.id)
joined.destroy_all
if member.member_roles.count > 1
student_role.destroy
member.update_attribute("course_group_id", 0)
else
member.destroy
end
#移出课程发送消息
CourseMessage.create(:user_id => member.user_id, :course_id => @course.id, :course_message_type => "RemoveFromCourse", :viewed => false, :course_message_id => User.current.id)
@course_groups = @course.course_groups
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
@canShowCode = isCourseTeacher(User.current.id,@course)
respond_to do |format|
format.js
end
end
end
def handle_course courses, activities def handle_course courses, activities
course_activity_count_array=activities.values() course_activity_count_array=activities.values()
course_array=[] course_array=[]
@ -800,11 +829,11 @@ class CoursesController < ApplicationController
end end
if @course if @course
#发送微信消息 #发送微信消息
count = ShieldWechatMessage.where("container_type='User' and container_id=#{User.current.id} and shield_type='Course' and shield_id=#{@course.id}").count # 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 # if count == 0
ss = SyllabusesService.new # ss = SyllabusesService.new
ss.send_wechat_create_class_notice User.current,@course # ss.send_wechat_create_class_notice User.current,@course
end # end
respond_to do |format| respond_to do |format|
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
format.html {redirect_to course_url(@course)} format.html {redirect_to course_url(@course)}

View File

@ -235,7 +235,9 @@ class IssuesController < ApplicationController
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1 @issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0 @issue.fixed_version_id = nil if @issue.fixed_version_id == 0
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
if @issue.save if @issue.save
#params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0
senduser = User.find(params[:issue][:assigned_to_id]) senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id issue_id = @issue.id
issue_title = params[:issue][:subject] issue_title = params[:issue][:subject]
@ -282,15 +284,18 @@ class IssuesController < ApplicationController
# 用户编辑更改issue # 用户编辑更改issue
def update def update
# params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0
if params[:issue_detail] if params[:issue_detail]
issue = Issue.find(params[:id]) issue = Issue.find(params[:id])
issue = update_user_issue_detail(issue, params) issue = update_user_issue_detail(issue, params)
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
@saved = update_user_issue_detail(issue, params) @saved = update_user_issue_detail(issue, params)
return return
else else
# 修改实例变量的值 # 修改实例变量的值
return unless update_issue_from_params return unless update_issue_from_params
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) @issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
saved = false saved = false
begin begin
@saved = @issue.save_issue_with_child_records(params, @time_entry) @saved = @issue.save_issue_with_child_records(params, @time_entry)

View File

@ -337,7 +337,7 @@ class MembersController < ApplicationController
else else
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
@member.course_group_id = 0 @member.course_group_id = 0
end end
@ -423,7 +423,7 @@ class MembersController < ApplicationController
end end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
@roles = Role.givable.all[3..5] @roles = Role.givable.all[3..5]
@members = @course.member_principals.includes(:roles, :principal).all.sort @members = @course.member_principals.includes(:roles, :principal).all.sort

View File

@ -27,7 +27,7 @@ class ProjectsController < ApplicationController
menu_item :feedback, :only => :feedback menu_item :feedback, :only => :feedback
menu_item :share, :only => :share menu_item :share, :only => :share
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project, :forked_pop] before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar] before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar]
@ -598,7 +598,9 @@ class ProjectsController < ApplicationController
end end
def member_forked def member_forked
@members_forked = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;") @forked_projects = Project.where(:forked_from_project_id => @project.id)
# @forked_members = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;")
end end
def update_message_status(user, project) def update_message_status(user, project)

View File

@ -597,14 +597,14 @@ class StudentWorkController < ApplicationController
@student_work_project.student_work_id = student_work.id @student_work_project.student_work_id = student_work.id
@student_work_project.save @student_work_project.save
elsif @homework.homework_detail_group.base_on_project == 0 elsif @homework.homework_detail_group.base_on_project == 0
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => student_work.project_id, :user_id => student_work.user_id, :is_leader => 1) stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => student_work.project_id, :user_id => student_work.user_id, :is_leader => 1, :course_id => @homework.course_id)
stu_project.save stu_project.save
end end
members = params[:group_member_ids].split(',') members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1 for i in 1 .. members.count-1
stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>members[i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time) stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>members[i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
if stu_work.save if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0) stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0, :course_id => @homework.course_id)
stu_project.save stu_project.save
end end
end end
@ -662,7 +662,7 @@ class StudentWorkController < ApplicationController
for i in 1 .. members.count-1 for i in 1 .. members.count-1
stu_work = StudentWork.new(:name => @work.name, :description => @work.description,:user_id=> members[i].to_i, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time) stu_work = StudentWork.new(:name => @work.name, :description => @work.description,:user_id=> members[i].to_i, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
if stu_work.save if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0) stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0, :course_id => @homework.course_id)
stu_project.save stu_project.save
end end
end end
@ -1095,6 +1095,7 @@ class StudentWorkController < ApplicationController
@project.project_id = params[:projectName].to_i @project.project_id = params[:projectName].to_i
@project.user_id = User.current.id @project.user_id = User.current.id
@project.is_leader = 1 @project.is_leader = 1
@project.course_id = @homework.course_id
if @project.save if @project.save
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i @hw_status = params[:hw_status].to_i
@ -1180,7 +1181,7 @@ class StudentWorkController < ApplicationController
unless work unless work
stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>params[:member_id][i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => Time.now) stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>params[:member_id][i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => Time.now)
if stu_work.save if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => params[:member_id][i].to_i, :is_leader => 0) stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => params[:member_id][i].to_i, :is_leader => 0, :course_id => @homework.course_id)
stu_project.save stu_project.save
end end
end end

View File

@ -125,7 +125,7 @@ class WatchersController < ApplicationController
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id]) joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
end end
respond_to do |format| respond_to do |format|

View File

@ -102,7 +102,11 @@ class WordsController < ApplicationController
@user_activity_id = params[:user_activity_id] if params[:user_activity_id] @user_activity_id = params[:user_activity_id] if params[:user_activity_id]
@activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id] @activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id]
unless @activity unless @activity
redirect_to feedback_path(@user) if params[:user_activity_id] == params[:activity_id]
redirect_to feedback_path(@user)
else
redirect_to user_path(@user)
end
return return
end end
elsif @journal_destroyed.jour_type == 'HomeworkCommon' elsif @journal_destroyed.jour_type == 'HomeworkCommon'

View File

@ -54,6 +54,18 @@ module ApplicationHelper
Project.find(forked_from_project_id) Project.find(forked_from_project_id)
end end
# 判断当前用户是否已经fork过当前项目
# project: current_project
def has_forked_cur_project project
cur_user_projects = Project.where(:user_id => User.current.id)
if cur_user_projects.count == 0
false
else
has_forked = cur_user_projects.select{|cur_user_project| cur_user_project.forked_from_project_id == project.id}
has_forked.length > 0 ? true : false
end
end
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换 # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail def get_user_by_mail mail
user = User.find_by_mail(mail) user = User.find_by_mail(mail)
@ -1013,7 +1025,7 @@ module ApplicationHelper
def project_member_check_box_tags_ex name, principals def project_member_check_box_tags_ex name, principals
s = '' s = ''
principals.each do |principal| principals.each do |principal|
s << "<li class='mb5'>#{ check_box_tag name, principal.id, false, :id => nil} #{h link_to principal.userInfo, user_url_in_org( principal.id)}</li>\n" s << "<li class='mb5'>#{ check_box_tag name, principal.id, false, :id => nil} #{h link_to principal.userInfo, user_url_in_org( principal), :target => "_blank"}</li>\n"
end end
s.html_safe s.html_safe
end end
@ -2884,7 +2896,7 @@ module ApplicationHelper
end end
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
def user_for_homework_common homework,is_teacher def user_for_homework_common homework,is_teacher,work
count = homework.student_works.has_committed.count count = homework.student_works.has_committed.count
if User.current.member_of_course?(homework.course) if User.current.member_of_course?(homework.course)
if is_teacher #老师显示作品数量 if is_teacher #老师显示作品数量

View File

@ -895,7 +895,7 @@ module CoursesHelper
desc.html_safe desc.html_safe
end end
# 学生按作业总分排序,取前3 # 学生按作业总分排序,取前6
def hero_homework_score(course, score_sort_by) def hero_homework_score(course, score_sort_by)
sql_select = "SELECT members.*,( sql_select = "SELECT members.*,(
SELECT SUM(work_score) SELECT SUM(work_score)
@ -907,14 +907,15 @@ module CoursesHelper
FROM members FROM members
JOIN students_for_courses JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3" WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 6"
homework_scores = Member.find_by_sql(sql_select) homework_scores = Member.find_by_sql(sql_select)
end end
def contributor_course_scor(course_id) def contributor_course_scor(course_id)
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by ccs = CourseContributorScore.find_by_sql("SELECT ccs.*, (message_num*2 + message_reply_num + news_reply_num + news_num +
(message_num*2 + message_reply_num + news_reply_num + news_num + resource_num*5 + journal_num + homework_journal_num ) as con_score FROM `course_contributor_scores` ccs JOIN students_for_courses sfs
resource_num*5 + journal_num + homework_journal_num ) desc limit 3;") ON sfs.student_id = ccs.user_id AND sfs.course_id = ccs.course_id where ccs.course_id = #{course_id} order by
con_score desc limit 6;")
end end
#用户在该课程是否具有某个角色 #用户在该课程是否具有某个角色

View File

@ -39,7 +39,7 @@ module MembersHelper
end end
principals = paginateHelper scope,10 principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true){|text, parameters, options| links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
} }
s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" ) s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" )

View File

@ -49,6 +49,7 @@ class Course < ActiveRecord::Base
#has_many :course_journals_for_messages, :class_name => 'CourseJournalsForMessage', :as => :jour, :dependent => :destroy #has_many :course_journals_for_messages, :class_name => 'CourseJournalsForMessage', :as => :jour, :dependent => :destroy
has_many :news, :dependent => :destroy, :include => :author has_many :news, :dependent => :destroy, :include => :author
has_one :course_status, :class_name => "CourseStatus", :dependent => :destroy has_one :course_status, :class_name => "CourseStatus", :dependent => :destroy
has_many :student_work_projects, :dependent => :destroy
has_many :homework_commons, :dependent => :destroy has_many :homework_commons, :dependent => :destroy
has_many :student_works, :through => :homework_commons, :dependent => :destroy has_many :student_works, :through => :homework_commons, :dependent => :destroy

View File

@ -78,7 +78,7 @@ class JournalsForMessage < ActiveRecord::Base
:act_as_principal_activity, :act_as_student_score :act_as_principal_activity, :act_as_student_score
after_create :reset_counters! after_create :reset_counters!
#after_update :update_activity #after_update :update_activity
after_destroy :reset_counters! # after_destroy :reset_counters!
after_save :be_user_score after_save :be_user_score
after_destroy :down_user_score, :down_course_score after_destroy :down_user_score, :down_course_score

View File

@ -7,5 +7,13 @@ class StudentsForCourse < ActiveRecord::Base
validates_presence_of :course_id, :student_id validates_presence_of :course_id, :student_id
validates_uniqueness_of :student_id, :scope => :course_id validates_uniqueness_of :student_id, :scope => :course_id
after_destroy :delete_student_works
def delete_student_works
course = self.course
homework_ids = course.homework_commons.blank? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")"
student_works = StudentWork.where("user_id = #{self.student_id} && homework_common_id in #{homework_ids}")
student_works.destroy_all
end
end end

View File

@ -322,8 +322,9 @@ class User < Principal
end end
# id 转换成 登录名 # id 转换成 登录名
# 如果是整数就去ID否则就取login
def to_param def to_param
self.login.to_i > 0 ? id : login self.login.to_i.to_s == self.login ? id : login
end end
@ -965,8 +966,12 @@ class User < Principal
#是否具有老师角色 #是否具有老师角色
def has_teacher_role(course) def has_teacher_role(course)
member = course.members.where("user_id = #{self.id}").first member = course.members.where("user_id = #{self.id}").first
role = MemberRole.where("member_id = #{member.id} and role_id in (3, 7, 9)") if !member.nil?
!role.blank? role = MemberRole.where("member_id = #{member.id} and role_id in (3, 7, 9)")
!role.blank?
else
return false
end
end end
#是否具有学生角色 #是否具有学生角色
@ -991,6 +996,13 @@ class User < Principal
# Admin users are authorized for anything else # Admin users are authorized for anything else
return true if admin? return true if admin?
course_ids = context.student_work_projects.blank? ? "(-1)" : "(" + context.student_work_projects.map{|swp| swp.course_id}.join(",") + ")"
courses = Course.where("id in #{course_ids}")
courses.each do |course|
if self.has_teacher_role(course)
return true
end
end
roles = roles_for_project(context) roles = roles_for_project(context)
return false unless roles return false unless roles
roles.any? {|role| roles.any? {|role|

View File

@ -207,7 +207,7 @@ class CoursesService
unless member.role_ids.include?(10) unless member.role_ids.include?(10)
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,c.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,c.id)
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
end end
@ -460,7 +460,7 @@ class CoursesService
@member.first.destroy @member.first.destroy
joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id]) joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id])
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
@state = 0 @state = 0
@state @state
@ -837,7 +837,7 @@ class CoursesService
member = Member.new(:role_ids =>[7], :user_id => params[:user_id],:course_id=>params[:course_id]) member = Member.new(:role_ids =>[7], :user_id => params[:user_id],:course_id=>params[:course_id])
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id)
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
member.course_group_id = 0 member.course_group_id = 0
members << member members << member
@ -858,7 +858,7 @@ class CoursesService
end end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:course_id]) joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:course_id])
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
end end
@ -1261,7 +1261,7 @@ class CoursesService
else else
joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:id]) joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:id])
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
member.course_group_id = 0 member.course_group_id = 0
end end
@ -1305,7 +1305,7 @@ class CoursesService
end end
joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,course.id)
joined.each do |join| joined.each do |join|
join.delete join.destroy
end end
roles = Role.givable.all[3..5] roles = Role.givable.all[3..5]
#移出课程发送消息 #移出课程发送消息

View File

@ -12,8 +12,8 @@ $("#attachment_history_popub").html('<%= escape_javascript( render :partial => '
$("#attachment_history_popub").html('<%= escape_javascript( render :partial => 'files/attachment_history_popub') %>'); $("#attachment_history_popub").html('<%= escape_javascript( render :partial => 'files/attachment_history_popub') %>');
<% end %> <% end %>
<% if params[:attachment_id] %> <% unless @attachment.container.nil? %>
$("#issue_upload_attachments").html('<%= escape_javascript( render :partial => 'attachments/form_attachments', :locals => { :container => @attachment.container }) %>'); $("#issue_upload_attachments").html('<%= escape_javascript( render :partial => 'attachments/form_attachments', :locals => { :container => @attachment.container }) %>');
<% end %> <% end %>
<% if @is_destroy%> <% if @is_destroy%>

View File

@ -1,3 +1,6 @@
$('#issue_confirm').removeAttr("disabled");
$('#issue_confirm').css('background-color', '#3b94d6');
$('#issue_confirm').css('cursor','pointer');
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>'); var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
<% if(!@attachment.nil? && @attachment.new_record?) %> <% if(!@attachment.nil? && @attachment.new_record?) %>
fileSpan.hide(); fileSpan.hide();

View File

@ -21,9 +21,9 @@
<ul class="list-file"> <ul class="list-file">
<li><span class="item_list fl"></span> <li><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"--> <% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %> <%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
<% else %> <% else %>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%> <%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
<% end %> <% end %>
<%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %> <%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<!--<span class="font_normal ml10 fr">[已设为首页]</span>--> <!--<span class="font_normal ml10 fr">[已设为首页]</span>-->

View File

@ -23,11 +23,8 @@
总得分为以上得分之和</div> 总得分为以上得分之和</div>
</div> </div>
<% contributor_course_scor(course.id).each do |contributor_score| %> <% contributor_course_scor(course.id).each do |contributor_score| %>
<% total_score = contributor_score.resource_num.to_i * 5 + contributor_score.message_num.to_i * 2 + <% total_score = contributor_score.con_score %>
contributor_score.message_reply_num.to_i * 1 + contributor_score.journal_num.to_i * 1 + <% if !total_score.nil? && total_score !=0 %>
+ contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
contributor_score.news_num.to_i * 1 %>
<% unless total_score ==0 %>
<li> <li>
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %> <%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %>
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p> <p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>

View File

@ -1,8 +1,9 @@
<% is_teacher = User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
<% if members.any? %> <% if members.any? %>
<table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0"> <table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0">
<thead> <thead>
<tr class="clear"> <tr class="clear">
<th class="sy_th7">序号</th> <th class="sy_th6">序号</th>
<th class="sy_th15">姓名</th> <th class="sy_th15">姓名</th>
<th class="sy_th15"> <th class="sy_th15">
<%= link_to '学号', member_score_sort_course_path(:sort_type => 'student_id', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> <%= link_to '学号', member_score_sort_course_path(:sort_type => 'student_id', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
@ -12,7 +13,7 @@
<a href="javascript:void(0)" class="sy_sortdownbtn"></a> <a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% end %> <% end %>
</th> </th>
<th class="sy_th0 sy_fenban_tap"> <th class="<%= is_teacher ? 'sy_th0' : 'sy_th1' %> sy_fenban_tap">
<%= link_to '作业得分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> <%= link_to '作业得分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "score" && @score_sort_by == 'desc' %> <% if @sort_type == "score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a> <a href="javascript:void(0)" class="sy_sortupbtn"></a>
@ -24,7 +25,7 @@
班级作业的得分总和</p> 班级作业的得分总和</p>
</div> </div>
</th> </th>
<th class="sy_th0 sy_fenban_tap"> <th class="<%= is_teacher ? 'sy_th0' : 'sy_th1' %> sy_fenban_tap">
<%= link_to '测评得分', member_score_sort_course_path(:sort_type => 'ex_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> <%= link_to '测评得分', member_score_sort_course_path(:sort_type => 'ex_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "ex_score" && @score_sort_by == 'desc' %> <% if @sort_type == "ex_score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a> <a href="javascript:void(0)" class="sy_sortupbtn"></a>
@ -36,7 +37,7 @@
班级测验的得分总和</p> 班级测验的得分总和</p>
</div> </div>
</th> </th>
<th class="sy_th0 sy_fenban_tap"> <th class="<%= is_teacher ? 'sy_th0' : 'sy_th1' %> sy_fenban_tap">
<%= link_to '社区得分', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :style => 'color:#000000;'%> <%= link_to '社区得分', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "act_score" && @score_sort_by == 'desc' %> <% if @sort_type == "act_score" && @score_sort_by == 'desc' %>
<a href="javascript:" class= "sy_sortupbtn"></a> <a href="javascript:" class= "sy_sortupbtn"></a>
@ -56,13 +57,16 @@
</p> </p>
</div> </div>
</th> </th>
<th class="sy_th0 sy_fenban_tap">总得分 <th class="<%= is_teacher ? 'sy_th0' : 'sy_th1' %> sy_fenban_tap">总得分
<div class="sy_fenban_show undis" style="width:180px;"> <div class="sy_fenban_show undis" style="width:180px;">
<p>积分规则<br/> <p>积分规则<br/>
作业得分+测评得分+社区得分</p> 作业得分+测评得分+社区得分</p>
</div> </div>
</th> </th>
<th class="sy_th13">分班</th> <th class="sy_th13">分班</th>
<% if is_teacher %>
<th class="sy_th3"></th>
<% end %>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -98,10 +102,10 @@
</td> </td>
<td class="pr"> <td class="pr">
<span class="sum_score_tip"><%= format("%0.2f", sum) %></span> <span class="sum_score_tip"><%= format("%0.2f", sum) %></span>
<div class="sy_tips_box_inner undis" style="left: 215px; top: -60px; text-align: left;"> <div class="sy_tips_box_inner undis" style="left: <%=is_teacher ? '230px' : '215px' %>; top: -60px; text-align: left;">
<span style="top: 75px;"></span> <span style="top: 75px;"></span>
<p > <p >
<font class="fb"><%= user.show_name %></font><br/> <font class="fb"><%= user.show_name %>(<%=user.login %>)</font><br/>
资源&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.resource_num.nil? ? 0 : member.resource_num %><br/> 资源&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.resource_num.nil? ? 0 : member.resource_num %><br/>
<font class="mr15">问答&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.message_num.nil? ? 0 : member.message_num %></font>回复数:<%= member.message_reply_num.nil? ? 0 : member.message_reply_num %><br/> <font class="mr15">问答&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.message_num.nil? ? 0 : member.message_num %></font>回复数:<%= member.message_reply_num.nil? ? 0 : member.message_reply_num %><br/>
<font class="mr15">通知&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.news_num.nil? ? 0 : member.news_num %></font>留言数:<%= member.news_reply_num.nil? ? 0 : member.news_reply_num %><br/> <font class="mr15">通知&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.news_num.nil? ? 0 : member.news_num %></font>留言数:<%= member.news_reply_num.nil? ? 0 : member.news_reply_num %><br/>
@ -112,7 +116,7 @@
</div> </div>
</td> </td>
<td> <td>
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? || User.current == user %> <% if is_teacher || User.current == user %>
<% if @course.course_groups.empty? %> <% if @course.course_groups.empty? %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% else %> <% else %>
@ -130,6 +134,11 @@
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% end %> <% end %>
</td> </td>
<% if is_teacher %>
<td>
<a href="javascript:void(0)" onClick="delete_confirm_box('<%=delete_member_course_path(@course, :member_id => member.id) %>', '确认删除该成员吗?');" class="sy_icons_del fl"></a>
</td>
<% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@ -5,8 +5,6 @@
<li> <li>
<span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span> <span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span>
<div class="fl" style="width:185px;"> <div class="fl" style="width:185px;">
<%= link_to e_course.syllabus.title, syllabus_path(e_course.syllabus_id), :target => '_blank', :class => "sy_class_ltitle"%>
&nbsp;<font class="fb c_grey">·</font>&nbsp;
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle mb10" %> <%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle mb10" %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -0,0 +1,4 @@
hideModal();
$("#member_li_<%=params[:member_id] %>").html("");
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");

View File

@ -15,7 +15,7 @@ alert("班级已过期\n请联系班级管理员重启班级。(在配置班级
alert("您已经加入了班级"); alert("您已经加入了班级");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 4 %> <% elsif @state == 4 %>
alert("您加入的班级不存在"); alert("您输入的邀请码错误");
<% elsif @state == 5 %> <% elsif @state == 5 %>
alert("您还未登录"); alert("您还未登录");
<% elsif @state == 6 %> <% elsif @state == 6 %>

View File

@ -18,13 +18,13 @@
<div class="cl"></div> <div class="cl"></div>
<li class="mt10 ml45"> <li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如计算机系2016秋季A班" onkeyup="regex_course_name('new');"> <input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如:软件工程计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<div class="cl"></div> <div class="cl"></div>
<span class="c_red ml80" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span> <span class="c_red ml80" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li> <li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例:软件工程计算机系2016秋季A班</span></li>
<li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li> <li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例计算机系2016秋季A班</span></li>
<!--<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>--> <!--<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>-->
<li class="mt10 ml45"> <li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>

View File

@ -39,14 +39,15 @@
</li> </li>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<span><%=@course.syllabus.title %></span> <span id="edit_syllabus_id"><%=@course.syllabus.title %></span>
<%#= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:210px'} %> <%#= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:210px'} %>
<!--<span class="c_red" id="edit_syllabus_notice">如果列表中没有对应的课程,请您先<%#=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>--> <!--<span class="c_red" id="edit_syllabus_notice">如果列表中没有对应的课程,请您先<%#=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>-->
</li> </li>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="edit_course_name" autocomplete="off" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>"> <input type="text" name="course[name]" id="edit_course_name" autocomplete="off" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
<span class="c_red" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span> <div class="cl"></div>
<span class="c_red ml80" id="edit_course_name_notice" style="display: none;">班级名称不能为空</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml45"> <li class="ml45">

View File

@ -62,7 +62,8 @@
<a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a> <a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a>
<% end %> <% end %>
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>--> <!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a> <!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
<input onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue fr mr5" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
</li> </li>
</ul> </ul>
<ul class="fl pro_new_conbox_right ml10 mb10"> <ul class="fl pro_new_conbox_right ml10 mb10">

View File

@ -61,7 +61,7 @@
<li class="clear"> <li class="clear">
<span class="pro_new_conbox_leftspan fl">指派给</span> <span class="pro_new_conbox_leftspan fl">指派给</span>
<span class="pro_new_conbox_rightspan fl ml10"> <span class="pro_new_conbox_rightspan fl ml10">
<a href="" class="c_blue" ><%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %></a></span> <a href="<%= @issue.assigned_to_id.nil? ? "javascript:void(0)" : user_path(@issue.assigned_to_id) %>" class="c_blue" ><%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %></a></span>
</li> </li>
<% end %> <% end %>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %> <% unless @issue.disabled_core_fields.include?('fixed_version_id') %>

View File

@ -6,7 +6,7 @@
<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %> <%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>
&nbsp;&gt;&nbsp; &nbsp;&gt;&nbsp;
<% if @course.syllabus %> <% if @course.syllabus %>
<%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey' %> <%=link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class => 'sy_cgrey', :title => '课程名称' %>
&nbsp;&gt;&nbsp; &nbsp;&gt;&nbsp;
<% end %> <% end %>
<%=link_to @course.name, course_path(@course), :class => 'sy_cgrey' %> <%=link_to @course.name, course_path(@course), :class => 'sy_cgrey' %>
@ -55,8 +55,6 @@
<div class="sy_class_info fl ml15"> <div class="sy_class_info fl ml15">
<div class="sy_class_titbox"> <div class="sy_class_titbox">
<h3 class="fl sy_class_title"> <h3 class="fl sy_class_title">
<%= link_to @course.syllabus.title, syllabus_path(@course.syllabus_id), :class =>'c_dark', :target => '_blank'%>
&nbsp;<font class="fb">·</font>&nbsp;
<%=@course.name %> <%=@course.name %>
</h3> </h3>
<span class="<%= @course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span> <span class="<%= @course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span>

View File

@ -3,7 +3,7 @@
<span class="user_icons_class"></span> <span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" > <p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" >
<%= link_to course.syllabus.title + course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => 'display:block;'%> <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => 'display:block;'%>
</p> </p>
<div class="sub-menu-title c_dark"> <div class="sub-menu-title c_dark">
<em></em> <em></em>

View File

@ -2,7 +2,7 @@
<% if User.current.logged?%> <% if User.current.logged?%>
<% if User.current == target%> <% if User.current == target%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li> <li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user.login), :class => "user_editinfo", :target => '_blank' %></li> <li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li> <li class="cl"></li>
<% else%> <% else%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"> <li style="width: 119px; float: left; border-right: 1px solid #ddd;">

View File

@ -189,7 +189,7 @@
<% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first || <% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
@project_attachments.first %> @project_attachments.first %>
<div class="wmail_main" style="padding:20px 10px 0px;"> <div class="wmail_main" style="padding:20px 10px 0px;">
<h3 class="wmail_h2" style="color:#474646; "><%= l(:label_project_overview_new)%></h3> <h3 class="wmail_h2" style="color:#474646; "><%= l(:label_project_overview_new) %></h3>
<% if !@issues.first.nil? || !@issues_journals.first.nil? %> <% if !@issues.first.nil? || !@issues_journals.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;"> <ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" > <span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >

View File

@ -1,7 +1,7 @@
<% members.each do |member|%> <% members.each do |member|%>
<ul class="orgListRow"> <ul class="orgListRow">
<% username = User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %> <% username = User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
<li class="orgListUser hidden"><a href="<%= user_url_in_org(member.user_id) %>" class="linkBlue"><%= username %></a></li> <li class="orgListUser hidden"><a href="<%= user_url_in_org(member.user) %>" class="linkBlue"><%= username %></a></li>
<li class="orgListRole"> <li class="orgListRole">
<%= get_org_member_role_name member %> <%= get_org_member_role_name member %>
<%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s, <%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,

View File

@ -10,11 +10,9 @@
<% members.each do |member| %> <% members.each do |member| %>
<div class="st_boxlist"> <div class="st_boxlist">
<a href="javascript:" class="st_img"> <%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :width => 32, :height => 32), user_path(member.user), :class => "st_img") %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span> <span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_url_in_org(member.user_id),:class => "ml5 c_blue02") %><br /> <%= link_to(member.user.show_name, user_url_in_org(member.user),:class => "ml5 c_blue02") %><br />
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span> <span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
<% if member.created_at %> <% if member.created_at %>
<span class="fr c_grey"><%= format_time(member.created_at) %></span> <span class="fr c_grey"><%= format_time(member.created_at) %></span>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="organization_document_<%= document.id %>"> <div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %> <%= link_to image_tag(url_to_avatar(User.find(document.creator)), :width => 45, :heigth => 45), user_url_in_org(document.creator) %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo"> <div class="homepagePostTo">
<%= link_to document.creator.show_name, user_url_in_org(document.creator.id), :class => "newsBlue mr15" %> <%= link_to document.creator.show_name, user_url_in_org(document.creator), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
| |
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span> <span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>

View File

@ -1,19 +1,26 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;"> <div id="muban_popup_box" style="width:500px;">
<div class="upload_con"> <div class="muban_popup_top">
<h2>选择问卷导入本班级</h2> <h3 class="fl">选择问卷导入本班级</h3>
<div class="upload_box"> <a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div id="error_show" style="color: red;"></div> <div class="cl"></div>
<%= form_tag import_other_poll_poll_index_path, </div>
method: :post, <div class="muban_popup_con clear">
id: "relation_file_form" do %> <%= form_tag import_other_poll_poll_index_path,
<input type="hidden" name="course_id" value="<%= polls_group_id%>" /> method: :post,
<%= content_tag('div', poll_check_box_tags('polls[]', polls,polls_group_id), :id => 'courses',:style=> 'width: 300px;')%> id: "relation_file_form" do %>
<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> <input type="hidden" name="course_id" value="<%= polls_group_id%>" />
<a href="javascript:void(0)" class="grey_btn fl c_white ml10" onclick="closeModal();">取&nbsp;&nbsp;消</a> <div class="import_poll_div">
<% end -%> <% polls.each do |poll| %>
<li>
<input style="vertical-align:middle" type="checkbox" name="polls[]" id="poll_check_box_<%=poll.id %>" value="<%=poll.id %>"/>
<label style="vertical-align:middle" for="poll_check_box_<%=poll.id %>" class="break_word"><%=h poll.polls_name.blank? ? l(:label_poll_new) : poll.polls_name %> [<%=h Course.find(poll.polls_group_id).name %>]</label>
</li>
<% end %>
</div> </div>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr35" onclick="submit_quote();">导&nbsp;&nbsp;入</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div> </div>
</div> </div>

View File

@ -566,6 +566,8 @@ function insert_MCQ(quest_type,quest_id){
var forms = $("form.new_poll_question"); var forms = $("form.new_poll_question");
if($("#polls_head_edit").is(":visible")){ if($("#polls_head_edit").is(":visible")){
alert("请先保存问卷标题及问卷描述。"); alert("请先保存问卷标题及问卷描述。");
}else if($.trim($("#polls_name_h").html()) == ""){
alert("问卷标题不能为空");
}else if(forms.length > 0){ }else if(forms.length > 0){
alert("请先保存正在编辑的题目。"); alert("请先保存正在编辑的题目。");
} else { } else {
@ -585,6 +587,8 @@ function insert_MCQ(quest_type,quest_id){
var forms = $("form.new_poll_question"); var forms = $("form.new_poll_question");
if($("#polls_head_edit").is(":visible")){ if($("#polls_head_edit").is(":visible")){
alert("请先保存问卷标题及问卷描述。"); alert("请先保存问卷标题及问卷描述。");
}else if($.trim($("#polls_name_h").html()) == ""){
alert("问卷标题不能为空");
}else if(forms.length > 0){ }else if(forms.length > 0){
alert("请先保存正在编辑的题目再发布。"); alert("请先保存正在编辑的题目再发布。");
} else{ } else{

View File

@ -4,6 +4,7 @@
<span class="c_red questionLabel ml5" title="必答">*</span> <span class="c_red questionLabel ml5" title="必答">*</span>
<%end%> <%end%>
</p> </p>
<div id="toolbar" class="undis">
<% poll = poll_question.poll %> <% poll = poll_question.poll %>
<% count = poll.poll_questions.count %> <% count = poll.poll_questions.count %>
<% unless poll_question.question_number == 1 %> <% unless poll_question.question_number == 1 %>
@ -21,4 +22,13 @@
</div> </div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id), <%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %> method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>
</div>
<script>
$('.poll-container').mouseover(function(){
$(this).find("#toolbar, .poll-edit").show();
})
$('.poll-container').mouseout(function(){
$(this).find("#toolbar, .poll-edit").hide();
})
</script>

View File

@ -7,7 +7,7 @@
<span class="formatContainer m_w500"><%= poll_question.question_title %></span> <span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[单选题]</span> <span class="fontBlue">[单选题]</span>
</div> </div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a> <a class="poll-edit" style="display:none;" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_inputs"> <div class="ur_inputs">

View File

@ -18,7 +18,7 @@
</p> </p>
<% end %> <% end %>
</div> </div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a> <a class="poll-edit" style="display:none;" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_inputs"> <div class="ur_inputs">
<table class="ur_table" style="width:647px;"> <table class="ur_table" style="width:647px;">

View File

@ -1,5 +1,5 @@
<div class="testStatus" onmouseover="$('#poll_head_edit_pen').show();" onmouseout="$('#poll_head_edit_pen').hide();"><!--头部显示 start--> <div class="testStatus" onmouseover="$('#poll_head_edit_pen').show();" onmouseout="$('#poll_head_edit_pen').hide();"><!--头部显示 start-->
<a href="javascript:" class="testEdit undis" id="poll_head_edit_pen" title="编辑" onclick="pollsEdit();" style="top:0;"></a> <a href="javascript:" class="testEdit" id="poll_head_edit_pen" title="编辑" onclick="pollsEdit();" style="top:0;display:none"></a>
<!-- <a class='ur_icon_add' title='导入' id="import_btn" onclick="importPoll();"></a> --> <!-- <a class='ur_icon_add' title='导入' id="import_btn" onclick="importPoll();"></a> -->
<h1 class="ur_page_title" id="polls_name_h" style="width:668px; margin:0 auto;"><%= poll.polls_name%></h1> <h1 class="ur_page_title" id="polls_name_h" style="width:668px; margin:0 auto;"><%= poll.polls_name%></h1>
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div> <div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div>

View File

@ -8,7 +8,7 @@
<span class="fontBlue">[多行主观题]</span> <span class="fontBlue">[多行主观题]</span>
</div> </div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a> <a class="poll-edit" style="display:none;" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div> <div class="cl"></div>
<% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %> <% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %>
<div class="ml20 mb10"> <div class="ml20 mb10">

View File

@ -8,7 +8,7 @@
<span class="fontBlue">[主观题]</span> <span class="fontBlue">[主观题]</span>
</div> </div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a> <a class="poll-edit" style="display:none;" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_inputs"> <div class="ur_inputs">
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea> <textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea>

View File

@ -1,13 +1,14 @@
<% if @polls.empty? %> <% if @polls.empty? %>
alert('您的其它班级下没有问卷可供导入'); alert('您的其它班级下没有问卷可供导入');
<% else %> <% else %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>'); var html_value = '<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>';
pop_box_new(html_value, 510, 550);
// $('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>');
showModal('ajax-modal', '513px'); //
$('#ajax-modal').siblings().remove(); //
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>"); // showModal('ajax-modal', '513px');
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); // $('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().addClass("popbox_polls"); // $('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
// $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
// $('#ajax-modal').parent().addClass("popbox_polls");
<% end %> <% end %>

View File

@ -241,7 +241,7 @@
} }
} }
</script> </script>
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(pq.id, User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>> <textarea class="fillInput" placeholder="在此填入答案" type="text" style="height:54px" value="<%= get_anwser_vote_text(pq.id, User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>></textarea>
</div> </div>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@
<!--项目创建者不能退出项目--> <!--项目创建者不能退出项目-->
<% if User.current.id != @project.user_id %> <% if User.current.id != @project.user_id %>
<li class="mr5 fl"> <li class="mr5 fl">
<a href="javascript:void(0);" class="pro_new_topbtn_left fl "> 已加入</a> <a class="pro_new_topbtn_left fl "> 已加入</a>
<a href="<%= project_member_path(@project) %>" class=" pro_new_topbtn fl"><%= Member.where(:project_id => @project.id).count %></a> <a href="<%= project_member_path(@project) %>" class=" pro_new_topbtn fl"><%= Member.where(:project_id => @project.id).count %></a>
</li> </li>
<%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %> <%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
@ -33,7 +33,7 @@
</div>--> </div>-->
<li class="mr5 fl"> <li class="mr5 fl">
<!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="pro_new_topbtn_left fl" target="_blank">Fork</a>--> <!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="pro_new_topbtn_left fl" target="_blank">Fork</a>-->
<%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'projects', :action => 'forked_pop'}, <%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", forked_pop_project_path(@project),
:class=>"pro_new_topbtn_left fl", :remote => true %> :class=>"pro_new_topbtn_left fl", :remote => true %>
<a href="<%= member_forked_project_path(@project) %>" class=" pro_new_topbtn fl"><%= @project.forked_count.to_i %></a> <a href="<%= member_forked_project_path(@project) %>" class=" pro_new_topbtn fl"><%= @project.forked_count.to_i %></a>
</li> </li>

View File

@ -1,3 +1,17 @@
<% @members_forked.each do |id| %> <div class="pro_new_info mb10">
<% %> <h2 class="clear">成员<span class="fr pro_new_font mr15" >本页面展示Fork了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户</span></h2>
<% end %> <ul class="clear pro_new_users_box">
<% @forked_projects.each do |project| %>
<li class="clear">
<%= link_to image_tag(url_to_avatar(project.owner), :width => "50", :height => "50"), user_path(project.owner), :alt => "用户头像", :class => "pro_new_users fl mr5" %>
<div class="fl mt5 clear">
<%= link_to project.owner.try(:show_name), user_path(project.owner), :class => "pro_new_users mt5 fl" %>
<span class="ml5 mr5 mt5 fl"> / </span>
<%= link_to project.name, project_path(project), :class => "pro_new_users mt5 fl" %>
<br/>
<span class=" c_grey mt3"><%=h time_tag(project.created_on) %>前</span>
</div>
</li>
<% end %>
</ul>
</div>

View File

@ -70,7 +70,7 @@
<% members.each do |member| %> <% members.each do |member| %>
<tr> <tr>
<th><%= i += 1 %></th> <th><%= i += 1 %></th>
<th><%= link_to member.principal.show_name, user_path(member.principal) %></th> <th><%= link_to member.principal.show_name, user_path(member.principal), :target => "_blank" %></th>
<th> <th>
<% if User.current.language == "zh" %> <% if User.current.language == "zh" %>

View File

@ -1,5 +1,5 @@
<!--新版项目头部结束--> <!--新版项目头部结束-->
<div class="pro_new_info mb10"> <div class="pro_new_info mb10 break_word">
<div id="project_invite_code"><%= render :partial => 'projects/invite_code' %></div> <div id="project_invite_code"><%= render :partial => 'projects/invite_code' %></div>
<% if @project.description.blank? %> <% if @project.description.blank? %>
<p class="break_word"><%= @project.name %></p> <p class="break_word"><%= @project.name %></p>

View File

@ -1,18 +1,20 @@
<div class="autoscroll"> <div class="autoscroll">
<table class="list entries mt5" id="browser" style="table-layout: fixed;"> <table class="list entries mt5" id="browser" style="table-layout: fixed;">
<tbody> <% unless @path.blank? %>
<tr style="border: 1px solid #DDD; border-bottom:none;"> <tbody>
<td> <tr style="border: 1px solid #DDD; border-bottom:none;">
<a href="<%= project_roadmap_path(@project) %>" class="fl linkBlue2 mt3" > <td>
<span class="new_roadmap_icons_back mr5"></span> <a href="javascript:history.go(-1)" class="fl linkBlue2 mt3" >
返回上级目录 <span class="new_roadmap_icons_back mr5"></span>
</a> 返回上级目录
</td> </a>
<td></td> </td>
<td></td> <td></td>
<td></td> <td></td>
</tr> <td></td>
</tbody> </tr>
</tbody>
<% end %>
<tbody style="line-height: 1.9;"> <tbody style="line-height: 1.9;">
<%= render :partial => 'dir_list_content' %> <%= render :partial => 'dir_list_content' %>
</tbody> </tbody>

View File

@ -7,14 +7,17 @@
<div class="sy_popup_con" style="width:380px;"> <div class="sy_popup_con" style="width:380px;">
<ul class="sy_popup_add" > <ul class="sy_popup_add" >
<li class="center mb5" style="line-height:20px"> <li class="center mb5" style="line-height:20px">
Fork将在后台执行<br>平台将为您创建一个新的同名项目和版本库,请问是否继续? <% if has_forked_cur_project(@project) %>
您已经Fork过该项目点击“确定”将会跳入您Fork的项目主页请问是否继续
<% else %>
Fork将在后台执行<br>平台将为您创建一个新的同名项目和版本库,请问是否继续?
<% end %>
</li> </li>
<li class="mt10"> <li class="mt10">
<label class="mr27">&nbsp;</label> <label class="mr27">&nbsp;</label>
<a href="javascript:void(0);" class="sy_btn_grey fl " onclick="hideModal()">取&nbsp;&nbsp;消</a> <a href="javascript:void(0);" class="sy_btn_grey fl " onclick="hideModal()">取&nbsp;&nbsp;消</a>
<!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="sy_btn_blue fl ml20" onclick="hideModal();">确&nbsp;&nbsp;定</a>--> <!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="sy_btn_blue fl ml20" onclick="hideModal();">确&nbsp;&nbsp;定</a>-->
<%= link_to "确 定", {:controller => 'repositories', :action => 'forked'}, <%= link_to "确 定", {:controller => 'repositories', :action => 'forked'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();" %>
:class=>"sy_btn_blue fl ml20", :onclick=>"hideModal();" %>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
</ul> </ul>

View File

@ -13,10 +13,8 @@
<div class="pr"> <div class="pr">
<span class="fl ml25 fontGrey2">关联项目:</span> <span class="fl ml25 fontGrey2">关联项目:</span>
<div class="fl projectName"> <div class="fl projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %> <%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %>
<% elsif User.current.allowed_to?(:as_teacher, @homework.course) %>
<%= link_to student_work.project.name, applied_join_project_path(:object_id => student_work.project.id, :is_teacher => 1), :remote => true, :method => "post", :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称" %>
<% else %> <% else %>
<span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span> <span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %> <% end %>

View File

@ -5,8 +5,6 @@
<div class="homepagePostTo break_word mt-4"> <div class="homepagePostTo break_word mt-4">
<%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%> <%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%>
TO TO
<%=link_to homework.course.syllabus.title, syllabus_path(homework.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to homework.course.name, course_path(homework.course_id), :class => "newsBlue"%> <%= link_to homework.course.name, course_path(homework.course_id), :class => "newsBlue"%>
</div> </div>
<div class="homepagePostTitle hidden fl m_w505"> <div class="homepagePostTitle hidden fl m_w505">

View File

@ -0,0 +1,31 @@
<div class="syllabus_courses_box">
<% projects.each do |project|%>
<% allow_visit = project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
<div class="syllabus_courses_list" style="cursor: default">
<div class="sy_courses_open">
<h3>
<% if allow_visit %>
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<% else %>
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
<% end %>
</h3>
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
<% projectUser = User.where("id=?",project.user_id).first %>
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
<div class="cl"></div>
</div>
<div>
<p class="fl sy_p_grey" style="margin-left: 0">更新时间:<%= format_date(project.updated_on) %></p>
<div class=" fr">
<p class="list-info fr grayTxt">
<%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span>
<%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span>
<%= link_to project.project_score.attach_num, allow_visit ? file_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span>资源</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
</div><!--syllabus_courses_box end-->

View File

@ -4,6 +4,7 @@
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %> <% end %>
<% is_group_project_homework = @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
@ -12,12 +13,14 @@
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
<% if @tab == 2%> <% if @tab == 2%>
$("#student_work_tab2").click(); $("#student_work_tab2").click();
<% elsif @tab == 3 %>
$("#student_work_tab3").click();
<% end %> <% end %>
sd_create_editor_from_data(<%= @homework.id %>, null, "100%", "<%= @homework.class.to_s %>"); sd_create_editor_from_data(<%= @homework.id %>, null, "100%", "<%= @homework.class.to_s %>");
}); });
function HoverLi(n){ function HoverLi(n){
for(var i=1;i<=2;i++){ for(var i=1;i<=3;i++){
$('#student_work_tab'+i).removeClass('selected'); $('#student_work_tab'+i).removeClass('selected');
$('#student_work_con'+i).addClass('undis'); $('#student_work_con'+i).addClass('undis');
} }
@ -156,7 +159,14 @@
<li onclick="HoverLi(2);" id="student_work_tab2"> <li onclick="HoverLi(2);" id="student_work_tab2">
<a href="javascript:void(0);" class="fontGrey3">作品列表</a> <a href="javascript:void(0);" class="fontGrey3">作品列表</a>
</li> </li>
<li style="width:515px;">&nbsp;</li> <% if is_group_project_homework %>
<li onclick="HoverLi(3);" id="student_work_tab3">
<a href="javascript:void(0);" class="fontGrey3">关联项目列表</a>
</li>
<li style="width:415px;">&nbsp;</li>
<% else %>
<li style="width:515px;">&nbsp;</li>
<% end %>
</ul> </ul>
<div id="student_work_con1"> <div id="student_work_con1">
@ -176,6 +186,14 @@
</div> </div>
</div> </div>
</div> </div>
<% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<div class="undis" id="student_work_con3">
<% project_ids = @homework.student_work_projects.blank? ? "(-1)" : "(" + @homework.student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
<% projects = Project.where("id in #{project_ids}") %>
<%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
</div>
<% end %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -20,14 +20,10 @@
<div class="fl"> <div class="fl">
<% if course.is_public == 0 && !User.current.member_of_course?(course) && !User.current.admin? %> <% if course.is_public == 0 && !User.current.member_of_course?(course) && !User.current.admin? %>
<h3 class="sy_classlist_title fl"> <h3 class="sy_classlist_title fl">
<%= link_to @syllabus.title, syllabus_path(@syllabus.id), :style => 'color:#000', :target => '_blank' %>
<font class="fb"> · </font>
<%=course.name %><%=current_time_and_term_short(course) %> <%=course.name %><%=current_time_and_term_short(course) %>
</h3> </h3>
<% else %> <% else %>
<h3 class="sy_classlist_title fl"> <h3 class="sy_classlist_title fl">
<%= link_to @syllabus.title, syllabus_path(@syllabus.id), :style => 'color:#000', :target => '_blank' %>
<font class="fb"> · </font>
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), <%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%> :style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
</h3> </h3>

View File

@ -12,8 +12,6 @@
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%=link_to activity.course.syllabus.title, syllabus_path(activity.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to activity.course.name.to_s+" | 班级资源", course_files_path(activity.course), :class => "newsBlue" %> <%= link_to activity.course.name.to_s+" | 班级资源", course_files_path(activity.course), :class => "newsBlue" %>
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >

View File

@ -1,19 +1,17 @@
<div class="resources mt10"> <div class="resources mt10">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.teacher), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<% if activity.try(:teacher).try(:realname) == ' ' %> <% if activity.try(:teacher).try(:realname) == ' ' %>
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:teacher), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.tea_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<%=link_to activity.syllabus.title, syllabus_path(activity.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %> <%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %>
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >

View File

@ -2,15 +2,13 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)" --> TO <!--+"(课程名称)" -->
<%=link_to activity.course.syllabus.title, syllabus_path(activity.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<% if hw_status == 3 || hw_status == 5 %> <% if hw_status == 3 || hw_status == 5 %>
<%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%> <%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%>
<% else %> <% else %>
@ -63,17 +61,3 @@
<%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status, :is_teacher => is_teacher} %> <%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status, :is_teacher => is_teacher} %>
</div> </div>
<script type="text/javascript">
$("#moreProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#relatePWrap_<%=user_activity_id %>").css("height","auto");
$(this).hide();
});
$("#hideProject_<%=user_activity_id %>").click(function(){
$("#relatePWrap_<%=user_activity_id %>").toggleClass('relatePWrap');
$("#moreProject_<%=user_activity_id %>").show();
});
$(function(){
user_card_show_hide();
});
</script>

View File

@ -1,16 +1,14 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
TO TO
<% course=Course.find(activity.jour_id) %> <% course=Course.find(activity.jour_id) %>
<%=link_to course.syllabus.title, syllabus_path(course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue" %> <%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue" %>
</div> </div>
<!--<div class="homepagePostTitle break_word list_style upload_img"> <!--<div class="homepagePostTitle break_word list_style upload_img">

View File

@ -1,15 +1,13 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author, :host => Setting.host_user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %> <%= link_to activity.author.show_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO TO
<%=link_to activity.course.syllabus.title, syllabus_path(activity.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue mr5"%> <%= link_to activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue mr5"%>
</div> </div>
<div class="homepagePostTitle hidden m_w530 fl"> <div class="homepagePostTitle hidden m_w530 fl">

View File

@ -1,15 +1,13 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"--> TO <!--+"(课程名称)"-->
<%=link_to activity.course.syllabus.title, syllabus_path(activity.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %> <%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %>
</div> </div>
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->

View File

@ -5,20 +5,18 @@
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>--> <!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<% if activity.try(:user).try(:realname) == ' ' %> <% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user), user_path(activity.user), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:user).try(:realname), user_path(activity.user), :class => "newsBlue mr15" %>
<% end %> <% end %>
TO TO
<% course = Course.find(activity.polls_group_id) %> <% course = Course.find(activity.polls_group_id) %>
<%=link_to course.syllabus.title, syllabus_path(course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to course.name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue" %> <%= link_to course.name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue" %>
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
</div> </div>

View File

@ -14,8 +14,6 @@
<div class="homepagePostDeadline"> <div class="homepagePostDeadline">
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
</div> </div>
<% end %>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>"> <div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59 匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div> </div>
@ -27,9 +25,7 @@
<div class="mt10 homepagePostDeadline"> <div class="mt10 homepagePostDeadline">
#&nbsp;<%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 #&nbsp;<%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
</div> </div>
<% end %> <div class="cl"></div>
<div class="cl"></div>
<% if activity.student_works.has_committed.count != 0 %>
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> <%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %> <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %>
@ -42,13 +38,8 @@
</div> </div>
<% end %> <% end %>
<div> <div>
<% if activity.homework_type != 2 %> <% student_works = activity.student_works.select("student_works.*,student_works.work_score as score").where("work_score is not null and work_status != 0").order("score desc").limit(5) %>
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %> <% student_works.includes(:user).each do |sw| %>
<% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
<% else %>
<% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %>
<% end %>
<% student_works.includes(:user).each_with_index do |sw, i| %>
<div class="fl mr10 w100" style="text-align:center;"> <div class="fl mr10 w100" style="text-align:center;">
<a href="javascript:void(0);" class="linkBlue"> <a href="javascript:void(0);" class="linkBlue">
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %>
@ -63,14 +54,11 @@
</p> </p>
<% end %> <% end %>
</a> </a>
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> <% score = sw.respond_to?("score") ? sw.score : sw.work_score %>
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分</span></p> <p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分</span></p>
</div> </div>
<% if i == 4 %>
<% break %>
<% end %>
<% end %> <% end %>
<% if student_works.count > 5 %> <% if student_works.count == 5 %>
<%= link_to "更多>>", student_work_index_url_in_org(activity.id, 2),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> <%= link_to "更多>>", student_work_index_url_in_org(activity.id, 2),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
@ -83,11 +71,11 @@
<% sort_projects = project_sort_update projects %> <% sort_projects = project_sort_update projects %>
<div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>"> <div class="mt10 relatePWrap" id="relatePWrap_<%=user_activity_id %>">
<div class="mr5 fontGrey2"> <div class="mr5 fontGrey2">
<%# first_pro = sort_projects.first %> <% first_pro_act = sort_projects.first %>
<% first_pro = Project.find sort_projects.first.project_id %> <% first_pro = Project.find first_pro_act.project_id %>
<% commit_time = first_pro.project_score.commit_time %> <% commit_time = first_pro.project_score.commit_time %>
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> <%# one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
#&nbsp;<%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目 #&nbsp;<%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(first_pro_act.updated_at) ? commit_time : first_pro_act.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -1,20 +1,19 @@
<% work = cur_user_works_for_homework activity %>
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%> <% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
<% projects = cur_user_projects_for_homework activity %> <% projects = cur_user_projects_for_homework activity %>
<% works = cur_user_works_for_homework activity %> <% if work.nil? && projects.nil? %>
<% if works.nil? && projects.nil? %>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %> <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
</div> </div>
<% elsif works.nil? %> <% elsif work.nil? %>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %> <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%= user_for_homework_common activity,is_teacher %> <%= user_for_homework_common activity,is_teacher,work %>
</div> </div>
<% work = cur_user_works_for_homework activity %>
<% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Date.today %> <% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Date.today %>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
@ -35,11 +34,10 @@
语言: 语言:
<%= activity.language_name%> <%= activity.language_name%>
</div> </div>
<% end %> <% elsif activity.homework_type == 3 && activity.homework_detail_group%>
<% if activity.homework_type == 3 && activity.homework_detail_group%>
<% if activity.homework_detail_group.base_on_project == 1 %> <% if activity.homework_detail_group.base_on_project == 1 %>
<div class="homepagePostDeadline mr15"> <div class="homepagePostSubmit mr15">
项目(<%=activity.student_work_projects.where("is_leader = 1").count %>) <%=link_to "项目(#{activity.student_work_projects.where('is_leader = 1').count})",student_work_index_url_in_org(activity.id, 3),:class => "c_blue" %>
</div> </div>
<% end %> <% end %>
<div class="homepagePostDeadline mr15"> <div class="homepagePostDeadline mr15">

View File

@ -18,8 +18,6 @@
<div class="sy_cgrey"> <div class="sy_cgrey">
<span class="fl">来源:</span> <span class="fl">来源:</span>
<p class="fl hw_list_classname mr15"> <p class="fl hw_list_classname mr15">
<%=link_to homework.course.syllabus.title, syllabus_path(homework.course.syllabus_id), :class => 'hw_cgrey', :target => '_blank' %>
<span> • </span>
<%=link_to homework.course.name.to_s + "#{current_time_and_term_short(homework.course)}", course_path(homework.course), :class => 'hw_cgrey', :target => '_blank' %> <%=link_to homework.course.name.to_s + "#{current_time_and_term_short(homework.course)}", course_path(homework.course), :class => 'hw_cgrey', :target => '_blank' %>
</p> </p>
<% if type == "2" %> <% if type == "2" %>

View File

@ -14,8 +14,6 @@
<p class="sy_cgrey clear"> <p class="sy_cgrey clear">
<span class="fl">来源:</span> <span class="fl">来源:</span>
<span class="hw_classname mr15 fl"> <span class="hw_classname mr15 fl">
<%=link_to homework.course.syllabus.title, syllabus_path(homework.course.syllabus_id), :class => 'hw_cgrey', :target => '_blank' %>
<span> • </span>
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey' %> <%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey' %>
</span> </span>
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span> <span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>

View File

@ -1,5 +1,5 @@
<div class="homepagePostReplyPublisher"> <div class="homepagePostReplyPublisher">
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user), :class => "newsBlue mr10 f14" %>
<%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
</div> </div>
<% if !comment.parent.nil? %> <% if !comment.parent.nil? %>

View File

@ -8,7 +8,7 @@
</script> </script>
<li class="homepagePostReplyContainer" nhname="reply_rec"> <li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait"> <div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
</div> </div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();"> <div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%> <%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>

View File

@ -2,15 +2,15 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px"> <div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_path(activity.author), :class => "newsBlue mr15" %>
<% else %> <% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author), :class => "newsBlue mr15" %>
<% end %> TO <% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div> </div>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px"> <div class="homepagePostTo break_word" style="width:620px">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO TO
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%> <%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>--> <!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->

View File

@ -14,8 +14,6 @@
<p class="sy_cgrey clear"> <p class="sy_cgrey clear">
<span class=" fl">来源:</span> <span class=" fl">来源:</span>
<span class="hw_classname fl mr15"> <span class="hw_classname fl mr15">
<%=link_to homework.course.syllabus.title, syllabus_path(homework.course.syllabus_id), :class => 'hw_cgrey', :target => '_blank' %>
<span> • </span>
<%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey' %> <%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey' %>
</span> </span>
<span class="mr15 fl">类别:<%=homework.homework_type_ch %></span> <span class="mr15 fl">类别:<%=homework.homework_type_ch %></span>

View File

@ -1,18 +1,18 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"--> TO <!--+"(课程名称)"-->
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %> <%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"--> <div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
<div class="fl"> <div class="fl">
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %> <%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id => activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
<% if activity.locked%> <% if activity.locked%>
<span class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%> <% end%>

View File

@ -8,8 +8,6 @@
<div class="homepagePostTo"> <div class="homepagePostTo">
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%> <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
TO TO
<%=link_to homework_common.course.syllabus.title, syllabus_path(homework_common.course.syllabus_id), :class => 'newsBlue ml15', :target => '_blank' %>
<span class="fb" style="color: #269ac9"> • </span>
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue"%> <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue"%>
</div> </div>
<span class="homepagePostTitle hidden fl m_w505"> <span class="homepagePostTitle hidden fl m_w505">

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes">
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %> <%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
TO TO
<% if activity.jour %> <% if activity.jour %>
<%= link_to activity.jour.show_name+""+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"), <%= link_to activity.jour.show_name+""+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"),

View File

@ -22,7 +22,7 @@
</li> </li>
<li class="mb10 clear"> <li class="mb10 clear">
<label class=" fl ml5">&nbsp;日期&nbsp;&nbsp;:&nbsp;</label> <label class=" fl ml5">&nbsp;日期&nbsp;&nbsp;:&nbsp;</label>
<label class=" fl" style="border:1px solid #c8c8c8;"> <label class="ml4 fl" style="border:1px solid #c8c8c8;">
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl ml3", :id => "version_index_create_name", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none;", :no_label => true %> <%= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl ml3", :id => "version_index_create_name", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none;", :no_label => true %>
<%#= calendar_for('version_index_create_name') %> <%#= calendar_for('version_index_create_name') %>
</label> </label>

View File

@ -1,4 +1,4 @@
<script type="text/javascript" src="/javascripts/i18n/jquery.ui.datepicker-en.js"></script> <script type="text/javascript" src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<!--里程碑列表开始--> <!--里程碑列表开始-->
<div class="new_roadmap_conbox mb10" > <div class="new_roadmap_conbox mb10" >
<div class="new_roadmap_navbox clear"> <div class="new_roadmap_navbox clear">

View File

@ -2,5 +2,6 @@ var htmlvalue = "<%= escape_javascript(render :partial => 'versions/new_mileston
pop_box_new(htmlvalue,820,316); pop_box_new(htmlvalue,820,316);
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}; var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
$(function() { $('#version_index_create_name').datepicker(datepickerOptions); $(function() { $('#version_index_create_name').datepicker(datepickerOptions);
// $('#evaluation_end_time').datepicker(datepickerOptions); $('#version_index_create_name').datepicker(datepickerOptions);
}); });

View File

@ -1,3 +1,4 @@
<script type="text/javascript" src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<!--里程碑详情开始--> <!--里程碑详情开始-->
<div class="new_roadmap_conbox mb10"> <div class="new_roadmap_conbox mb10">
<div class="new_roadmap_info_top clear "> <div class="new_roadmap_info_top clear ">
@ -67,9 +68,11 @@
<% @issues.each do |issue| %> <% @issues.each do |issue| %>
<tr> <tr>
<td>#<%= issue.id %></td> <td>#<%= issue.id %></td>
<td><p class="new_roadmap_info_title" title="<%= issue.subject %>"><%= issue.subject %></p> </td> <td><a href="<%= issue_path(issue) %>" class="new_roadmap_info_title" title="<%= issue.subject %>" target="_blank"><%= issue.subject %></a> </td>
<td> <%= issue.tracker %> </td> <td> <%= issue.tracker %> </td>
<td><p class="new_roadmap_info_name"><%= User.find(issue.try(:assigned_to_id)).show_name %></p></td> <td><a href="<%= issue.assigned_to_id.nil? ? "" : user_path(issue.assigned_to_id) %>" class="new_roadmap_info_name" target="_blank">
<%= User.find(issue.try(:assigned_to_id)).nil? ? "" : User.find(issue.try(:assigned_to_id)).show_name %></a>
</td>
<td><%= format_time issue.updated_on %></td> <td><%= format_time issue.updated_on %></td>
<td><%= issue.status.name %></td> <td><%= issue.status.name %></td>
<td><span class="<%= issue.done_ratio == 100 ? "c_green" : "c_red" %>" ><%= issue.done_ratio %>%</span></td> <td><span class="<%= issue.done_ratio == 100 ? "c_green" : "c_red" %>" ><%= issue.done_ratio %>%</span></td>

View File

@ -4,14 +4,14 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()"> <div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head"> <div class="fl">
<% if show_name %> <% if show_name %>
<%= image_tag url_to_avatar(reply.user),:width => '30',:height => '30' %> <%= link_to image_tag(url_to_avatar(reply.user),:width => '30',:height => '30'), user_path(reply.user) %>
<% else %> <% else %>
<%= image_tag url_to_avatar(nil),:width => '30',:height => '30' %> <%= link_to image_tag(url_to_avatar(nil),:width => '30',:height => '30'), user_path(reply.user) %>
<% end %> <% end %>
</div> </div>
<div class="recall_con f14" style="width:630px;"> <div class="recall_con f14 fl" style="width:630px;">
<% id = 'project_respond_form_'+ reply.id.to_s %> <% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.show_name, user_path(reply.user) %> <%= link_to reply.user.show_name, user_path(reply.user) %>
<%= l(:label_reply_to)%> <%= l(:label_reply_to)%>

View File

@ -1239,6 +1239,7 @@ RedmineApp::Application.routes.draw do
get "switch_role" get "switch_role"
get 'search_not_group_member' get 'search_not_group_member'
post 'add_members' post 'add_members'
get 'delete_member'
end end
collection do collection do
match 'join_private_courses', :via => [:get, :post] match 'join_private_courses', :via => [:get, :post]

View File

@ -0,0 +1,8 @@
class UpdateAssginToId < ActiveRecord::Migration
def up
Issue.where(:assigned_to_id => 0).update_all(:assigned_to_id => nil)
end
def down
end
end

View File

@ -0,0 +1,19 @@
class UpdateCourseName < ActiveRecord::Migration
def up
count = Course.all.count / 30 + 2
transaction do
for i in 1 ... count do i
Course.page(i).per(30).each do |course|
if course.syllabus && !course.syllabus.title.nil?
if course.name.index(course.syllabus.title) != 0
course.update_column("name", course.syllabus.title+course.name)
end
end
end
end
end
end
def down
end
end

View File

@ -0,0 +1,8 @@
class UpdateFixedVersionId < ActiveRecord::Migration
def up
Issue.where(:fixed_version_id => 0).update_all(:fixed_version_id => nil)
end
def down
end
end

View File

@ -0,0 +1,15 @@
class AddCourseIdToSwp < ActiveRecord::Migration
def change
add_column :student_work_projects, :course_id, :integer
count = StudentWorkProject.all.count / 30 + 2
transaction do
for i in 1 ... count do i
StudentWorkProject.page(i).per(30).each do |swp|
if swp.homework_common && swp.homework_common.course
swp.update_column("course_id", swp.homework_common.course_id)
end
end
end
end
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161028053000) do ActiveRecord::Schema.define(:version => 20161111081619) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -325,14 +325,16 @@ ActiveRecord::Schema.define(:version => 20161028053000) do
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
create_table "changesets", :force => true do |t| create_table "changesets", :force => true do |t|
t.integer "repository_id", :null => false t.integer "repository_id", :null => false
t.string "revision", :null => false t.string "revision", :null => false
t.string "committer" t.string "committer"
t.datetime "committed_on", :null => false t.datetime "committed_on", :null => false
t.text "comments" t.text "comments"
t.date "commit_date" t.date "commit_date"
t.string "scmid" t.string "scmid"
t.integer "user_id" t.integer "user_id"
t.integer "project_id"
t.integer "type", :default => 0
end end
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
@ -993,6 +995,10 @@ ActiveRecord::Schema.define(:version => 20161028053000) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "innodb_monitor", :id => false, :force => true do |t|
t.integer "a"
end
create_table "invite_lists", :force => true do |t| create_table "invite_lists", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "user_id" t.integer "user_id"
@ -1856,6 +1862,7 @@ ActiveRecord::Schema.define(:version => 20161028053000) do
t.integer "is_leader" t.integer "is_leader"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "course_id"
end end
add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id"

View File

@ -1768,6 +1768,15 @@ function expand_course_list(id, target, btnid, count) {
btn.parent().show(); btn.parent().show();
} }
} }
//点击删除时的确认弹框
function delete_confirm_box(url, str){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f16">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mr10 mt10" data-remote="true">确定</a>'+
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
//删除组织成员 //删除组织成员
function ifDeleteOrgMember(id,name){ function ifDeleteOrgMember(id,name){
var htmlvalue = "</br><div style='width:550px;text-align:center'>您确定要删除"+name+"吗?</div></br><div style='width:164px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn fl' onclick='deleteOrgMember("+id+")'>确定</a><a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a></div>" + var htmlvalue = "</br><div style='width:550px;text-align:center'>您确定要删除"+name+"吗?</div></br><div style='width:164px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn fl' onclick='deleteOrgMember("+id+")'>确定</a><a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a></div>" +

View File

@ -91,6 +91,10 @@ function addFile_board(inputEl, file, eagerUpload, id,btnId) {
function addFile(inputEl, file, eagerUpload,btnId) { function addFile(inputEl, file, eagerUpload,btnId) {
var attachments_frame = '#attachments_fields'; var attachments_frame = '#attachments_fields';
// $("#issue_confirm").attr('href', '#');
$('#issue_confirm').attr("disabled",true);
$('#issue_confirm').css('background-color','#c1c1c1');
$('#issue_confirm').css('cursor','default');
if (true) { if (true) {
deleteallfiles = $(inputEl).data('deleteAllFiles'); deleteallfiles = $(inputEl).data('deleteAllFiles');
var attachmentId = addFile.nextAttachmentId++; var attachmentId = addFile.nextAttachmentId++;

View File

@ -77,11 +77,22 @@ function hidden_homework_score_form()
function regex_course_name(str) function regex_course_name(str)
{ {
var name = $.trim($("#"+str+"_course_name").val()); var name = $.trim($("#"+str+"_course_name").val());
var syl_title = "";
if($("#new_syllabus_id").length > 0){
syl_title = $("#new_syllabus_id").find("option:selected").text();
} else{
syl_title = $("#edit_syllabus_id").html();
}
if(name.length < 2) if(name.length < 2)
{ {
$("#"+str+"_course_name_notice").show(); $("#"+str+"_course_name_notice").show();
return false; return false;
} }
else if(name.indexOf(syl_title) != 0){
$("#"+str+"_course_name_notice").html("请参照正确示例规范,应该以课程名称开头命名");
$("#"+str+"_course_name_notice").show();
return false;
}
else else
{ {
$("#"+str+"_course_name_notice").hide(); $("#"+str+"_course_name_notice").hide();
@ -185,7 +196,7 @@ function regex_course_password(str)
} }
//验证课程大纲 //验证课程大纲
function regex_syllabus_option(str) { function regex_syllabus_option(str) {
if(document.getElementById(str + "_syllabus_id")) { if(str == "new" && document.getElementById(str + "_syllabus_id")) {
var obj = document.getElementById(str + "_syllabus_id"); var obj = document.getElementById(str + "_syllabus_id");
var syllabus = obj.options[obj.selectedIndex]; var syllabus = obj.options[obj.selectedIndex];
if(parseInt(syllabus.value) == 0) { if(parseInt(syllabus.value) == 0) {

View File

@ -159,6 +159,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr25 {margin-right:25px;} .mr25 {margin-right:25px;}
.mr27 {margin-right:27px;} .mr27 {margin-right:27px;}
.mr30{ margin-right:30px !important;} .mr30{ margin-right:30px !important;}
.mr35{ margin-right:35px;}
.mr40{ margin-right:40px !important;} .mr40{ margin-right:40px !important;}
.mr45{margin-right: 45px;} .mr45{margin-right: 45px;}
.mr50{margin-right: 50px;} .mr50{margin-right: 50px;}

View File

@ -544,14 +544,6 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.merge-discussion-input {margin:0 -10px; padding:10px; background-color:#f8f8f8;} .merge-discussion-input {margin:0 -10px; padding:10px; background-color:#f8f8f8;}
.merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;} .merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;}
/*新版项目列表新增*/
.new_project_title{ font-size:16px; color:#333; max-width:480px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); }
.icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;}
.icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;}
.new_projectlist_more{ text-align:center;}
.new_projectlist_more a:hover{ color:#3b94d6;}
/*发布新样式*/ /*发布新样式*/
.publish-icon {background:url("/images/new_project/icons_issue.png") 0px -82px no-repeat; width:18px; height:18px; display:block;} .publish-icon {background:url("/images/new_project/icons_issue.png") 0px -82px no-repeat; width:18px; height:18px; display:block;}
.publish-icon:hover {background:url("/images/new_project/icons_issue.png") -25px -82px no-repeat;} .publish-icon:hover {background:url("/images/new_project/icons_issue.png") -25px -82px no-repeat;}
@ -704,6 +696,21 @@ a.sy_btn_blue{
-o-border-radius:3px; -o-border-radius:3px;
border-radius:3px; border-radius:3px;
} }
input.sy_btn_blue{
display: inline-block;
color: #fff;
background: #3b94d6;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
cursor:pointer;
}
a:hover.sy_btn_blue{ background: #2788d0;} a:hover.sy_btn_blue{ background: #2788d0;}
a.hw_btn_blue{ a.hw_btn_blue{
display: inline-block; display: inline-block;
@ -880,7 +887,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
/*项目简介*/ /*项目简介*/
.pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 998px;} .pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 998px;}
.pro_new_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;} .pro_new_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;}
.pro_new_info p{ padding:15px; color: #666;} .pro_new_info p{ padding-bottom:2px; padding-left: 5px; color: #666; padding-right: 5px}
.pro_new_info_weight{ font-size: 16px; font-weight: bold;} .pro_new_info_weight{ font-size: 16px; font-weight: bold;}
/* 新版项目配置*/ /* 新版项目配置*/
.pro_new_setting_leftnav{ width: 162px; border:1px solid #ddd; background-color:#fff; padding:3px; padding-bottom: 0;} .pro_new_setting_leftnav{ width: 162px; border:1px solid #ddd; background-color:#fff; padding:3px; padding-bottom: 0;}
@ -1014,4 +1021,13 @@ textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; co
/* 课程大纲 */ /* 课程大纲 */
.icons_tishi{ width: 110px; height: 110px;margin: 135px auto 20px;} .icons_tishi{ width: 110px; height: 110px;margin: 135px auto 20px;}
.sy_tab_con_p{ font-size: 16px;text-align: center; margin-bottom:100px; color:#888;} .sy_tab_con_p{ font-size: 16px;text-align: center; margin-bottom:100px; color:#888;}
/* 成员列表20161101byLB*/
.pro_new_font{ font-weight: normal; color: #666; font-size: 12px;}
.pro_new_users_box{ margin:0 10px;}
.pro_new_users_box li{ width:25%; float: left; margin:10px 0;}
.pro_new_users{ }
a.pro_new_users { max-width:80px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; word-break:break-all; display: inline-block; font-weight: bold; color: #666;}
a:hover.pro_new_users {color: #3b94d6}
.pro_new_users img{ width:40px;height:40px; border: 3px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.pro_new_users img:hover{border: 3px solid #e6e6e6;}

View File

@ -1529,4 +1529,12 @@ a.syllabusbox_a_blue{
/*模拟title*/ /*模拟title*/
.simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;} .simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;}
/*项目创建*/ /*项目创建*/
.project_new_input {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;} .project_new_input {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;}
/*新版项目列表新增*/
.new_project_title{ font-size:16px; color:#333; max-width:480px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); }
.icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;}
.icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;}
.new_projectlist_more{ text-align:center;}
.new_projectlist_more a:hover{ color:#3b94d6;}

View File

@ -151,4 +151,6 @@ a:hover.btn_pu{ background:#3cb761;}
.polls_alert_upload_box{ width:120px; margin:15px auto;} .polls_alert_upload_box{ width:120px; margin:15px auto;}
.polls_alert_box_p{ font-size:14px; padding-left: 45px;padding-top: 10px;} .polls_alert_box_p{ font-size:14px; padding-left: 45px;padding-top: 10px;}
.import_poll_div{width: 430px; max-height: 550px; overflow-x:hidden; overflow-y: auto; margin: 10px auto;}

View File

@ -629,9 +629,11 @@ a:hover.sy_class_ltitle{ color:#333;}
.sy_class_users_st img{ width:30px;height:30px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} .sy_class_users_st img{ width:30px;height:30px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.sy_fenban_select{height: 28px; background-color: #fff; border: 1px solid #d1d1d1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3;padding-left:5px; color:#888; box-shadow: inset 0px 0px 5px #dcdcdc; } .sy_fenban_select{height: 28px; background-color: #fff; border: 1px solid #d1d1d1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3;padding-left:5px; color:#888; box-shadow: inset 0px 0px 5px #dcdcdc; }
.sy_new_table_width tr th.sy_th10{ width: 10%; } .sy_new_table_width tr th.sy_th10{ width: 10%; }
.sy_new_table_width tr th.sy_th0{ width: 12.5%; } .sy_new_table_width tr th.sy_th0{ width: 12%; }
.sy_new_table_width tr th.sy_th1{ width: 12.5%; }
.sy_new_table_width tr th.sy_th15{ width: 15%; } .sy_new_table_width tr th.sy_th15{ width: 15%; }
.sy_new_table_width tr th.sy_th7{ width: 7%;} .sy_new_table_width tr th.sy_th6{ width: 6%;}
.sy_new_table_width tr th.sy_th3{ width: 3%;}
.sy_new_table_width tr th.sy_th13{ width: 13%;} .sy_new_table_width tr th.sy_th13{ width: 13%;}
.sy_fenban_tap{ cursor: pointer; position: relative;} .sy_fenban_tap{ cursor: pointer; position: relative;}
.sy_fenban_tap:hover .sy_fenban_show{ display: block;} .sy_fenban_tap:hover .sy_fenban_show{ display: block;}