Merge branch 'develop' into cs_optimize_txz

This commit is contained in:
Tim 2016-10-12 16:47:12 +08:00
commit a8ca2e136c
183 changed files with 3946 additions and 2101 deletions

View File

@ -1,3 +1,4 @@
# encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -685,6 +686,61 @@ class ApplicationController < ActionController::Base
:content_type => 'application/atom+xml'
end
def issue_ratio_change done_ratio, status_id
if done_ratio == 100 || status_id == 3
"已完成"
else
done_ratio.to_s + "%"
end
end
def issue_priority_change priority_id
case priority_id
when 1
""
when 2
"正常"
when 3
""
when 4
"紧急"
when 5
"立即"
end
end
def issue_status_change status_id
case status_id
when 1
"新增"
when 2
"正在解决"
when 3
"已解决"
when 4
"反馈"
when 5
"关闭"
when 6
"拒绝"
end
end
def issue_tracker_change tracker_id
case tracker_id
when 1
"缺陷"
when 2
"功能"
when 3
"支持"
when 4
"任务"
when 5
"周报"
end
end
def self.accept_rss_auth(*actions)
if actions.any?
self.accept_rss_auth_actions = actions

View File

@ -184,14 +184,24 @@ class CoursesController < ApplicationController
if params[:incourse]
results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
elsif params[:ingroup]
@group = CourseGroup.find(params[:search_group_id])
results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
if params[:search_group_id] == "-1"
@group = -1
results = searchmember_by_name(student_homework_score(-1,0,0,"desc"), q)
else
@group = CourseGroup.find(params[:search_group_id])
results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
end
end
@is_remote = true
#@result_count = results.count
#@results = paginateHelper results, 10
@results = results
@search_name = q
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @results.count
@mem_pages = Paginator.new @members_count, @limit, @page
@results = paginateHelper @results, @limit
end
def addgroups
@ -208,6 +218,12 @@ class CoursesController < ApplicationController
@is_remote = true
@members = student_homework_score(0,0, 10,@score_sort_by)
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @members.count
@no_group_count = @members_count - @course.members.where("course_group_id != 0").count
@mem_pages = Paginator.new @members_count, @limit, @page
@members = paginateHelper @members, @limit
end
def deletegroup
@ -219,6 +235,12 @@ class CoursesController < ApplicationController
@score_sort_by = "desc"
@members = student_homework_score(0,0, 10,@score_sort_by)
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @members.count
@no_group_count = @members_count - @course.members.where("course_group_id != 0").count
@mem_pages = Paginator.new @members_count, @limit, @page
@members = paginateHelper @members, @limit
end
def updategroupname
@ -232,6 +254,12 @@ class CoursesController < ApplicationController
@is_remote = true
@members = student_homework_score(0,0, 10,"desc")
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @members.count
@no_group_count = @members_count - @course.members.where("course_group_id != 0").count
@mem_pages = Paginator.new @members_count, @limit, @page
@members = paginateHelper @members, @limit
end
def valid_ajax
@ -268,6 +296,7 @@ class CoursesController < ApplicationController
member.course_group_id = params[:course_group_id].to_i
member.save
@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) && params[:role] != '1'
respond_to do |format|
format.js
@ -283,6 +312,7 @@ class CoursesController < ApplicationController
@group = group
@course_groups = @course.course_groups
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
search_group_members group
end
@ -294,6 +324,7 @@ class CoursesController < ApplicationController
member.save
@group = group
@course_groups = @course.course_groups
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
search_group_members group
end
@ -304,14 +335,22 @@ class CoursesController < ApplicationController
@is_remote = true
@sort_type = 'score'
@score_sort_by = "desc"
if params[:group_id] && params[:group_id] != "0"
if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
@group = CourseGroup.find(params[:group_id])
@results = student_homework_score(@group.id,0, 0,"desc")
# @results = paginateHelper @results, 10
elsif params[:group_id] && params[:group_id] == "-1"
@group = -1
@results = student_homework_score(-1, 0, 10,"desc")
else
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(0,page_from, 10,"desc")
end
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @results.count
@mem_pages = Paginator.new @members_count, @limit, @page
@results = paginateHelper @results, @limit
end
def member
@ -332,10 +371,15 @@ class CoursesController < ApplicationController
@members = @all_members
when '2'
if @course.open_student == 1 || User.current.member_of_course?(@course) || User.current.admin?
@limit = 50
@subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type)
@members = @all_members
@page = params[:page].nil? ? 1 : params['page'].to_i
@all_members = student_homework_score(0, @page - 1, @limit, @score_sort_by, @sort_type)
@members_count = @all_members.count
@no_group_count = @members_count - @course.members.where("course_group_id != 0").count
@mem_pages = Paginator.new @members_count, @limit, @page
@members = paginateHelper @all_members, @limit
@left_nav_type = 9
else
render_403
return
@ -378,25 +422,35 @@ class CoursesController < ApplicationController
group_id = params[:group_id]
if !@search_name.nil?
if group_id == '0'
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
#page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by,@sort_type), @search_name)
@result_count = @results.count
# @results = paginateHelper @results, 10
elsif group_id == '-1'
@group = -1
@results = searchmember_by_name(student_homework_score(-1,0,0,@score_sort_by,@sort_type), @search_name)
else
@group = CourseGroup.find(group_id)
@results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type),@search_name)
@result_count = @results.count
# @results = paginateHelper @results, 10
end
else
if group_id == '0'
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@results = student_homework_score(0,page, 10,@score_sort_by,@sort_type)
elsif group_id == '-1'
@group = -1
@results = student_homework_score(-1,0, 10,@score_sort_by,@sort_type)
else
@group = CourseGroup.find(group_id)
@results = student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type)
end
end
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @results.count
@no_group_count = @members_count - @course.members.where("course_group_id != 0").count
@mem_pages = Paginator.new @members_count, @limit, @page
@results = paginateHelper @results, @limit
end
# 显示每个学生的作业评分详情
def show_member_score
@ -1149,7 +1203,7 @@ class CoursesController < ApplicationController
#统计
def statistics_course
@left_nav_type = 9
@left_nav_type = 10
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
@ -1223,7 +1277,6 @@ class CoursesController < ApplicationController
def student_homework_score(groupid,start_from, nums, score_sort_by, sort_type = 'score')
start_from = start_from * nums
sql_select = ""
if groupid == 0
sql_select = "SELECT members.*,(
SELECT SUM(student_works.work_score)
@ -1231,13 +1284,49 @@ class CoursesController < ApplicationController
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id}
AND student_works.user_id = members.user_id
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
) AS score,(SELECT max(message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
) AS act_score
) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id
AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score,
(SELECT max(student_id) FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id,
(SELECT max(message_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num,
(SELECT max(message_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num,
(SELECT max(news_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num,
(SELECT max(news_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num,
(SELECT max(resource_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num,
(SELECT max(journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num,
(SELECT max(homework_journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num,
(SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num,
(SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num
FROM members
JOIN students_for_courses
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 #{sort_type} #{score_sort_by}"
elsif groupid == -1
sql_select = "SELECT members.*,(
SELECT SUM(student_works.work_score)
FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id}
AND student_works.user_id = members.user_id
) AS score,(SELECT max(message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id
AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score,
(SELECT max(student_id) FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id,
(SELECT max(message_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num,
(SELECT max(message_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num,
(SELECT max(news_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num,
(SELECT max(news_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num,
(SELECT max(resource_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num,
(SELECT max(journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num,
(SELECT max(homework_journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num,
(SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num,
(SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num
FROM members
JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
WHERE members.course_id = #{@course.id} AND members.course_group_id = 0 ORDER BY #{sort_type} #{score_sort_by}"
else
sql_select = "SELECT members.*,(
SELECT SUM(student_works.work_score)
@ -1247,7 +1336,18 @@ class CoursesController < ApplicationController
AND student_works.user_id = members.user_id
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
) AS act_score
) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id
AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score,
(SELECT max(student_id) FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id,
(SELECT max(message_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num,
(SELECT max(message_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num,
(SELECT max(news_reply_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num,
(SELECT max(news_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num,
(SELECT max(resource_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num,
(SELECT max(journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num,
(SELECT max(homework_journal_num) FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num,
(SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num,
(SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num
FROM members
JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
@ -1284,25 +1384,32 @@ class CoursesController < ApplicationController
#sheet1.row(0).default_format = blue
#sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_class),l(:excel_f_score),l(:excel_commit_time)])
sheet1[0,0] = "课程编号"
sheet1[0,1] = course.id
sheet1[1,0] = "课程学期"
sheet1[1,1] = course.time.to_s+""+course.term
sheet1[2,0] = "课程名称"
sheet1[2,1] = course.name
sheet1[3,0] = "教师团队"
sheet1[3,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、')
sheet1[4,0] = "主讲教师"
sheet1[4,1] = course.teacher.show_name
sheet1[5,0] = "排名"
sheet1[5,1] = "学生姓名"
sheet1[5,2] = "昵称"
sheet1[5,3] = "学号"
sheet1[0,1] = course.syllabus.id
sheet1[1,0] = "课程名称"
sheet1[1,1] = course.syllabus.title
sheet1[2,0] = "班级编号"
sheet1[2,1] = course.id
sheet1[3,0] = "班级学期"
sheet1[3,1] = course.time.to_s+""+course.term
sheet1[4,0] = "班级名称"
sheet1[4,1] = course.name
sheet1[5,0] = "教师团队"
sheet1[5,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、')
sheet1[6,0] = "主讲教师"
sheet1[6,1] = course.teacher.show_name
sheet1[7,0] = "排名"
sheet1[7,1] = "学生姓名"
sheet1[7,2] = "昵称"
sheet1[7,3] = "学号"
for i in 0 ... homeworks.count
sheet1[5,i+4] = ""+(i+1).to_s+""
sheet1[7,i+4] = ""+(i+1).to_s+""
end
sheet1[5,homeworks.count+4] = "总成绩"
sheet1[5,homeworks.count+5] = "活跃度"
count_row = 6
sheet1[7,homeworks.count+4] = "作业得分"
sheet1[7,homeworks.count+5] = "测评得分"
sheet1[7,homeworks.count+6] = "社区得分"
sheet1[7,homeworks.count+7] = "总得分"
sheet1[7,homeworks.count+8] = "分班"
count_row = 8
members.each_with_index do |member, i|
sheet1[count_row,0]= i+1
sheet1[count_row,1] = member.user.lastname.to_s + member.user.firstname.to_s
@ -1318,36 +1425,47 @@ class CoursesController < ApplicationController
sheet1[count_row,j+4] = score <0 ? 0:score.round(2)
end
end
sheet1[count_row,homeworks.count+4] = member.score.nil? ? 0:member.score.round(2)
sheet1[count_row,homeworks.count+5] = member.act_score.nil? ? 0:member.act_score
hw_score = member.score.nil? ? 0 : member.score
ex_score = member.ex_score.nil? ? 0 : member.ex_score
act_score = member.act_score.nil? ? 0 : member.act_score
sum = hw_score + ex_score + act_score
sheet1[count_row,homeworks.count+4] = hw_score.round(2)
sheet1[count_row,homeworks.count+5] = ex_score
sheet1[count_row,homeworks.count+6] = act_score
sheet1[count_row,homeworks.count+7] = sum.round(2)
sheet1[count_row,homeworks.count+8] = member.course_group_id == 0 ? "暂无" : member.course_group.name
count_row += 1
end
homeworks.each_with_index do |home, i|
sheet = book.create_worksheet :name => "#{i+1}次作业"
sheet[0,0] = "课程编号"
sheet[0,1] = course.id
sheet[1,0] = "课程学期"
sheet[1,1] = course.time.to_s+""+course.term
sheet[2,0] = "课程名称"
sheet[2,1] = course.name
sheet[3,0] = "教师团队"
sheet[3,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、')
sheet[4,0] = "主讲教师"
sheet[4,1] = course.teacher.show_name
sheet[4,0] = "作业批次"
sheet[4,1] = "#{i+1}次作业"
sheet[4,0] = "作业名称"
sheet[4,1] = home.name
sheet[0,1] = course.syllabus.id
sheet[1,0] = "课程名称"
sheet[1,1] = course.syllabus.title
sheet[2,0] = "班级编号"
sheet[2,1] = course.id
sheet[3,0] = "班级学期"
sheet[3,1] = course.time.to_s+""+course.term
sheet[4,0] = "班级名称"
sheet[4,1] = course.name
sheet[5,0] = "教师团队"
sheet[5,1] = (searchTeacherAndAssistant course).map{|member| member.user.show_name}.join('、')
sheet[6,0] = "主讲教师"
sheet[6,1] = course.teacher.show_name
sheet[6,0] = "作业批次"
sheet[6,1] = "#{i+1}次作业"
sheet[6,0] = "作业名称"
sheet[6,1] = home.name
if home.homework_type == 1 #普通作业
if home.anonymous_comment ==0
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
else
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
end
count_row = 6
count_row = 8
items = home.student_works.order("work_score desc")
items.each_with_index do |stu, j|
sheet[count_row,0]= j + 1
@ -1373,13 +1491,13 @@ class CoursesController < ApplicationController
end
elsif home.homework_type == 2 #编程作业
if home.anonymous_comment ==0
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
else
sheet.row(5).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_homework_name),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
end
count_row = 6
count_row = 8
items = home.student_works.order("work_score desc")
items.each_with_index do |stu, j|
sheet[count_row,0]= j + 1
@ -1406,13 +1524,13 @@ class CoursesController < ApplicationController
end
elsif home.homework_type == 3 #分组作业
if home.anonymous_comment ==0
sheet.row(5).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
else
sheet.row(5).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
sheet.row(7).concat([l(:excel_rank),l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
end
count_row = 6
count_row = 8
items = home.student_works.order("work_score desc")
items.each_with_index do |stu, j|
sheet[count_row,0] = j + 1

View File

@ -26,7 +26,7 @@ class FilesController < ApplicationController
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,
:search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment,
:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,
:search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file,:update_file_description]
:search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file,:update_file_description, :edit_file_description]
helper :sort
include SortHelper
@ -981,6 +981,13 @@ class FilesController < ApplicationController
def upload_files_menu
end
def edit_file_description
@attachment = Attachment.find(params[:id])
@attachment.description = params[:file_description_edit]
@attachment.save
end
def update_file_description
@attachment = Attachment.find(params[:id])
@attachment.description = params[:description]

View File

@ -146,7 +146,7 @@ class HomeworkCommonController < ApplicationController
@homework_detail_group = @homework.homework_detail_group
@homework_detail_group.min_num = params[:min_num].to_i if params[:min_num]
@homework_detail_group.max_num = params[:max_num].to_i if params[:max_num]
@homework_detail_group.base_on_project = params[:base_on_project].to_i if params[:base_on_project]
@homework_detail_group.base_on_project = params[:base_on_project] ? 1 : 0
end
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
@ -202,24 +202,24 @@ class HomeworkCommonController < ApplicationController
if @homework_detail_manual.comment_status == 1
student_works = @homework.student_works.has_committed
if student_works && student_works.size >= 2
if @homework.homework_type == 3
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
student_work_projects.each_with_index do |pro_work, pro_index|
n = @homework_detail_manual.evaluation_num
n = n < student_works.size ? n : student_works.size - 1
work_index = -1
student_works.each_with_index do |stu_work, stu_index|
if stu_work.id.to_i == pro_work.student_work_id.to_i
work_index = stu_index
end
end
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
assigned_homeworks.each do |h|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
student_works_evaluation_distributions.save
end
end
else
# if @homework.homework_type == 3
# student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
# student_work_projects.each_with_index do |pro_work, pro_index|
# n = @homework_detail_manual.evaluation_num
# n = n < student_works.size ? n : student_works.size - 1
# work_index = -1
# student_works.each_with_index do |stu_work, stu_index|
# if stu_work.id.to_i == pro_work.student_work_id.to_i
# work_index = stu_index
# end
# end
# assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
# assigned_homeworks.each do |h|
# student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
# student_works_evaluation_distributions.save
# end
# end
# else
student_works.each_with_index do |work, index|
user = work.user
n = @homework_detail_manual.evaluation_num
@ -230,7 +230,7 @@ class HomeworkCommonController < ApplicationController
student_works_evaluation_distributions.save
end
end
end
#end
@homework_detail_manual.update_column('comment_status', 2)
@homework_detail_manual.update_column('evaluation_start', Date.today)
@statue = 1
@ -255,11 +255,28 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.update_column('evaluation_end', Date.today)
#计算缺评扣分
work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")"
@homework.student_works.has_committed.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
student_work.save
if @homework.homework_type != 3
@homework.student_works.has_committed.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
student_work.save
end
else
@homework.student_works.has_committed.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
student_work.save
if student_work.absence_penalty != 0
pros = student_work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
st_work.update_attribute("absence_penalty", student_work.absence_penalty)
end
end
end
end
# 匿评关闭消息邮件通知
send_message_anonymous_comment(@homework, m_status = 3)
Mailer.send_mail_anonymous_comment_close(@homework).deliver

View File

@ -58,65 +58,104 @@ class IssuesController < ApplicationController
include ApplicationHelper
def index
retrieve_query
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if @query.valid?
case params[:format]
when 'csv', 'pdf'
@limit = 10#Setting.issues_export_limit.to_i
when 'atom'
@limit = 10#Setting.feeds_limit.to_i
when 'xml', 'json'
@offset, @limit = api_offset_and_limit({:limit => 10})
else
@limit = 10#per_page_option
# 为了性能所有用了两种模式issue的@query查询所有的没有优势
# 但是对过滤条件很有有时
if params[:set_filter] != "1"
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if User.current.member_of?(@project)
@issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc')
else
@issues_filter = Issue.where(:project_id => @project.id, :is_private => 0).order('updated_on desc')
end
@assign_to_id = params[:assigned_to_id]
@author_id = params[:author_id]
@priority_id = params[:priority_id]
@status_id = params[:status_id]
@subject = params[:subject]
@done_ratio = params[:done_ratio]
@issue_count = @query.issue_count
@issue_pages = Paginator.new @issue_count, @limit, params['page']
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
open_and_close_num(@project)
@issue_count = @issues_filter.count
@limit = 10
@is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => 'issues.updated_on desc',
:offset => @offset,
:limit => @limit)
if params[:set_filter]
@set_filter = params[:set_filter]
end
@issue_count_by_group = @query.issue_count_by_group
@issues = paginateHelper @issues_filter, @limit
respond_to do |format|
format.js
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api {
Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
# format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json}
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
end
else
respond_to do |format|
format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young
format.any(:atom, :csv, :pdf) { render(:nothing => true) }
format.api { render_validation_errors(@query) }
format.js
retrieve_query
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if @query.valid?
@tracker_id = params[:tracker_id]
@assign_to_id = params[:assigned_to_id]
@author_id = params[:author_id]
@status_id = params[:status_id]
@subject = params[:subject]
@done_ratio = params[:done_ratio]
@fixed_version_id = params[:fixed_version_id]
@issue_count = @query.issue_count
@test = params[:test]
@project_sort = 'issues.updated_on desc'
if params[:test] != "0"
case @test
when "1"
@project_sort = 'issues.created_on desc'
when "2"
@project_sort = 'issues.created_on asc'
when "3"
@project_sort = 'issues.updated_on desc'
when "4"
@project_sort = 'issues.updated_on asc'
end
end
open_and_close_num(@project)
@issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count
@issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count
@issues_filter = @query.issues(:order => @project_sort)
@limit = 10
@is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset
@issues = paginateHelper @issues_filter, @limit
respond_to do |format|
format.js
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
# format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json}
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
else
respond_to do |format|
format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young
format.any(:atom, :csv, :pdf) { render(:nothing => true) }
format.api { render_validation_errors(@query) }
format.js
end
end
end
rescue ActiveRecord::RecordNotFound
render_404
end
# 获取issue的开启统计数
def open_and_close_num project
if User.current.member_of?(project)
@issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6)").count
@issue_close_count = Issue.where(:project_id => project.id, :status_id => 5 ).count
else
@issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6) and is_private = 0").count
@issue_close_count = Issue.where(:project_id => project.id, :status_id => 5, :is_private => 0).count
end
end
def show
# 打开编辑内容
@is_edit = true unless params[:edit].nil?

View File

@ -47,6 +47,9 @@ class MessagesController < ApplicationController
all_comments = []
@replies = get_all_children(all_comments, @topic)
@reply_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new(:subject => "RE: #{@message.subject}")
if @course
#@replies = @topic.children.
@ -57,7 +60,11 @@ class MessagesController < ApplicationController
#all
#@replies = paginateHelper messages_replies,10
@left_nav_type = 2
render :action => "show", :layout => "base_courses"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}
end
#render :action => "show", :layout => "base_courses"#by young
elsif @project
#@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
@ -66,8 +73,10 @@ class MessagesController < ApplicationController
# limit(@reply_pages.per_page).
# offset(@reply_pages.offset).
# all
render :action => "show", :layout => "base_projects"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_projects'}
end
else
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
@ -78,7 +87,10 @@ class MessagesController < ApplicationController
# all
@organization = @org_subfield.organization
render :action => "show", :layout => "base_org"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_org'}
end
end
end

View File

@ -171,6 +171,10 @@ class NewsController < ApplicationController
result = cs.show_course_news params,User.current
@news = result[:news]
@comments = result[:comments]
@comments_count = @comments.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@comments = @comments[@page * @limit..@page * @limit + 9]
@comment = Comment.new
#@comments = @news.comments
#@comments.reverse! if User.current.wants_comments_in_reverse_order?
@ -179,12 +183,23 @@ class NewsController < ApplicationController
@course = Course.find(@news.course_id)
if @course
@left_nav_type = 4
render :layout => 'base_courses'
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}
end
end
elsif @project
respond_to do |format|
format.js
format.html {render :layout => 'base_projects'}
end
elsif @news.org_subfield_id
@org_subfield = OrgSubfield.find(@news.org_subfield_id)
@organization = @org_subfield.organization
render :layout => 'base_org'
respond_to do |format|
format.js
format.html {render :layout => 'base_org'}
end
end
end

View File

@ -34,7 +34,7 @@ class RepositoriesController < ApplicationController
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis]
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive]
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive, :export_rep_static]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis]
# 链接gitlab
@ -69,6 +69,20 @@ class RepositoriesController < ApplicationController
end
def export_rep_static
@project = Project.find(params[:id])
gpid = @project.gpid
rev = params[:rev]
cycle = params[:cycle]
respond_to do |format|
format.html
format.xls{
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
send_data(export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
def forked
@project = Project.find(params[:id])
@repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab")

View File

@ -106,13 +106,13 @@ class StudentWorkController < ApplicationController
rescue Timeout::Error
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
logger.info "program_test_ex user wait time = #{tUsedtime} 毫秒"
#status 0:答案正确 -5program_test_ex 函数出错 -4judge代码出错 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
resultObj[:status] = -3
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
rescue => e
#-4 judge代码 出错
logger.debug "program_test_error #{e}"
logger.info "program_test_error #{e}"
resultObj[:status] = -4
tmpstatus = -4
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id)
@ -217,7 +217,7 @@ class StudentWorkController < ApplicationController
end
rescue
#-5 program_test_ex 函数出错
logger.debug "program_test_error 2"
logger.info "program_test_error 2"
resultObj[:status] = -5
tmpstatus = -5
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id)

View File

@ -102,7 +102,7 @@ class SubDocumentCommentsController < ApplicationController
@subdomain = @document.sub_domain
@org_subfield = @subdomain.org_subfield
@organization = @org_subfield.organization
@act = OrgActivity.find(params[:id])
@act = OrgActivity.find(params[:act_id])
@comment = SubDocumentComment.new(:sub_domain_id => @document.sub_domain, :creator_id => User.current.id, :reply_id => params[:id])
@comment.content = params[:sub_content]
@document.children << @comment

View File

@ -45,12 +45,12 @@ class SyllabusMemberController < ApplicationController
member = SyllabusMember.find(params[:id])
@syllabus = member.syllabus
members = @syllabus.syllabus_members
if params[:opr] == 'up' && member.rank > 2
if params[:opr] == 'up' && member.rank > 1
before_mem = members.where("rank = #{member.rank - 1}").first
if before_mem && member.update_attribute('rank', member.rank - 1)
before_mem.update_attribute('rank', before_mem.rank + 1)
end
elsif params[:opr] == 'down' && member.rank > 1 && member.rank < members.count
elsif params[:opr] == 'down' && member.rank < members.count
after_mem = members.where("rank = #{member.rank + 1}").first
if after_mem && member.update_attribute('rank', member.rank + 1)
after_mem.update_attribute('rank', after_mem.rank - 1)

View File

@ -33,6 +33,8 @@ class SyllabusesController < ApplicationController
@syllabus.user_id = User.current.id
@syllabus.description = Message.where("id = 19412").first.nil? ? '' : Message.where("id = 19412").first.content
if @syllabus && @syllabus.save
member = SyllabusMember.create(:user_id => @syllabus.user_id, :rank => 1)
@syllabus.syllabus_members << member
respond_to do |format|
flash[:notice] = l(:notice_successful_create)
format.html {redirect_to syllabus_path(@syllabus)}

View File

@ -625,7 +625,7 @@ class UsersController < ApplicationController
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end
@type = params[:type]
@type = params[:type] ? params[:type] : '1'
@limit = 10
@is_remote = true
@hw_count = @homeworks.count
@ -808,7 +808,7 @@ class UsersController < ApplicationController
#@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
end
end
@type = params[:type]
@type = params[:type] ? params[:type] : '1'
@property = params[:property]
@is_import = params[:is_import]
@limit = params[:is_import].to_i == 1 ? 15 : 10
@ -1033,7 +1033,7 @@ class UsersController < ApplicationController
update_org_activity(homework.class,homework.id)
flash[:notice] = l(:notice_successful_create)
redirect_to student_work_index_url(:homework => params[:homework])
redirect_to student_work_index_url(:homework => params[:homework], :tab => 2)
else
render_403
end
@ -3200,6 +3200,7 @@ class UsersController < ApplicationController
ori = Attachment.find_by_id(send_id)
# 如果该附件已经存课程中,则只更新附件创建时间
mul_container.attachments.each do |att|
@exist = false
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
att.created_on = Time.now
att.save

View File

@ -53,7 +53,6 @@ class VersionsController < ApplicationController
@offset ||= @versions_pages.offset
@versions = @versions.slice(@offset, @limit)
#end by young
@issues_by_version = {}
if @selected_tracker_ids.any? && @versions.any?
@ -81,6 +80,11 @@ class VersionsController < ApplicationController
all
}
format.api
# format.xls {
# @issues = @version.fixed_issues.visible.includes(:status, :tracker, :priority).reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").all
# filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls"
# send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
# }
end
end

View File

@ -63,6 +63,69 @@ module ApplicationHelper
result
end
# 项目版本库导出Excel功能
def export_rep_xls(gpid, options = {})
g = Gitlab.client
cycle = params[:cycle]
rev = params[:rev]
if cycle == "week"
statics = g.rep_stats_week(gpid, :rev => rev)
elsif cycle == "month"
statics = g.rep_stats_month(gpid, :rev => rev)
end
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "版本库"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])
count_row = 1
statics.each do |static|
user = User.where(:mail => static.email).first
sheet1[count_row,0] = rev
sheet1[count_row,1] = user.nil? ? static.uname : user.show_name
sheet1[count_row,2] = static.commits_num
sheet1[count_row,3] = static.add
sheet1[count_row,4] = static.del
sheet1[count_row,5] = static.changes
sheet1[count_row,6] = Time.now.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,7] = cycle == "week" ? "最近1周" : "最近一月"
sheet1[count_row,8] = static.email
count_row += 1
end
book.write xls_report
xls_report.string
end
# 项目issue列表导出Excel功能
def issue_list_xls issues
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "issues"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
count_row = 1
issues.each do |issue|
sheet1[count_row,0] = issue.id
sheet1[count_row,1] = issue_tracker_change(issue.tracker_id)
sheet1[count_row,2] = issue.subject
sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe
sheet1[count_row,4] = issue_status_change(issue.status_id)
sheet1[count_row,5] = issue.assigned_to.try(:show_name)
sheet1[count_row,6] = issue_priority_change(issue.priority_id)
sheet1[count_row,7] = issue.author.show_name
sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,9] = issue.fixed_version.try(:name)
sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d')
sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d')
sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id)
count_row += 1
end
book.write xls_report
xls_report.string
end
# 获取用户单位
# 优先获取高校信息如果改信息不存在则获取occupation
def get_occupation_from_user user
@ -1799,7 +1862,11 @@ module ApplicationHelper
end
def link_to_function(name, function, html_options={})
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => " c_purple"))
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => "BlueCirBtnMini ml10",:style => "display:inline-block; height:20px; line-height:20px;"))
end
def link_to_function_none(name, function, html_options={})
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:style => "display:inline-block; height:20px; line-height:20px;"))
end
# Helper to render JSON in views
@ -1821,8 +1888,8 @@ module ApplicationHelper
end
def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;&nbsp;".html_safe + " | "+ "&nbsp;&nbsp;".html_safe +
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;&nbsp;".html_safe + " | "+ "&nbsp;&nbsp;".html_safe +
link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
# 本次修改,修改为只显示关闭的所占%比
@ -2213,6 +2280,8 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="Memo" #论坛资源允许下载
candown = true
elsif attachment.container.class.to_s=="Syllabus" #论坛资源允许下载
candown = true
elsif attachment.container.class.to_s == "User"
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
@ -2762,7 +2831,7 @@ module ApplicationHelper
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
end
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 && work.user_id == User.current.id #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束"
@ -3244,17 +3313,32 @@ def get_reply_parents_no_root parents_rely, comment
parents_rely
end
def get_all_children_ex result, jour
if jour.kind_of? Message
jour.children.includes(:author, :praise_tread_cache).each do |jour_child|
result << jour_child
get_all_children_ex result, jour_child
end
elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
jour.children.each do |jour_child|
result << jour_child
get_all_children_ex result, jour_child
end
end
result
end
#获取所有子节点
def get_all_children result, jour
if jour.kind_of? Message
jour.children.includes(:author, :praise_tread_cache).each do |jour_child|
result << jour_child
get_all_children result, jour_child
get_all_children_ex result, jour_child
end
elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
jour.children.each do |jour_child|
result << jour_child
get_all_children result, jour_child
get_all_children_ex result, jour_child
end
end
if jour.respond_to?(:created_on)
@ -3496,7 +3580,9 @@ def get_group_member_names work
end
def course_syllabus_option user = User.current
syllabuses = user.syllabuses
syllabus_members = SyllabusMember.where("user_id = #{user.id}")
syllabus_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|mem| mem.syllabus_id}.join(',') + ")"
syllabuses = Syllabus.where("id in #{syllabus_ids}")
type = []
option1 = []
option1 << "请选择课程"

View File

@ -57,6 +57,15 @@ module IssuesHelper
"<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe
end
def states_done_ratio(issue)
done_ratio = issue.done_ratio
if done_ratio == 100
"<span class='c_green' style='display:inline-block;'>#{l(:label_done_ratio_endding)}</span>".html_safe
else
"<span class='c_orange' style='display:inline-block;'>#{l(:label_done_ratio_doing)}</span>".html_safe
end
end
def issue_heading(issue)
#h("#{issue.tracker} ##{issue.id}")
# h("#{issue.tracker} #{issue.source_from}")
@ -117,6 +126,11 @@ module IssuesHelper
end
end
def options_for_version_isuue_list(project)
versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
end
def render_issue_subject_with_tree(issue)
s = ''
ancestors = issue.root? ? [] : issue.ancestors.visible.all

View File

@ -255,16 +255,20 @@ module QueriesHelper
# Give it a name, required to be valid
@query = IssueQuery.new(:name => "_")
@query.project = @project
params[:f] = %w(subject status_id priority_id author_id assigned_to_id created_on) unless params[:status_id].nil?
params[:f] = %w(subject tracker_id status_id done_ratio author_id assigned_to_id fixed_version_id created_on) unless params[:status_id].nil?
params[:op] = {'subject' => "~" ,
'status_id' => ( params[:status_id] == '0' ? "!":"=" ),
'priority_id' => ( params[:priority_id] == '0' ? "!":"=" ),
'author_id' => ( params[:author_id] == '0' ? "!":"=" ),
'author_id' =>(params[:author_id] == '0' ? "!":"=" ),
'done_ratio' => ( params[:done_ratio]== '-1' ? "!":"="),
'tracker_id' => ( params[:tracker_id] == '0' ? "!":"=" ),
'fixed_version_id' => ( params[:fixed_version_id] == '0' ? "!":"=" ),
'assigned_to_id' => ( params[:assigned_to_id] == '0' ? "!":"=" )} unless params[:status_id].nil?
params[:v] = {'subject' => [params[:subject]],
'status_id' => [params[:status_id]],
'priority_id' => [params[:priority_id]],
'author_id' => [params[:author_id]],
'done_ratio' => [params[:done_ratio]],
'tracker_id' => [params[:tracker_id]],
'fixed_version_id' => [params[:fixed_version_id]],
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
if(params[:status_id] != nil)
if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' &&

View File

@ -344,7 +344,7 @@ module WatchersHelper
def exit_project_link(project)
link_to(l(:label_exit_project),exit_cur_project_path(project.id),
:remote => true, :confirm => l(:lable_sure_exit_project),
:class => "pr_join_a_quit" )
:class => "sy_btn_grey mr5" )
end
#项目关注、取消关注
@ -361,8 +361,8 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort))
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method,
:class => "pr_join_a" ,:id=>id
end
:class => "sy_btn_pink mr5" ,:id=>id
end
# 申请加入项目
def join_in_project_link(project, user, options=[])
@ -372,9 +372,9 @@ module WatchersHelper
method = 'post'
@applied_flag = project.instance_of?(Project)
if applied
link = "<a class ='pr_join_a'>#{text}</a>"
link = "<a class ='sy_btn_pink mr5'>#{text}</a>"
else
link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a")
link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "sy_btn_pink mr5")
end
link.html_safe
# if applied

View File

@ -41,7 +41,7 @@ class Attachment < ActiveRecord::Base
validates :filename, presence: true, length: {maximum: 254}
validates :author, presence: true
validates :disk_filename, length: {maximum: 254}
validates :description, length: {maximum: 254}
# validates :description, length: {maximum: 254}
validate :validate_max_file_size
#elasticsearch

View File

@ -24,7 +24,7 @@ class Course < ActiveRecord::Base
end
end
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
@ -96,7 +96,9 @@ class Course < ActiveRecord::Base
'class_period',
'open_student',
'is_delete',
'syllabus_id'
'syllabus_id',
'end_time',
'end_term'
acts_as_customizable

View File

@ -305,6 +305,11 @@ class Project < ActiveRecord::Base
errors[:identifier].blank? && !(new_record? || identifier.blank?)
end
# returns project's creater
def creater
User.find(self.user_id).try(:show_name)
end
# returns latest created projects
# non public projects will be returned only if user is a member of those
def self.latest(user=nil, count=5)

View File

@ -1,6 +1,6 @@
#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
class StudentWork < ActiveRecord::Base
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty
belongs_to :homework_common
belongs_to :user

View File

@ -853,6 +853,13 @@ class User < Principal
OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count > 0
end
def member_of_syl?(syllabus)
if !self.logged?
return false
end
SyllabusMember.where("user_id =? and syllabus_id =?", self.id, syllabus.id).count > 0
end
def admin_of_org?(org)
if self.admin?
return true

View File

@ -418,7 +418,7 @@ class CoursesService
course.send(:safe_attributes=, params[:course], current_user)
#course.safe_attributes = params[:course]
#course.password = params[:course][:password]
course.syllabus_id = params[:syllabus_id].to_i
#course.syllabus_id = params[:syllabus_id].to_i
course.time = params[:time]
course.term = params[:term]
course.end_time = params[:end_time]

View File

@ -38,11 +38,13 @@
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=homework.name%>'>
<%=link_to(homework.try(:name), student_work_index_path(:homework => homework.id))%>
</td>
<% if homework.course %>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=homework.course.name%>'>
<%= link_to(homework.course.name, course_path(homework.course.id)) %>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%= homework.course.nil? ? "" : homework.course.name %>'>
<% if homework.course %>
<%= link_to homework.course.name, course_path(homework.course.id) %>
<% end %>
</td>
<% end %>
<td align="center" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<% if homework.try(:user).try(:realname) == ' '%><%= homework.try(:user)%><% else %><%=homework.try(:user).try(:realname) %><% end %>'>
<% if homework.try(:user).try(:realname) == ' '%>
<%= link_to(homework.try(:user), user_path(homework.user_id)) %>

View File

@ -106,7 +106,8 @@
</div>
<div class="cl"></div>
<% all_comments = []%>
<% count=get_all_children(all_comments, @article).count %>
<% all_replies = get_all_children(all_comments, @article) %>
<% count= all_replies.count %>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
@ -119,8 +120,7 @@
<div class="homepagePostReplyBannerTime"></div>
</div>
<% all_comments = []%>
<% comments = get_all_children(all_comments, @article) %>
<% comments = all_replies %>
<% if count > 0 %>
<div class="" id="reply_div_<%= @article.id %>">
<% comments.each do |comment| %>

View File

@ -46,12 +46,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_repies = get_all_children(all_comments, activity) %>
<% count = all_repies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_repies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%>

View File

@ -1,16 +1,10 @@
<div class="project_r_h">
<div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
</div>
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<p style="float:right;">
<%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
</p>
@ -40,3 +34,7 @@
<% end %>
<% html_title(l(:label_calendar)) -%>
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script>

View File

@ -1,4 +1,4 @@
<table class="cal" style="width: 100%;table-layout: fixed;">
<table id="calender" class="cal" style="width: 100%;table-layout: fixed;">
<thead>
<tr>
<th scope="col" title="<%= l(:label_week) %>" class="week-number"></th>
@ -20,13 +20,13 @@
<div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
<%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_issue i, :truncate => 30 %>
(<%= states_done_ratio i %>)
<span class="tip"><%= render_issue_tooltip i %></span>
</div>
<% else %>
<span class="icon icon-package">
<%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_version i%>
</span>
<span class="icon icon-package"></span>
<%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_version i%>
<% end %>
<% end %>
</td>

View File

@ -1,10 +1,10 @@
<div class="st_list">
<div class="st_search" id="search_members">
<div class="sy_class_fenban clear">
<div id="search_members">
<%= render :partial => 'searchmembers' %>
</div>
<div class="cl"></div>
<div class="st_addclass" id="st_groups">
<div id="st_groups">
<%= render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups} %>
</div>
<div class="cl"></div>
@ -12,5 +12,4 @@
<div id="member_content">
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
</div>
</div> <!-- st_list end-->
<div class="cl"></div>
</div> <!-- st_list end-->

View File

@ -7,9 +7,9 @@
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
div.respond-form .reply_btn{margin-left:625px;margin-top:5px;}
div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
div.recall_con .reply_btn{margin-left:585px;margin-top:5px;}
/*.ke-container{height: 80px !important;}*/
</style>
<%= content_for(:header_tags) do %>
@ -19,7 +19,7 @@
<script >
init_KindEditor_data('',80);
</script>
<div class="msg_box fl mb10" id='leave-message'>
<div class="msg_box fl mb10" id='leave-message' style="width:730px;">
<h4><%= l(:label_leave_message) %></h4>
<% if !User.current.logged?%>

View File

@ -5,7 +5,7 @@
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
</div>
<div class="ping_discon upload_img" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_discon upload_img" style="width: 670px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span>

View File

@ -1,56 +1,42 @@
<ul>
<li style=" color:#8b8b8b;">分班:</li>
<li class="classbox" id="course_group_0">
<li class="fl mt5" style="color:#8b8b8b;">分班:</li>
<li class="fl sy_fenban_list mr10 mb10 ml10" id="course_group_0">
<%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
</li>
<li class="fl sy_fenban_list mr10 mb10" id="course_group_1">
<%= link_to "未分班", searchgroupmembers_course_path(@course,:group_id => -1), :onclick => "checkclass('course_group_0')", method: 'get', remote: true, :class => 'fl mr5'%>
<span class="fl sy_cgrey">(<%=@no_group_count %>人)</span>
</li>
<% unless course_groups.nil? %>
<% course_groups.each do |group| %>
<% group_name = " #{ group.name}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
<li class="classbox" style="margin-bottom: 5px;">
<%= link_to group_name, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%>
<%# group_name = " #{ group.name}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
<li class="fl sy_fenban_list clear mr10 mb10">
<%= link_to group.name, searchgroupmembers_course_path(@course,:group_id => group.id), class: 'fl mr5', method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%>
<span class="fl sy_cgrey mr5">(<%=group.members.count.to_s %>人)</span>
<% if @canShowCode%>
<a href="javascript:void(0)" class="sy_icons_edit fl" onclick="$('#edit_group_name').val('<%= group.name%>');$('#edit_group_id').val('<%= group.id%>');$('#edit_group_form').slideToggle();"></a>
<% if group.members.empty?%>
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
:data => {confirm: l(:label_delete_group)},
:class => 'f_1',
:style => "width: 11px;height: 16px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
%>
:class => 'sy_icons_del fl'
%>
<% else%>
<a href="javascript:" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" style="margin-right:4px;" >
<img src="/images/pic_del.gif" width="11" height="12" alt="删除班级" title="删除该班级" />
</a>
<a href="javascript:void(0)" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" class="sy_icons_del fl"></a>
<% end%>
<a href="javascript:void(0)" class="f_l" style="padding-left: 5px;" onclick="$('#group_name_<%= group.id %>').val('<%= group.name%>');$('#edit_group_<%= group.id %>').slideToggle();$('#new_group_name').hide();">
<img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" />
</a>
<% end %>
</li>
<!-- 编辑分班 -->
<li>
<% if @canShowCode%>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %>
<span id="edit_group_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
<input type="text" id="group_name_<%= group.id%>" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="edit_group('group_name_<%= group.id%>','<%= valid_ajax_course_path%>','<%= @course.id%>','<%= group.id%>');"/>
</span>
<% end %>
<% end %>
</li>
<% end %>
<% end %>
<% if @canShowCode %>
<li style="margin-left:15px;margin-top: 2px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();$('#edit_group_36').hide();">+添加分班</a>
</li>
<li >
<span id="new_group_name" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
<input type="text" id="group_name" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');"/>
<% end %>
</span>
<!-- 编辑分班 -->
<% if @canShowCode%>
<li id="edit_group_form" class="fl mr10 mb10 clear undis">
<%= form_tag(updategroupname_course_path(@course), method: 'get', remote:true, :id => 'update_group_form') do %>
<input type="hidden" name="group_id" id="edit_group_id"/>
<input class="fl mr5 sy_fenban_input" id="edit_group_name"name="group_name" size="20" maxlength="20"/>
<a href="javascript:void(0)" class="sy_btn_blue fl mr5" onclick="edit_group('edit_group_name','<%= valid_ajax_course_path%>','<%= @course.id%>','edit_group_id');">确定</a>
<a href="javascript:void(0)" class="sy_btn_grey fl" onclick="$('#edit_group_form').hide(); $('#edit_group_id').val(''); $('#edit_group_name').val('');">取消</a>
<% end %>
</li>
<% end %>
<% end %>
</ul>

View File

@ -1,123 +1,156 @@
<!-- 加入分班 -->
<div style="margin-left: 15px">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
<span style="font-size: 12px; float: left; margin-right: 5px">
<%= l(:label_current_group)%>:&nbsp;
<%= @group.name %>
</span>
<% end %>
</div>
<div class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
<table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0">
<thead>
<tr class="clear">
<th class="sy_th7">序号</th>
<th class="sy_th15">姓名</th>
<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;'%>
<% if @sort_type == "student_id" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% end %>
</th>
<th class="sy_th0 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;'%>
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
班级作业的得分总和</p>
</div>
</th>
<th class="sy_th0 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;'%>
<% if @sort_type == "ex_score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
班级测验的得分总和</p>
</div>
</th>
<th class="sy_th0 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;'%>
<% if @sort_type == "act_score" && @score_sort_by == 'desc' %>
<a href="javascript:" class= "sy_sortdownbtn"></a>
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
<a href="javascript:" class= "sy_sortupbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
资源发布:资源数 x 5 <br>
问答发布:发帖数 x 2 <br>
通知发布:通知数 x 1 <br>
问答回复:回复数 x 1 <br>
作业留言:留言数 x 1 <br>
通知留言:留言数 x 1 <br>
班级留言:留言数 x 1 <br>
总得分为以上得分之和
</p>
<div class="cl"></div>
<% end %>
<div class="st_box">
<ul class="st_box_top">
<li class="ml50" style="padding-right: 5px;"><span class="fontGrey6 fb">姓名</span></li>
<li class="ml10" style="padding-right: 15px;"><span class="fontGrey6 fb">学号</span></li>
<% unless @course.course_groups.empty? %>
<li style="padding-right: 55px; margin-left: 160px;"><span class="fontGrey6 fb">分班</span></li>
<% end %>
<li class="st_list_score <%= @course.course_groups.empty? ? 'ml250' : 'ml10' %>">
<%= link_to '英雄榜', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml35'%>
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
<a id="pic" href="javascript:" class= "st_up"></a>
<% end %>
</li>
<li class="st_list_score">
<%= link_to '活跃度', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml35'%>
<% if @sort_type == "act_score" && @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
<a id="pic" href="javascript:" class= "st_up"></a>
<% end %>
</li>
<li class="ml20"><span class="fontGrey6 fb">加入时间</span></li>
</ul>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<ul>
<li>
<%= link_to("#{l(:label_bidding_user_studentname)}<span class='hidden st_info_block'>#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
</li>
<br/>
<% unless member.user.user_extensions.student_id == ''%>
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span class='hidden st_info_block'>#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%>
</ul>
<% unless @course.course_groups.empty? %>
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
<% if @course.course_groups.nil? || @group %>
<div class="select-class-option fl" style="margin-left: 5px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option fl" style="margin-left: 5px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
</div>
<%= select( :name,:group_id, course_group_option(@course),
{ :include_blank => false,:selected => member.course_group_id},
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 5px;"}) %>
<% end %>
<% end %>
<% else %>
<div class="select-class-option fl" style="margin-left: 5px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% end %>
<% end %>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => "st_list_score c_red #{@course.course_groups.empty? ? 'ml130' : ''}" %>
<%= link_to member.act_score.nil? ? 0 : member.act_score.to_s, {
:action => 'show_member_act_score',
:member_id => member.id,
:remote => true},
:class => 'st_list_score c_red' %>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
</th>
<th class="sy_th0 sy_fenban_tap">总得分
<div class="sy_fenban_show undis" style="width:180px;">
<p>积分规则<br/>
作业得分+测评得分+社区得分</p>
</div>
</th>
<th class="sy_th13">分班</th>
</tr>
</thead>
<tbody>
<% members.each_with_index do |member, i| %>
<tr class="clear">
<% user = member.user %>
<% hw_score = member.score.nil? ? 0 : member.score %>
<% ex_score = member.ex_score.nil? ? 0 : member.ex_score %>
<% act_score = member.act_score.nil? ? 0 : member.act_score %>
<% sum = hw_score + ex_score + act_score %>
<td><%= (@page - 1) * @limit + i + 1 %></td>
<td>
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(member.user_id), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
<span class="fl sy_class_users_st_name" title="<%= user.show_name %>"><%= user.show_name %></span>
</td>
<td>
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
</td>
<td>
<%= link_to format("%0.2f", hw_score), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => "" %>
</td>
<td><%= ex_score %></td>
<td>
<%= link_to act_score, {
:action => 'show_member_act_score',
:member_id => member.id,
:remote => true},
:class => '' %>
</td>
<td class="pr">
<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;">
<span style="top: 75px;"></span>
<p >
<font class="fb"><%= user.show_name %></font><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.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.homework_num.nil? ? 0 : member.homework_num %></font>留言数:<%= member.homework_journal_num.nil? ? 0 : member.homework_journal_num %><br/>
班级&nbsp;&nbsp;&nbsp;&nbsp;留言数:<%= member.journal_num.nil? ? 0 : member.journal_num %><br />
测验&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.exercise_num.nil? ? 0 : member.exercise_num %>
</p>
</div>
<div class="cl"></div>
<% end; reset_cycle %>
</div>
<!--<ul class="wlist">
<% #= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>-->
</td>
<td>
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? || User.current == user %>
<% if @course.course_groups.empty? %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option">
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>
</div>
<%= select( :name,:group_id, course_group_option(@course),
{ :include_blank => false,:selected => member.course_group_id},
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w100 undis class-edit sy_fenban_select", :style => "margin-left: 5px;"}) %>
<% end %>
<% end %>
<% else %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @mem_pages, @members_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>
<% else%>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end%>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
<script>
$(document).ready(function(){
/*$(".select-class-option").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".select-class-option").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});*/
$(".pic_edit2").click(function(){
$(".pic_edit_icon").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
@ -137,12 +170,33 @@
$('.class-edit').css('display','none');
$('.select-class-option').show();
});
$('.class-edit,.pic_edit2').bind('click',function(e){
$('.class-edit,.pic_edit_icon').bind('click',function(e){
stopPropagation(e);
});
});
function join_group_function(id){
$(id).submit();
}
$(".sy_new_table tr").each(function(){
$(this).mouseenter(function(){
$(".sy_tips_box_inner").hide();
$(this).children().eq(6).children().eq(1).stop();
$(this).children().eq(6).children().eq(1).show();
});
$(this).mouseleave(function(){
$(this).children().eq(6).children().eq(1).delay(500).hide(0);
});
});
$(".sy_tips_box_inner").each(function(){
$(this).mouseover(function(){
$(this).stop();
$(this).show();
});
$(this).mouseout(function(){
$(this).delay(500).hide(0);
});
});
</script>

View File

@ -1,11 +1,35 @@
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生登录名、姓名、学号进行搜索'%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<input type="hidden" name="ingroup">
<% else %>
<input type="hidden" name="incourse">
<div class="clear mb10">
<% if @canShowCode %>
<a href="javascript:void(0)" class="sy_btn_green fl mr10" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();">添加分班</a>
<div class="fl" id="new_group_name" style="display:none; vertical-align: middle;">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
<input type="text" id="group_name" name="group_name" size="20" class="fl mr5 sy_fenban_input" placeholder="例如A班" maxlength="20" />
<a href="javascript:void(0)" class="sy_btn_blue fl mr5" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');">确定</a>
<a href="javascript:void(0)" class="sy_btn_grey fl" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();">取消</a>
<% end %>
</div>
<% end %>
<div class="hw_search_box fr">
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
<input class="hw_search-input" name="name" id="search_member_input" placeholder="输入学生登录名/姓名/学号进行搜索" type="text">
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group == -1 ? -1 : @group.id}", name: 'search_group_id' %>
<input type="hidden" name="ingroup">
<% else %>
<input type="hidden" name="incourse">
<% end %>
<% end %>
<% end %>
<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
<a href="javascript:void(0)" class="hw_btn_search" onclick="$('#search_student').submit();"></a>
</div>
</div>
<script>
$(function(){
$("#search_member_input").keypress(function(e){
var name = $.trim($('#search_member_input').val());
if (e.keyCode == '13' && name != "" && name.length != 0) {
$(this).parent().submit();
}
})
});
</script>

View File

@ -45,7 +45,8 @@
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
</li>
<% end %>
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin? %>
<% group_count = @course.course_groups.count %>
<% if show_nav?(group_count) && ((User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?) %>
<li>
<%=link_to "分班", course_member_path(@course, :role => 2) %>
</li>

View File

@ -1,2 +1,4 @@
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
$('#group_name').val('');
$('#new_group_name').hide();

View File

@ -2,7 +2,7 @@
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
<div class="courseRSide fl">
<div class="project_r_h">
<div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2>
</div>

View File

@ -1,17 +1,35 @@
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member' %>
</span>
<% end %>
</div>
<% if @subPage_title == l(:label_student_list)%>
<%= render :partial => 'course_student', :locals => {:members => @members} %>
<% else%>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
<% end%>
<% if @role.to_i == 1 %>
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member', :class => 'hw_more_li' %>
</span>
<% end %>
</div>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
</div>
<% else %>
<div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10">
<h3><%= @subPage_title %></h3>
<div class="hw_more_box">
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'hw_more_li'%></li>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<li>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</div>
<%= render :partial => 'course_student', :locals => {:members => @members} %>
</div>
<% end %>

View File

@ -1,5 +1,5 @@
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
</div>
<script>
@ -32,8 +32,9 @@
</li>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<%= 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><%=@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'} %>
<!--<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 class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>

View File

@ -98,7 +98,7 @@
<div class="reTop mb5">
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
<%= submit_tag "内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %>
<%= submit_tag "内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %>
<%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite" %>
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %>
<input class="blueBtn fr mr5" value="上传资源" onclick="course_files_upload();">

View File

@ -43,8 +43,10 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_org_subfield_file_path(file.container,file)%>','<%= file.id %>');"><%= file.description %></textarea>
<%= form_tag(edit_file_description_org_subfield_file_path(file, :org_subfield_id => org_subfield.id ),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
<% end %>
</div>
<% else %>
<div class="fontGrey2 mb4">
@ -108,3 +110,8 @@
<%end%>
<% end%>
<script>
function commit_files_description(id) {
$(id).submit();
}
</script>

View File

@ -40,8 +40,10 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_project_file_path(project,file)%>','<%= file.id %>');"><%= file.description %></textarea>
<%= form_tag(edit_file_description_project_file_path(file, :project_id => project.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
<% end %>
</div>
<% else %>
<div class="fontGrey2 mb4">
@ -70,6 +72,11 @@
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%>
</ul>
<script>
function commit_files_description(id) {
$(id).submit();
}
</script>

View File

@ -42,8 +42,10 @@
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
</div>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
onblur="edit_file_description('<%= update_file_description_course_file_path(@course,file)%>','<%= file.id %>');"><%= file.description %></textarea>
<%= form_tag(edit_file_description_course_file_path(file, :course_id => @course.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
<% end %>
</div>
<% else %>
<div class="fontGrey2 mb4">
@ -99,4 +101,9 @@
</div>
</div>
</div>
<div class="cl"></div>
<div class="cl"></div>
<script>
function commit_files_description(id) {
$(id).submit();
}
</script>

View File

@ -0,0 +1,3 @@
$("#file_description_show_<%= @attachment.id %>").html("<%= escape_javascript render(:partial => "files/file_description", :locals => {:file => @attachment}) %>");
$("#file_description_show_<%= @attachment.id %>").show();
$("#file_description_edit_<%= @attachment.id %>").hide();

View File

@ -35,5 +35,5 @@
<% end %>
<% else %>
<%= render :partial => "layouts/no_content" %>
<%#= render :partial => "layouts/no_content" %>
<% end %>

View File

@ -1,321 +1,323 @@
<div class="project_r_h">
<h2 class="project_h2"><% @gantt.view = self %>
<%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
</div>
<%= form_tag({:controller => 'gantts', :action => 'show',
:project_id => @project, :month => params[:month],
:year => params[:year], :months => params[:months]},
:method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<fieldset class="collapsible collapsed">
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
<div style="display: none;">
<table>
<tr>
<td>
<fieldset>
<legend><%= l(:label_related_issues) %></legend>
<label>
<%= check_box_tag "draw_rels", params["draw_rels"], params[:set_filter].blank? || params[:draw_rels] %>
<% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %>
<% rels.each do |rel| %>
<% color = Redmine::Helpers::Gantt::DRAW_TYPES[rel][:color] %>
<%= content_tag(:span, '&nbsp;&nbsp;&nbsp;'.html_safe,
:style => "background-color: #{color}") %>
<%= l(IssueRelation::TYPES[rel][:name]) %>
<% end %>
</label>
</fieldset>
</td>
<td>
<fieldset>
<legend><%= l(:label_gantt_progress_line) %></legend>
<label>
<%= check_box_tag "draw_progress_line", params[:draw_progress_line], params[:draw_progress_line] %>
<%= l(:label_display) %>
</label>
</fieldset>
</td>
</tr>
</table>
</div>
</fieldset>
<p class="contextual">
<%= gantt_zoom_link(@gantt, :in) %>
<%= gantt_zoom_link(@gantt, :out) %>
</p>
<p class="buttons">
<%= text_field_tag 'months', @gantt.months, :size => 2 %>
<%= l(:label_months_from) %>
<%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
<%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
<%= hidden_field_tag 'zoom', @gantt.zoom %>
<%= link_to_function l(:button_apply), '$("#query_form").submit()',
:class => 'icon icon-checked' %>
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 },
:class => 'icon icon-reload' %>
</p>
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<%
zoom = 1
@gantt.zoom.times { zoom = zoom * 2 }
subject_width = 330
header_height = 18
headers_height = header_height
show_weeks = false
show_days = false
if @gantt.zoom > 1
show_weeks = true
headers_height = 2 * header_height
if @gantt.zoom > 2
show_days = true
headers_height = 3 * header_height
end
end
# Width of the entire chart
g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
@gantt.render(:top => headers_height + 8,
:zoom => zoom,
:g_width => g_width,
:subject_width => subject_width)
g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max
t_height = g_height + headers_height
%>
<% if @gantt.truncated %>
<p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
<% end %>
<table style="width:100%; border:0; border-collapse: collapse;">
<tr>
<td style="width:<%= subject_width %>px; padding:0px;">
<%
style = ""
style += "position:relative;"
style += "height: #{t_height + 24}px;"
style += "width: #{subject_width + 1}px;"
%>
<%= content_tag(:div, :style => style) do %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{headers_height}px;"
style += 'background: #eee;'
%>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{t_height}px;"
style += 'border-left: 1px solid #c0c0c0;'
style += 'overflow: hidden;'
%>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<%= content_tag(:div, :class => "gantt_subjects") do %>
<%= @gantt.subjects.html_safe %>
<% end %>
<% end %>
</td>
<td>
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area">
<%
style = ""
style += "width: #{g_width - 1}px;"
style += "height: #{headers_height}px;"
style += 'background: #eee;'
%>
<%= content_tag(:div, '&nbsp;'.html_safe, :style => style, :class => "gantt_hdr") %>
<% ###### Months headers ###### %>
<%
month_f = @gantt.date_from
left = 0
height = (show_weeks ? header_height : header_height + g_height)
%>
<% @gantt.months.times do %>
<%
width = (((month_f >> 1) - month_f) * zoom - 1).to_i
style = ""
style += "left: #{left}px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
<%= link_to h("#{month_f.year}-#{month_f.month}"),
@gantt.params.merge(:year => month_f.year, :month => month_f.month),
:title => "#{month_name(month_f.month)} #{month_f.year}" %>
<% end %>
<%
left = left + width + 1
month_f = month_f >> 1
%>
<% end %>
<% ###### Weeks headers ###### %>
<% if show_weeks %>
<%
left = 0
height = (show_days ? header_height - 1 : header_height - 1 + g_height)
%>
<% if @gantt.date_from.cwday == 1 %>
<%
# @date_from is monday
week_f = @gantt.date_from
%>
<% else %>
<%
# find next monday after @date_from
week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
style = ""
style += "left: #{left}px;"
style += "top: 19px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, '&nbsp;'.html_safe,
:style => style, :class => "gantt_hdr") %>
<% left = left + width + 1 %>
<% end %>
<% while week_f <= @gantt.date_to %>
<%
width = ((week_f + 6 <= @gantt.date_to) ?
7 * zoom - 1 :
(@gantt.date_to - week_f + 1) * zoom - 1).to_i
style = ""
style += "left: #{left}px;"
style += "top: 19px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
<%= content_tag(:small) do %>
<%= week_f.cweek if width >= 16 %>
<% end %>
<% end %>
<%
left = left + width + 1
week_f = week_f + 7
%>
<% end %>
<% end %>
<% ###### Days headers ####### %>
<% if show_days %>
<%
left = 0
height = g_height + header_height - 1
wday = @gantt.date_from.cwday
%>
<% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>
<%
width = zoom - 1
style = ""
style += "left: #{left}px;"
style += "top:37px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
style += "font-size:0.7em;"
clss = "gantt_hdr"
clss << " nwday" if @gantt.non_working_week_days.include?(wday)
%>
<%= content_tag(:div, :style => style, :class => clss) do %>
<%= day_letter(wday) %>
<% end %>
<%
left = left + width + 1
wday = wday + 1
wday = 1 if wday > 7
%>
<% end %>
<% end %>
<%= @gantt.lines.html_safe %>
<% ###### Today red line (excluded from cache) ###### %>
<% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
<%
today_left = (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i
style = ""
style += "position: absolute;"
style += "height: #{g_height}px;"
style += "top: #{headers_height + 1}px;"
style += "left: #{today_left}px;"
style += "width:10px;"
style += "border-left: 1px dashed red;"
%>
<%= content_tag(:div, '&nbsp;'.html_safe, :style => style, :id => 'today_line') %>
<% end %>
<%
style = ""
style += "position: absolute;"
style += "height: #{g_height}px;"
style += "top: #{headers_height + 1}px;"
style += "left: 0px;"
style += "width: #{g_width - 1}px;"
%>
<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %>
</div>
</td>
</tr>
</table>
<table style="width:100%">
<tr>
<td align="left">
<%= link_to_content_update("\xc2\xab " + l(:label_previous),
params.merge(@gantt.params_previous)) %>
</td>
<td align="right">
<%= link_to_content_update(l(:label_next) + " \xc2\xbb",
params.merge(@gantt.params_next)) %>
</td>
</tr>
</table>
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => params.merge(@gantt.params) %>
<%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %>
<% end %>
<% end # query.valid? %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>
<% end %>
<% html_title(l(:label_gantt)) -%>
<% content_for :header_tags do %>
<%= javascript_include_tag 'raphael' %>
<%= javascript_include_tag 'gantt' %>
<% end %>
<%= javascript_tag do %>
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
$(document).ready(drawGanttHandler);
$(window).resize(drawGanttHandler);
$(function() {
$("#draw_rels").change(drawGanttHandler);
$("#draw_progress_line").change(drawGanttHandler);
});
<% end %>
<div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><% @gantt.view = self %>
<%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
</div>
<%= form_tag({:controller => 'gantts', :action => 'show',
:project_id => @project, :month => params[:month],
:year => params[:year], :months => params[:months]},
:method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<!--<fieldset id="filters" class="collapsible <%#= @query.new_record? ? "" : "collapsed" %>">-->
<!--<legend onclick="toggleFieldset(this);"><%#= l(:label_filter_plural) %></legend>-->
<!--<div style="<%#= @query.new_record? ? "" : "display: none;" %>">-->
<!--<%#= render :partial => 'queries/filters', :locals => {:query => @query} %>-->
<!--</div>-->
<!--</fieldset>-->
<fieldset class="collapsible collapsed">
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
<div style="display: none;">
<table>
<tr>
<td>
<fieldset>
<legend><%= l(:label_related_issues) %></legend>
<label style="padding:10px;">
<%= check_box_tag "draw_rels", params["draw_rels"], params[:set_filter].blank? || params[:draw_rels] %>
<% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %>
<% rels.each do |rel| %>
<% color = Redmine::Helpers::Gantt::DRAW_TYPES[rel][:color] %>
<%= content_tag(:span, '&nbsp;&nbsp;&nbsp;'.html_safe,
:style => "background-color: #{color}") %>
<%= l(IssueRelation::TYPES[rel][:name]) %>
<% end %>
</label>
</fieldset>
</td>
<td>
<fieldset>
<legend><%= l(:label_gantt_progress_line) %></legend>
<label style="padding:10px;">
<%= check_box_tag "draw_progress_line", params[:draw_progress_line], params[:draw_progress_line] %>
<%= l(:label_display) %>
</label>
</fieldset>
</td>
</tr>
</table>
</div>
</fieldset>
<!--<p class="contextual">-->
<!--<%#= gantt_zoom_link(@gantt, :in) %>-->
<!--<%#= gantt_zoom_link(@gantt, :out) %>-->
<!--</p>-->
<p class="buttons">
<%= text_field_tag 'months', @gantt.months, :size => 2 %>
<%= l(:label_months_from) %>
<%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
<%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
<%= hidden_field_tag 'zoom', @gantt.zoom %>
<%= link_to_function l(:button_apply), '$("#query_form").submit()',
:class => 'icon icon-checked' %>
<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 },
:class => 'icon icon-reload' %>
</p>
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<%
zoom = 1
@gantt.zoom.times { zoom = zoom * 2 }
subject_width = 330
header_height = 18
headers_height = header_height
show_weeks = false
show_days = false
if @gantt.zoom > 1
show_weeks = true
headers_height = 2 * header_height
if @gantt.zoom > 2
show_days = true
headers_height = 3 * header_height
end
end
# Width of the entire chart
g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
@gantt.render(:top => headers_height + 8,
:zoom => zoom,
:g_width => g_width,
:subject_width => subject_width)
g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max
t_height = g_height + headers_height
%>
<%# if @gantt.truncated %>
<!--<p class="warning"><%#= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>-->
<%# end %>
<table style="width:100%; border:0; border-collapse: collapse;">
<tr>
<td style="width:<%= subject_width %>px; padding:0px;">
<%
style = ""
style += "position:relative;"
style += "height: #{t_height + 24}px;"
style += "width: #{subject_width + 1}px;"
%>
<%= content_tag(:div, :style => style) do %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{headers_height}px;"
style += 'background: #eee;'
style += 'z-index: 1;'
%>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<%
style = ""
style += "right:-2px;"
style += "width: #{subject_width}px;"
style += "height: #{t_height}px;"
style += 'border-left: 1px solid #c0c0c0;'
style += 'overflow: hidden;'
%>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<%= content_tag(:div, :class => "gantt_subjects") do %>
<%= @gantt.subjects.html_safe %>
<% end %>
<% end %>
</td>
<td>
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area">
<%
style = ""
style += "width: #{g_width - 1}px;"
style += "height: #{headers_height}px;"
style += 'background: #eee;'
%>
<%= content_tag(:div, '&nbsp;'.html_safe, :style => style, :class => "gantt_hdr") %>
<% ###### Months headers ###### %>
<%
month_f = @gantt.date_from
left = 0
height = (show_weeks ? header_height : header_height + g_height)
%>
<% @gantt.months.times do %>
<%
width = (((month_f >> 1) - month_f) * zoom - 1).to_i
style = ""
style += "left: #{left}px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
<%= link_to h("#{month_f.year}-#{month_f.month}"),
@gantt.params.merge(:year => month_f.year, :month => month_f.month),
:title => "#{month_name(month_f.month)} #{month_f.year}" %>
<% end %>
<%
left = left + width + 1
month_f = month_f >> 1
%>
<% end %>
<% ###### Weeks headers ###### %>
<% if show_weeks %>
<%
left = 0
height = (show_days ? header_height - 1 : header_height - 1 + g_height)
%>
<% if @gantt.date_from.cwday == 1 %>
<%
# @date_from is monday
week_f = @gantt.date_from
%>
<% else %>
<%
# find next monday after @date_from
week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
style = ""
style += "left: #{left}px;"
style += "top: 19px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, '&nbsp;'.html_safe,
:style => style, :class => "gantt_hdr") %>
<% left = left + width + 1 %>
<% end %>
<% while week_f <= @gantt.date_to %>
<%
width = ((week_f + 6 <= @gantt.date_to) ?
7 * zoom - 1 :
(@gantt.date_to - week_f + 1) * zoom - 1).to_i
style = ""
style += "left: #{left}px;"
style += "top: 19px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
%>
<%= content_tag(:div, :style => style, :class => "gantt_hdr") do %>
<%= content_tag(:small) do %>
<%= week_f.cweek if width >= 16 %>
<% end %>
<% end %>
<%
left = left + width + 1
week_f = week_f + 7
%>
<% end %>
<% end %>
<% ###### Days headers ####### %>
<% if show_days %>
<%
left = 0
height = g_height + header_height - 1
wday = @gantt.date_from.cwday
%>
<% (@gantt.date_to - @gantt.date_from + 1).to_i.times do %>
<%
width = zoom - 1
style = ""
style += "left: #{left}px;"
style += "top:37px;"
style += "width: #{width}px;"
style += "height: #{height}px;"
style += "font-size:0.7em;"
clss = "gantt_hdr"
clss << " nwday" if @gantt.non_working_week_days.include?(wday)
%>
<%= content_tag(:div, :style => style, :class => clss) do %>
<%= day_letter(wday) %>
<% end %>
<%
left = left + width + 1
wday = wday + 1
wday = 1 if wday > 7
%>
<% end %>
<% end %>
<%= @gantt.lines.html_safe %>
<% ###### Today red line (excluded from cache) ###### %>
<% if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
<%
today_left = (((Date.today - @gantt.date_from + 1) * zoom).floor() - 1).to_i
style = ""
style += "position: absolute;"
style += "height: #{g_height}px;"
style += "top: #{headers_height + 1}px;"
style += "left: #{today_left}px;"
style += "width:10px;"
style += "border-left: 1px dashed red;"
%>
<%= content_tag(:div, '&nbsp;'.html_safe, :style => style, :id => 'today_line') %>
<% end %>
<%
style = ""
style += "position: absolute;"
style += "height: #{g_height}px;"
style += "top: #{headers_height + 1}px;"
style += "left: 0px;"
style += "width: #{g_width - 1}px;"
%>
<%= content_tag(:div, '', :style => style, :id => "gantt_draw_area") %>
</div>
</td>
</tr>
</table>
<table style="width:100%">
<tr>
<td align="left">
<%= link_to_content_update("\xc2\xab " + l(:label_previous),
params.merge(@gantt.params_previous)) %>
</td>
<td align="right">
<%= link_to_content_update(l(:label_next) + " \xc2\xbb",
params.merge(@gantt.params_next)) %>
</td>
</tr>
</table>
<% end # query.valid? %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>
<% end %>
<% html_title(l(:label_gantt)) -%>
<% content_for :header_tags do %>
<%= javascript_include_tag 'raphael' %>
<%= javascript_include_tag 'gantt' %>
<% end %>
<%= javascript_tag do %>
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
$(document).ready(drawGanttHandler);
$(window).resize(drawGanttHandler);
$(function() {
$("#draw_rels").change(drawGanttHandler);
$("#draw_progress_line").change(drawGanttHandler);
});
<% end %>
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script>

View File

@ -1,6 +1,6 @@
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %>
<div style="width:210px; text-align:center; margin:0 auto;">
<div style=" text-align:center;">
<ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>

View File

@ -47,7 +47,7 @@
<% elsif @homework.homework_type == 2 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。</p>
<% elsif @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。</p>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置(可扩大分组范围)。</p>
<% end %>
<% elsif stu_pro_count != 0 && @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。</p>

View File

@ -0,0 +1,16 @@
<% issue_list(issues) do |issue, level| -%>
<script>
$(function () {
sd_create_editor_from_data(<%= issue.id%>, null, "100%", "<%= issue.class.name %>");
});
</script>
<%= render :partial => 'issues/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="issue_list_pagination">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -25,6 +25,14 @@
</li>
<div class="cl"></div>
<li>
<label class="label">来源:</label>
<select class="w150">
<option>客户</option>
<option>用户</option>
<option>其他</option>
</select>
</li>
<div class="cl"></div>
<li>
<label class="label"><%= l(:field_assigned_to) %></label>
<% if @issue.safe_attribute? 'assigned_to_id' %>
@ -36,7 +44,7 @@
<div class="cl"></div>
<li>
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
<label class="label"><%= l(:field_fixed_version) %></label>
<label class="label"><%= l(:milestone) %></label>
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
:class => "w150" %>
@ -74,7 +82,13 @@
<label class="label02"><%= l(:field_estimated_hours) %></label>
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %>
<span class="mt3 ml5"><%= l(:field_hours) %></span>
<% end %>
</li>
<div class="cl"></div>
<li>
<label class="label02">实际工时 (H)</label>
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true %>
<% end %>
</li>
<div class="cl"></div>

View File

@ -40,7 +40,7 @@
<% end %>
<div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label03" >&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
<li><p class="label03" >&nbsp;<%=l(:milestone)%>&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
</li>
<% end %>
<div class="cl"></div>

View File

@ -18,6 +18,10 @@
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_is_private_tips)%></label>
<% end %>
</li>
<!--<li>-->
<!--<input type="checkbox" class="ml30">-->
<!--<label class="fl ml5 mt3">不需要评审</label>-->
<!--</li>-->
<div class="cl"></div>
<!--<li>-->
<!--<%# if @issue.safe_attribute? 'project_id' %>-->

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5" ><%= @issues_filter_assign_count %></span>

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5" ><%= @issue_count %></span>

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5"><%= @issues_filter_author_count %><%#= @project.issues.where(:author_id => User.current.id ).visible.all.count %></span>

View File

@ -6,6 +6,11 @@
</script>
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<% if issues.count == 10%>
<%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="issue_list_pagination">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,93 @@
<div class="issues_con fl">
<div class="clear mb5">
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fl mr10">新 增</a>
<div class="issues_statistics fl">
<ul>
<li>所有<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.project_score.issue_num %></a></li>
<li>开启<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.issues.where('status_id in (1,2,3,4,6)').visible.all.count %></a></li>
<li>关闭<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.issues.where(:status_id => 5 ).visible.all.count %></a></li>
</ul>
</div><!--issues_statistics end-->
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue fr" alt="导出EXCEL">导出EXCEL</a>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div class="clear mb10">
<div class="hw_search_box fl ">
<input class="hw_search-input" placeholder="请输入问题名称" type="text" id="v_subject" name="subject" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0);" class="hw_btn_search" onclick="remote_function();" ></a>
</div>
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="nh_reset_form();">清除</a>
<div class="calendar_div fr">
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_end_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="结束日期">
<%= calendar_for('issue_create_date_end_show')%>
</div>
<div class="calendar_div fr">
<input name="issue_create_date_start_show" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_start_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="开始日期">
<%= calendar_for('issue_create_date_start_show')%>
</div>
<!--<input type="text" placeholder="开始日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl" style="border-right:none;"></a>-->
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl"></a>-->
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);">
<a href="javascript:void(0);" onclick="all_reset_form();" id="issues_type_1" >所有<span class="issues_nav_tag ml5"><%= @project.project_score.issue_num %></span></a>
</li>
<li id="issues_list_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" onclick="switch_assign_to(<%= User.current.id %>)" id="issues_type_2" >指派给我<span class="issues_nav_tag ml5"><%= @project.issues.where(:assigned_to_id => User.current.id ).visible.all.count %></span></a>
</li>
<li id="issues_list_nav_3" onclick="HoverLi(3);">
<a href="javascript:void(0);" onclick="createByMe(<%= User.current.id %>)" id="issues_type_3" >我的发布<span class="issues_nav_tag ml5"><%= @project.issues.where(:author_id => User.current.id ).visible.all.count %></span></a>
</li>
<div class="cl"></div>
</ul>
<div class="issues_filter ">
<div class="issues_form_filter mt5 mr5">
<%= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"})
%>
<%= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
) %>
<%= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
{:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<%= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]),
{:include_blank => false, :selected => @order ? @order : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
</div>
<div class="cl"></div>
</div><!--issues_filter end-->
<% if @issues.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div>
<% end %>
<%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div><!--issues_con_list end-->
<% end %>
<% end %>
</div>

View File

@ -0,0 +1,99 @@
<% unless activity.author.nil? %>
<div class="issues_list_box clear" id="user_activity_<%= user_activity_id%>">
<div class="issues_ciricons fl ">
<% if activity.status_id.to_i == 5 %>
<span class="issues_ciricons_02"></span>
<% else %>
<span class="issues_ciricons_01"></span>
<% end %>
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% end %>
<p class="fl ml10"> <span class="mr5"><%=format_time(activity.created_on) %></span>发布</p>
</div>
</div>
<ul class="issues_list_txt fr">
<li class="issues_list_min c_grey">
<% case activity.tracker_id %>
<% when 1%>
缺陷
<% when 2%>
功能
<% when 3%>
支持
<% when 4%>
任务
<% when 5%>
周报
<% end %>
</li>
<!--li class="c_grey">
<#% if activity.try(:author).try(:realname) == ' ' %>
<%#= link_to activity.try(:author), user_path(activity.author_id), :class => "c_grey" %>
<#% else %>
<%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "c_grey" %>
<%# end %>
</li-->
<li class="c_grey">
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname).empty? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id), :class => "c_grey" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "c_grey" %>
<% end %>
<% end %></li>
<li class="c_grey" style="width: 60px; padding-right: 10px" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
<li class="issues_list_min c_grey" ><%= activity.status.name%></li>
<li class="<%=(activity.done_ratio == 100 ? 'c_red' : 'c_green') %>"><%= activity.done_ratio %>%</li>
<li class="issues_list_min pr">
<% if activity.journals.count > 0%>
<span class="issues_icons_mes fl mr5" style="margin-top:-3px;"></span>
<span class="fl mr5"><%= activity.journals.count %></span>
<% end %>
<div class="undis" style="position: absolute; <%= activity.journals.count >0 ? 'top:15px;' : 'top:-15px;' %>">
<%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to "", issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</div>
</li>
</ul>
</div>
<% end %>
<script>
$(".issues_list_box").mouseover(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(5).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(5).children().eq(iconOrder).show();
});
$(".issues_list_box").mouseout(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(5).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(5).children().eq(iconOrder).hide();
});
</script>

View File

@ -2,7 +2,20 @@
<%= import_ke(enable_at: true,init_activity: true) %>
<% end %>
<script>
<script xmlns="http://www.w3.org/1999/html">
//issues列表
/*function g(o){
return document.getElementById(o);
}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=3;i++){
g('issues_list_nav_'+i).className='issues_nav_nomal';
}
g('issues_list_nav_'+n).className='issues_nav_hover';
}*/
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
@ -14,7 +27,10 @@
});
function remote_function() {
$("#issue_query_form").submit();
if($.trim($("#issue_create_date_end_show").val()) !="" && Date.parse($.trim($("#issue_create_date_end_show").val())) < Date.parse($.trim($("#issue_create_date_start_show").val()))){
alert("开始日期不能大于结束日期!");
}
$("#issue_query_form").submit();
// $.ajax({
// url:'<%#= project_issues_path(@project)%>',
// data:{
@ -30,12 +46,39 @@
// }
// });
}
function nh_reset_form() {
$("#issue_query_form")[0].reset();
$("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦
remote_function();
function remote_function_export(project_id) {
// $("#export_issue_hidden").attr("value","1");
// $("#issue_query_form").attr("set_filter","1");
// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues.xls");
// $("#issue_query_form").submit();
// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues");
// $("#issue_query_form").removeAttr("format");
// $("#issue_query_form").attr("set_filter","0");
// $("#export_issue_hidden").attr("value","0");
var tracker_id = $("#tracker_id").attr("value");
var subject = $("#v_subject").attr("value");
var assigned_to_id = $("#assigned_to_id").attr("value");
var fixed_version_id = $("#fixed_version_id").attr("value");
var status_id = $("#status_id").attr("value");
var done_ratio = $("#done_ratio").attr("value");
var test = $("#test").attr("value");
var author_id = $("#author_id").attr("value");
var issue_create_date_start = $("#issue_date_start_issue_export").attr("value");
var issue_create_date_end = $("#issue_date_end_issue_export").attr("value");
$("#sendexcel").attr("href","/projects/"+project_id+"/issues.xls?export=true&set_filter=1&tracker_id="+tracker_id+"&assigned_to_id="+assigned_to_id+"&fixed_version_id="+fixed_version_id+"&status_id="+status_id+"&done_ratio="+done_ratio+"&test="+test+"&author_id="+author_id+"&subject="+subject+"&issue_create_date_start="+issue_create_date_start+"&issue_create_date_end="+issue_create_date_end);
///projects/1811/issues.xls?export=true&set_filter=1
}
// function nh_reset_form() {
// $("#issue_query_form")[0].reset();
// $("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦
// remote_function();
// }
function EnterPress(e){
var e = e || window.event;
if(e.keyCode == 13){
@ -43,150 +86,204 @@
}
}
// 点击的时候让过滤条件选中assign_to
function switch_assign_to(assign) {
var assign = "option[value =" + assign + "]";
$("#issues_type_2").click(function(){
});
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
$("select[id='author_id']").val('');
remote_function();
}
// 点击的时候让过滤条件选中user_id
function createByMe(user_id) {
var user = "option[value =" + user_id + "]";
$("#createByMe").click(function(){
});
$("select[id='author_id']").find(user).attr("selected", "selected");
remote_function();
}
// 清楚表单所有选项
function all_reset_form() {
$("#issue_query_form")[0].reset();
$("select[id='author_id']").val('');
$("select[id='assigned_to_id']").val('');
$("input[nhname='date_val']").val('');
remote_function();
}
</script>
<div class="homepageRight mt0 ml10" >
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= l(:label_issue_tracking) %></div>
</div>
<div class="resources mt10" >
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div class="problem_search fr" >
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" placeholder="请输入问题名称" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
<a href="javascript:void(0)" class="grey_btn fl ml10 f14" onclick="nh_reset_form();" >清空</a>
</div><!--problem_search end-->
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.project_score.issue_num %></a>
<%= l(:lable_issues_undo) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
</p>
<div class="cl"></div>
<div id="filter_form" class="fl">
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"}
)
%>
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{ :include_blank => false,:selected=>@priority_id ? @priority_id : 0
},
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"}
)
%>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"}
)
%>
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0
},
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"}
)
%>
</div><!--filter_form end-->
<div>
<div class="fl">&nbsp;</div>
<div>
<input name="issue_create_date_start" nhname="date_val" type="hidden"/>
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
<%= calendar_for('issue_create_date_start_show') %>
</div>
<div style="float:left;">&nbsp;-&nbsp;</div>
<div>
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%>
<%= calendar_for('issue_create_date_end_show') %>
</div>
<div class="homepageRight mt0 ml10" >
<div class="issues_con fl">
<div class="clear mb5">
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fl mr10">新 增</a>
<div class="issues_statistics fl">
<ul>
<li>所有<a class="issues_greycirbg_btn "><%= @issues_filter.count %></a></li>
<li>开启<a class="issues_greycirbg_btn "><%#= @issues_filter_assign_count %><%= @issue_open_count %></a></li>
<li>关闭<a class="issues_greycirbg_btn "><%#= @issues_filter_author_count %><%= @issue_close_count %></a></li>
</ul>
</div><!--issues_statistics end-->
<!--<input type="button" class="hw_btn_blue fr" value="导出EXCEL" onclick="remote_function_export('<%= @project.id %>')">-->
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls', :export => true, :set_filter => "1")%>" id="sendexcel" class="hw_btn_blue fr" alt="导出EXCEL" onclick="remote_function_export('<%= @project.id %>')">导出EXCEL</a>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'xls', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<%= hidden_field_tag 'export_issue_hidden', '0' %>
<!--<input id="exprot_issues_hidden" value="0" type="hidden">-->
<div class="clear mb10">
<div class="hw_search_box fl ">
<input class="hw_search-input" placeholder="请输入问题名称" type="text" id="v_subject" name="subject" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0);" class="hw_btn_search" onclick="remote_function();" ></a>
</div>
<div class="cl"></div>
<% end %>
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="all_reset_form();">清除</a>
<div class="cl"></div>
<% end %>
</div>
<div class="contextual">
<% if !@query.new_record? && @query.editable_by?(User.current) %>
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
<%= delete_link query_path(@query) %>
<% end %>
</div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<div style="clear:right; ">
</div>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<% if @issues.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<div id="issue_list">
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
<div class="calendar_div fr">
<input id="issue_date_end_issue_export" name="issue_create_date_end" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_end_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="结束日期">
<%= calendar_for('issue_create_date_end_show')%>
</div>
<div class="calendar_div fr">
<input id="issue_date_start_issue_export" name="issue_create_date_start" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_start_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="开始日期">
<%= calendar_for('issue_create_date_start_show')%>
</div>
<!--<input type="text" placeholder="开始日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl" style="border-right:none;"></a>-->
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl"></a>-->
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" onclick="HoverLi(1);all_reset_form();">
<a href="javascript:void(0);" onclick="all_reset_form();" id="issues_type_1" >所有</a>
<span id="issue_filter_all"><%= render :partial => "issues/issue_filter_all" %></span>
</li>
<!--li id="issues_list_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" onclick="switch_assign_to(<%#= User.current.id %>)" id="issues_type_2" >指派给我
<span id="issue_assigned_count"><%#= render :partial => "issues/issue_filter" %></span>
</a>
</li>
<li id="issues_list_nav_3" onclick="HoverLi(3);">
<a href="javascript:void(0);" onclick="createByMe(<%#= User.current.id %>)" id="issues_type_3" >我的发布
<span id="issue_author_count"><%#= render :partial => "issues/issue_filter_author" %></span>
</a>
</li-->
<div class="cl"></div>
</ul>
<div class="issues_filter ">
<div class="issues_form_filter mt5 mr5">
<%= select(:issue, :tracker, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%#= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0},
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"fl "}
)
%>
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"}
)
%>
<%= select(:issue, :fixed_version, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "fl"}) %>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
)
%>
<%#= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{ :include_blank => false,:selected=>@priority_id ? @priority_id : 0
},
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"fl"}
)
%>
<%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["100%",10]].unshift(["完成度",0]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
{:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }).unshift(["完成度",-1]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : -1},
{:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %>
<%#= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]),
{:include_blank => false, :selected => @order ? @order : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
<%= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]),
{:include_blank => false, :selected => @test ? @test : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0},
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:style=>"display:none;"}
)
%>
<%#= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%#= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"})
%>
<%#= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %>
<%#= select( :issue, :status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
) %>
<%#= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
{:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %>
<%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
{:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<%#= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]),
{:include_blank => false, :selected => @order ? @order : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
</div>
<div class="cl"></div>
</div><!--issues_filter end-->
<% end %>
<!--<div style="float: left; padding-top: 30px">-->
<!--<%# other_formats_links do |f| %>-->
<!--<%#= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>-->
<!--<%#= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>-->
<!--<%#= f.link_to 'PDF', :url => params %>-->
<!--<%# end %>-->
<!--</div>-->
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
<p>
<label>
<%= radio_button_tag 'columns', 'all' %>
<%= l(:description_all_columns) %>
</label>
</p>
<p>
<label>
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
<%= l(:field_description) %>
</label>
</p>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>
<% end %>
<% if @issues.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div>
<% end %>
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>
<% end %>
<%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div><!--issues_con_list end-->
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom,
{:query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key},
:title => l(:label_issue_plural)) %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'journals', :action => 'index',
:query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key},
:title => l(:label_changes_details)) %>
<% end %>
<%= context_menu issues_context_menu_path %>
</div>
</div>
</div>

View File

@ -1,6 +1,7 @@
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list其余的都是替换show_more_issues
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>");
<%else%>
$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
<%end%>
//$("#issue_assigned_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter') %>");
$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'issues/issue_filter_all') %>");
//$("#issue_author_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter_author') %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/all_list',:locals => {:issues => @issues, :query => @query, :issue_pages=> @issue_pages, :issue_count => @issue_count, :project=> @project})%>");
$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');

View File

@ -158,6 +158,8 @@ function cookieget(n)
})
</script>
<% forum = Forum.where(:id => 1).first %>
<% unless forum.nil? %>
<div class="scrollsidebar" id="scrollsidebar" style="float: right">
<div class="side_content">
<div class="side_list">
@ -189,4 +191,5 @@ function cookieget(n)
<a href="#" class="closeSidebar"></a>
</div>
</div>
<% end %>
</body>

View File

@ -4,7 +4,10 @@
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="https://forge.trustie.net/projects/2/feedback" class="f_grey mw20" target="_blank"><%= l(:label_contact_us)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_recruitment_information)%></a>|</li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey ml20" target="_blank"><%= l(:label_language)%></a>
<select class="languageBox">

View File

@ -0,0 +1,46 @@
<div class="sy_class_infobox mb10 clear">
<div class="sy_class_logo fl">
<div class="pr" style="width: 110px; height:110px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?) %>
<%=link_to image_tag(url_to_avatar(@project), width:"110", height: "110", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "110", :height => "110", :alt => "项目logo") %>
<% end %>
</div>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<div class="sy_class_id fl"><p><%= l(:label_project_ivite_code)%><br /><span class="sy_corange"><%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %></span></p></div>
<div class="sy_class_info fl ml15">
<div class="sy_class_titbox clear">
<h3 class="fl sy_class_title">
<a href="javascript:void(0);"class="mr5 c_dark"><%= @project.creater %></a>/
<a href="javascript:void(0);"class=" ml5 c_dark"><%= @project.name %></a>
</h3>
<span class="sy_new_orange fl ml10 mt5"><%= @project.is_public? ? l(:label_public) : l(:label_private) %></span>
</div>
<p class="sy_cgrey">
<span class=" mr15">项目评分:
<% if @project.project_type == 0 %>
<%# unless static_project_score(@project.project_score) == 0 %>
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "sy_cblue" ) %>
<%# end %>
<% end %>
</span>
<span class=" mr15">浏览:<a class="sy_corange"><%= @project.visits.to_i %></a></span>
<span class=" mr15">关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
<span class=" mr15">成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
</p>
<div class="mt15 clear" id="join_exit_project_div">
<%= render 'layouts/join_exit_project' %>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -4,7 +4,8 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<% if hidden_unproject_infos %>
<% memo = Memo.where(:id => 1168).first %>
<% if hidden_unproject_infos && !memo.nil? %>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<% end %>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>

View File

@ -1,5 +1,7 @@
<%= javascript_include_tag "feedback" %>
<% forum = Forum.where(:id => 1).first %>
<% unless forum.nil? %>
<div class="scrollsidebar" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
@ -49,3 +51,4 @@
</div>
</div>
</div>
<% end %>

View File

@ -1,19 +1,18 @@
<div class="pr_info_join fl">
<!--关注:非项目成员-->
<div id="join_in_project_applied">
<%= render :partial => "projects/applied_status" %>
</div>
<%= render :partial => "projects/applied_status" %>
<!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "sy_btn_blue mr5" %>
<% end %>
<!--项目类型-->
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %>
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
<!--<%# if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %>-->
<!--<%#= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>-->
<!--<%# end %>-->
<!--退出项目-->
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
<%= exit_project_link(@project) %>
<% end %>
</div>

View File

@ -14,11 +14,15 @@
<li class="navHomepageMenu fl">
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
</li>
<!--<li class="navHomepageMenu fl mr30">-->
<!--<%#= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>-->
<!--</li>-->
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="navHomepageMenu fl mr30">
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
</li>
<% end %>
<% else %>
<li class="navHomepageMenu fl mr40">
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" > 贴吧交流</a>
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" >公共贴吧</a>
</li>
<% end %>
</ul>
@ -62,6 +66,9 @@
<li>
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
</li>
<li>
<%= link_to '我的课程',{:controller => "users", :action => "user_courselist", :id => User.current.id}, :class => "menuGrey" %>
</li>
<li>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
</li>

View File

@ -14,9 +14,12 @@
<li class="navHomepageMenu fl">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a>
</li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="navHomepageMenu fl mr30">
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a>
</li>
<% end %>
<% end %>
</ul>
</div>

View File

@ -1,5 +1,6 @@
<%= javascript_include_tag "feedback" %>
<% forum = Forum.where(:id => 1).first %>
<% unless forum.nil? %>
<div class="scrollsidebar pr" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
@ -49,3 +50,4 @@
</div>
</div>
</div>
<% end %>

View File

@ -2,7 +2,10 @@
<ul>
<li ><a href="<%= about_us_path %>" target="_blank" class="" >关于我们<span>|</span></a></li>
<li ><a href="<%= agreement_path %>" target="_blank" class="" >服务协议<span>|</span></a></li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li ><a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="" >帮助中心<span>|</span></a></li>
<% end %>
<li ><a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="" > 贴吧交流</a></li>
<div class="cl"></div>
</ul>

View File

@ -3,7 +3,10 @@
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<% end %>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>

View File

@ -7,9 +7,12 @@
<!--<li class="navHomepageMenu fl mr40">-->
<!--<%#= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>-->
<!--</li>-->
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="navHomepageMenu fl mr40">
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" > 贴吧交流</a>
<a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="c_white f16 db p10" >帮助中心</a>
</li>
<% end %>
</ul>
</div>
<script>

View File

@ -110,9 +110,16 @@
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
</li>
<% end %>
<% group_count = @course.course_groups.count %>
<% if !show_nav?(group_count) && ((User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?) %>
<li id="sy_09" class="sy_icons_group">
<a href="<%=course_member_path(@course, :role => 2) %>">分班<span><%=group_count %></span></a>
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<% end %>
<% statistics_count = 0 %>
<% unless show_nav?(statistics_count) %>
<li id="sy_09" class="sy_icons_st">
<li id="sy_10" class="sy_icons_st">
<a href="<%=statistics_course_course_path(@course) %>">统计<span></span></a>
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>

View File

@ -152,7 +152,10 @@
<ul class="footerAbout">
<li class="fl"><a href="<%= about_us_path %>" class=" f_grey mw20" target="_blank">关于我们</a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class=" f_grey mw20" target="_blank">服务协议</a>|</li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="fl"><a href="http://forge.trustie.net/forums/1/memos/1168" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
<% end %>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank">贴吧交流</a></li>
</ul>
</div>

View File

@ -172,8 +172,10 @@
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<% end %>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>
<div class="sn-address">地 址湖南省长沙市开福区东风路89号观园大厦23层<br />

View File

@ -406,7 +406,10 @@
<ul>
<li><a href="<%= about_us_path %>" target="_blank" class="fl">关于我们</a></li>
<li><a href="<%= agreement_path %>" target="_blank" class="fl"> 服务协议 </a></li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li><a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="fl">帮助中心</a></li>
<% end %>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="fl"> 贴吧交流</a></li>
</ul>
<div class="cl"></div>

View File

@ -106,7 +106,10 @@
<ul class="footerAbout">
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">关于我们</a>|</li>
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">服务协议</a>|</li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="fl"><a href="javascript:void(0);" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
<% end %>
<li class="fl"><a href="javascript:void(0);" class=" f_grey mw20" target="_blank">贴吧交流</a></li>
</ul>
</div>

View File

@ -12,7 +12,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository','css/gantt', 'css/calendar' %>
<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %>
@ -47,88 +47,17 @@
<div class="cl"></div>
<div id="content">
<%= render :partial => 'layouts/base_project_top' %>
<div id="LSide" class="fl">
<div class="project_info">
<div class="pr_info_logo fl mr10 mb5">
<div class="pr" style="width: 64px; height:64px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?)%>
<%=link_to image_tag(url_to_avatar(@project),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:project => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60", :alt => "项目logo") %>
<% end %>
</div>
</div>
<div class="pr_info_id fl mb5 f14">
<%= l(:label_project_ivite_code)%>
<%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">
<% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
<% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%>
<%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %>
</div>
<!-- 项目得分 -->
<div class="cl"></div>
<div>
<%= link_to "#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @project.is_public? %>
<span class="img_private"><%= l(:label_public)%></span>
<% else %>
<span class="img_private"><%= l(:label_private)%></span>
<% end %>
</div>
<div class="cl"></div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<%# over %>
<div>
<% if @project.project_type == 0 %>
<% unless static_project_score(@project.project_score) == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
<% end %>
</div>
<!--参数-->
<div class="pr_info_foot">
<%= l(:label_member) %><%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue', :id => 'project_members_number' %>
<span>|&nbsp;</span>
<%= l(:label_user_watcher) %><%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments) %>
<% @project.project_score.attach_num %>
<%= link_to "#{@project.project_score.attach_num }", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %></span>
<% end %>
</div>
<div class="cl"></div>
</div><!--参数 end-->
<!--邀请加入-->
<div class="subNavBox">
<div class="subNavBoxProject">
<div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'projects/research_team', :locals => {:project => @project} %>
<% else %>
<%= render :partial => 'projects/friend_group', :locals => {:project => @project} %>
<% end %>
<%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
</div>
<!-- end -->
</div><!--项目侧导航 end-->
</div>
<!--项目侧导航 end-->
<div class="cl"></div>
<!-- 项目描述 -->
<div class="project_intro">
<div id="course_description" class="course_description">
@ -155,13 +84,12 @@
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %> 自2016年5月</div>
</div>
</div>
<div id="RSide" class="fl">
<div class="fl">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>

View File

@ -146,13 +146,13 @@
</div>
<% if @center_flag %>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user.id)%>" class=" f14 c_blue02">
我的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user.id)%>" class=" f14 c_blue02">
我的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
</a>
@ -166,13 +166,13 @@
<% else%>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user.id)%>" class=" f14 c_blue02">
TA的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.visible.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user.id)%>" class=" f14 c_blue02">
TA的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.visible.count%>)</span>
</a>

View File

@ -95,58 +95,8 @@
</div>
<%# all_comments = []%>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="" id="reply_div_<%= @topic.id %>">
<%= render :partial => "messages/course_show_replies" %>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,60 @@
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,59 @@
<% @replies.each_with_index do |reply, i| %>
<script type="text/javascript">
$(function () {
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:class => 'fr mr20',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id %>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -130,56 +130,7 @@
<%# all_comments = [] %>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each_with_index do |reply, i| %>
<script type="text/javascript">
$(function () {
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:class => 'fr mr20',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id %>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<%= render :partial => "messages/org_show_replies" %>
</div>
<% end %>

View File

@ -160,57 +160,7 @@
<%# all_comments = []%>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each_with_index do |reply,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<%= render :partial => "messages/project_show_replies" %>
</div>
<div class="cl"></div>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>

View File

@ -0,0 +1,60 @@
<% @replies.each_with_index do |reply,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,7 @@
<% if @project %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/project_show_replies')%>");
<% elsif @course %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/course_show_replies')%>");
<% else %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/org_show_replies')%>");
<% end %>

View File

@ -7,7 +7,7 @@ if($("#course_avatar_form").length > 0) {
window.location.href = "<%=settings_course_path(@course) %>";
}
<% elsif @project %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:110px;height:110px;overflow:hidden",:alt=>"项目logo") %>');
if($("#project_avatar_form").length > 0) {
window.location.href = "<%=settings_project_path(@project) %>";
}

View File

@ -1,6 +1,6 @@
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= @comments.count>0 ? "#{@comments.count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<sapn class="mr15"><%= @comments_count>0 ? "#{@comments_count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=@news.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
</span>
@ -8,60 +8,7 @@
</div>
<% unless @comments.empty? %>
<div class="" id="reply_div_<%=@news.id %>">
<% @comments.each_with_index do |comment,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= comment.id %>');
autoUrl('reply_message_description_<%= comment.id %>');
});
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.content_detail.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'comments',:action => 'quote', :id => comment},
:remote => true,
:method => 'get',
:title => l(:button_reply))%>
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:controller => 'comments',
:action => 'destroy', :id => @news,
:comment_id => comment},
:method => :delete,
:id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if User.current.allowed_to?(:manage_news, object) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
<%= render :partial => 'news/news_replies_detail', :locals => {:object => object} %>
</div>
<% end %>

View File

@ -0,0 +1,63 @@
<% @comments.each_with_index do |comment,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= comment.id %>');
autoUrl('reply_message_description_<%= comment.id %>');
});
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.content_detail.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'comments',:action => 'quote', :id => comment},
:remote => true,
:method => 'get',
:title => l(:button_reply))%>
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:controller => 'comments',
:action => 'destroy', :id => @news,
:comment_id => comment},
:method => :delete,
:id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if ((object.kind_of? Organization) ? User.current.allowed_to?(:manage_news, object) : (User.current.admin_of_org?(object) || User.current == comment.author)) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
<% if @comments_count > @page * @limit + 10 %>
<div id="more_news_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', news_path(@news, :page => @page), :remote=>true %>
</div>
</div>
<% end %>

View File

@ -72,7 +72,7 @@
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<%= render :partial => 'news/news_all_replies' %>
<%= render :partial => 'news/news_all_replies', :locals => {:object => @organization} %>
</div>
</div>
<script type="text/javascript">

View File

@ -0,0 +1,7 @@
<% if @project %>
$("#more_news_replies").replaceWith("<%= escape_javascript(render :partial => 'news/news_replies_detail', :locals => {:object => @project})%>");
<% elsif @course %>
$("#more_news_replies").replaceWith("<%= escape_javascript(render :partial => 'news/news_replies_detail', :locals => {:object => @course})%>");
<% elsif @organization %>
$("#more_news_replies").replaceWith("<%= escape_javascript(render :partial => 'news/news_replies_detail', :locals => {:object => @organization})%>");
<% end %>

View File

@ -75,7 +75,8 @@
</div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, @document).count %>
<% all_replies = get_all_children(all_comments, @document) %>
<% count = all_replies.count %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
<%# if count > 0 %>
@ -88,8 +89,7 @@
</div>
</div>
<% all_comments = []%>
<% comments = get_all_children(all_comments, @document) %>
<% comments = all_replies %>
<div class="" id="reply_div_<%= @document.id %>">
<% comments.each do |comment| %>
<script type="text/javascript">

View File

@ -3,7 +3,10 @@
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<% memo = Memo.where(:id => 1168).first %>
<% unless memo.nil? %>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<% end %>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>

View File

@ -70,12 +70,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => 0,:is_board =>0} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => 0, :is_board =>0}%>

View File

@ -68,13 +68,13 @@
</div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, document).count %>
<% all_replies = get_all_children(all_comments, document) %>
<% count = all_replies.count %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => document, :user_activity_id => act.id} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, document)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= act.id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => act.id, :type => 'OrgDocumentComment', :activity_id =>document.id}%>

View File

@ -1,6 +1,6 @@
<% if @polls.empty? %>
alert('您目前还没有自己新建的问卷');
alert('您的其它班级下没有问卷可供导入');
<% else %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'other_poll',:locals => {:polls => @polls,:polls_group_id=>@polls_group_id}) %>');

View File

@ -4,6 +4,7 @@
<% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %>
<%= join_in_project_link(@project, User.current) %>
<% else %>
等待审批
<a class="sy_btn_blue mr5">等待审批</a>
<% end %>
<% end %>
<% end %>

View File

@ -1,4 +1,5 @@
<% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %>
<% project_issue_count =Issue.where(:project_id => @project.id).count%>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
@ -8,8 +9,8 @@
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project, :remote => true), :class => "f14 c_blue02" %>
<% if @project.project_score.issue_num > 0 %>
<a class="subnav_num">(<%= @project.project_score.issue_num %>)</a>
<% if project_issue_count > 0 %>
<a class="subnav_num">(<%= project_issue_count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>

View File

@ -3,7 +3,7 @@
<% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div>
<div class="ping_discon" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_discon" style="width: 670px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>

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