Merge branch 'szzh' into api

Conflicts:
	Gemfile
	Gemfile.lock
	app/controllers/bids_controller.rb
	app/controllers/users_controller.rb
	db/schema.rb
api
z9hang 11 years ago
commit 0f9915fc2a

@ -18,6 +18,8 @@ gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "builder", "3.0.0" gem "builder", "3.0.0"
gem 'acts-as-taggable-on', '2.4.1' gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet'
gem 'ruby-ole'
group :development do group :development do
gem 'grape-swagger' gem 'grape-swagger'

@ -193,6 +193,7 @@ GEM
rails (>= 3.2.0) rails (>= 3.2.0)
sass-rails sass-rails
rmagick (2.13.2) rmagick (2.13.2)
ruby-ole (1.2.11.7)
ruby-openid (2.1.8) ruby-openid (2.1.8)
rubyzip (1.1.6) rubyzip (1.1.6)
sass (3.3.10) sass (3.3.10)
@ -211,6 +212,8 @@ GEM
shoulda-context (1.2.1) shoulda-context (1.2.1)
shoulda-matchers (2.6.1) shoulda-matchers (2.6.1)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
spreadsheet (1.0.0)
ruby-ole (>= 1.0)
sprockets (2.2.2) sprockets (2.2.2)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
@ -271,10 +274,12 @@ DEPENDENCIES
rails (= 3.2.13) rails (= 3.2.13)
rich (= 1.4.6) rich (= 1.4.6)
rmagick (>= 2.0.0) rmagick (>= 2.0.0)
ruby-ole
ruby-openid (~> 2.1.4) ruby-openid (~> 2.1.4)
sass-rails (~> 3.2.3) sass-rails (~> 3.2.3)
seems_rateable! seems_rateable!
selenium-webdriver (~> 2.42.0) selenium-webdriver (~> 2.42.0)
shoulda (~> 3.5.0) shoulda (~> 3.5.0)
spreadsheet
therubyracer therubyracer
uglifier (>= 1.0.3) uglifier (>= 1.0.3)

@ -224,7 +224,16 @@ class AccountController < ApplicationController
def email_valid def email_valid
end end
def resendmail
user = User.find(params[:user]) if params[:user]
token = Token.new(:user => user, :action => "register")
if token.save
Mailer.register(token).deliver
else
yield if block_given?
end
end
private private
def authenticate_user def authenticate_user

@ -236,13 +236,7 @@ class ApplicationController < ActionController::Base
# Authorize the user for the requested action # Authorize the user for the requested action
def authorize(ctrl = params[:controller], action = params[:action], global = false) def authorize(ctrl = params[:controller], action = params[:action], global = false)
#modify by NWB #modify by NWB
if @project allowed = authorize_allowed(params[:controller], params[:action],global)
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global)
elsif @course
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @course || @courses, :global => global)
else
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global)
end
if allowed if allowed
true true
@ -255,6 +249,17 @@ class ApplicationController < ActionController::Base
end end
end end
def authorize_allowed(ctrl = params[:controller], action = params[:action], global = false)
#modify by NWB
if @project
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global)
elsif @course
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @course || @courses, :global => global)
else
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global)
end
allowed
end
def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false) def authorize_attachment_download(ctrl = params[:controller], action = params[:action], global = false)
case @attachment.container_type case @attachment.container_type
when "Memo" when "Memo"
@ -754,6 +759,19 @@ class ApplicationController < ActionController::Base
end end
end end
def paginateHelper_for_members obj, pre_size=10
@obj_count = StudentsForCourse.find_by_sql("select count(id) as mem_count from students_for_courses where course_id = #{@course.id}")[0][:mem_count].to_s.to_i
@obj_pages = Paginator.new @obj_count, pre_size, params['page']
if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation
obj.limit(@obj_pages.per_page).offset(0)
elsif obj.kind_of? Array
obj[0, @obj_pages.per_page]
else
logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}"
raise RuntimeError, 'unknow type, Please input you type into this helper.'
end
end
#查找首页相关信息 #查找首页相关信息
def find_first_page def find_first_page
@first_page = FirstPage.find_by_page_type('project') @first_page = FirstPage.find_by_page_type('project')

@ -492,27 +492,19 @@ class BidsController < ApplicationController
if @bid.homework_type if @bid.homework_type
@homework = HomeworkAttach.new @homework = HomeworkAttach.new
@is_teacher = is_course_teacher(User.current,@bid.courses.first) @is_teacher = is_course_teacher(User.current,@bid.courses.first)
teachers = "("
teacher_members = searchTeacherAndAssistant(@bid.courses.first)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
if @is_teacher if @is_teacher
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*, all_homework_list = HomeworkAttach.find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1 FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
WHERE table1.t_score IS NULL") WHERE table1.t_score IS NULL")
@not_batch_homework = true
@cur_type = 1 @cur_type = 1
else else
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = #{@is_teacher ? 1 : 0}) AS m_score
FROM homework_attaches FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC") WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY s_score DESC")
@ -1048,8 +1040,18 @@ class BidsController < ApplicationController
end end
def alert_anonymous_comment def alert_anonymous_comment
hws = HomeworkService.new @bid = Bid.find params[:id]
@bid,@totle_size,@cur_size,@percent = hws.alert_homework_anonymous_comment(params) @course = @bid.courses.first
if @bid.comment_status == 0
@totle_size = searchStudent(@course).size
@cur_size = @bid.homeworks.size
elsif @bid.comment_status == 1
@totle_size = 0
@bid.homeworks.map { |homework| @totle_size += homework.homework_evaluations.count}
@cur_size = 0
@bid.homeworks.map { |homework| @cur_size += homework.rates(:quality).where("seems_rateable_rates.is_teacher_score = 0").count}
end
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
respond_to do |format| respond_to do |format|
format.js format.js
end end

@ -134,9 +134,8 @@ class ContestsController < ApplicationController
@state = false @state = false
respond_to do |format| respond_to do |format|
layout_file = 'base_newcontest'
format.html { format.html {
render :layout => layout_file render :layout => 'base_newcontest'
} }
format.api format.api
end end

@ -19,7 +19,7 @@ class CoursesController < ApplicationController
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course] before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create] before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar] before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :toggleCourse, only: [:finishcourse, :restartcourse] before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
before_filter :require_login, :only => [:join, :unjoin] before_filter :require_login, :only => [:join, :unjoin]
#before_filter :allow_join, :only => [:join] #before_filter :allow_join, :only => [:join]
@ -252,14 +252,17 @@ class CoursesController < ApplicationController
@subPage_title = '' @subPage_title = ''
#@members = @course.member_principals.includes(:roles, :principal).all.sort #@members = @course.member_principals.includes(:roles, :principal).all.sort
@is_remote = true @is_remote = true
@score_sort_by = "desc"
q = "#{params[:name].strip}" q = "#{params[:name].strip}"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:incourse] if params[:incourse]
@results = searchStudent_by_name(@course, q) @results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
elsif params[:ingroup] elsif params[:ingroup]
@group = CourseGroup.find(params[:search_group_id]) @group = CourseGroup.find(params[:search_group_id])
@results = searchgroupstudent_by_name(@group, @course, q) @results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
end end
@is_remote = true
@result_count = @results.count @result_count = @results.count
@results = paginateHelper @results @results = paginateHelper @results
@ -283,8 +286,7 @@ class CoursesController < ApplicationController
end end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups @course_groups = @course.course_groups
end end
@ -293,8 +295,7 @@ class CoursesController < ApplicationController
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups @course_groups = @course.course_groups
end end
@ -307,10 +308,28 @@ class CoursesController < ApplicationController
end end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups @course_groups = @course.course_groups
end end
def valid_ajax
req = Hash.new(false)
req[:message] = ''
valid_attr = params[:valid]
valid_value = params[:value]
faker = CourseGroup.new
if valid_attr.eql?('name')
faker.name = valid_value
faker.valid?
req[:valid] = faker.errors[:name].blank?
req[:message] = faker.errors[:name]
end
req[:message] = l(:modal_valid_passing) if req[:message].blank?
render :json => req
end
def join_group def join_group
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id]) group = CourseGroup.find(params[:object_id])
@ -318,9 +337,9 @@ class CoursesController < ApplicationController
member.course_group_id = group.id member.course_group_id = group.id
member.save member.save
@group = group @group = group
@members = searchStudent(@course)
@course_groups = @course.course_groups @course_groups = @course.course_groups
@membercount = @members.count
search_group_members group search_group_members group
end end
def unjoin_group def unjoin_group
@ -331,8 +350,7 @@ class CoursesController < ApplicationController
member.save member.save
@group = group @group = group
@course_groups = @course.course_groups @course_groups = @course.course_groups
@members = searchStudent(@course)
@membercount = @members.count
search_group_members group search_group_members group
end end
def searchgroupmembers def searchgroupmembers
@ -340,65 +358,115 @@ class CoursesController < ApplicationController
@render_file = 'member_list' @render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@score_sort_by = "desc"
if params[:group_id] && params[:group_id] != "0" if params[:group_id] && params[:group_id] != "0"
@group = CourseGroup.find(params[:group_id]) @group = CourseGroup.find(params[:group_id])
@results = searchStudent_by_group(@group, @course)
@results = student_homework_score(@group.id,0, 0,"desc")
@results = paginateHelper @results, 10
else else
@results = searchStudent(@course) page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(0,page_from, 10,"desc")
@results = paginateHelper_for_members @results, 10
end end
@members = searchStudent(@course)
@membercount = @members.count
@results = paginateHelper @results
end
def search_group_members group
@subPage_title = l :label_student_list
@render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@results = searchStudent_by_group(group, @course)
@results = paginateHelper @results
end end
def member def member
## 有角色参数的才是课程,没有的就是项目 ## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@render_file = 'member_list' @render_file = 'member_list'
@teachers= searchTeacherAndAssistant(@course) @score_sort_by = "desc"
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@role = params[:role] @role = params[:role].nil? ? '2':params[:role]
@is_remote = true
@course_groups = @course.course_groups if @course.course_groups @course_groups = @course.course_groups if @course.course_groups
@course_group_id = params[:@course_group_id] unless params[:@course_group_id].nil?
@show_serch = params[:role] == '2' @show_serch = params[:role] == '2'
case params[:role] case @role
when '1' when '1'
@subPage_title = l :label_teacher_list @subPage_title = l :label_teacher_list
@members = searchTeacherAndAssistant(@course) @all_members = searchTeacherAndAssistant(@course)
@members = paginateHelper @all_members, 10
when '2' when '2'
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,"desc")
@members = paginateHelper_for_members @all_members, 10
@members = searchStudent(@course)
@membercount = @members.count
end
respond_to do |format|
if params[:page]
format.js
else else
@subPage_title = '' format.html {render :layout => 'base_courses'}
@members = @course.member_principals.includes(:roles, :principal).all.sort
end end
@members = paginateHelper @members end
render :layout => 'base_courses'
# render :layout => 'base_courses'
else else
render_403 render_403
end end
end end
#判断指定用户是否为课程教师 def export_course_member_excel
def isCourseTeacher(id) @all_members = student_homework_score(0,0,0,"desc")
result = false respond_to do |format|
if @teachers.find_by_user_id(id) != nil format.xls {
result = true send_data(member_to_xls(@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}.xls")
}
end end
result end
def member_score_sort
# @teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
# @role = params[:role]
# @course_groups = @course.course_groups if @course.course_groups
# @show_serch = params[:role] == '2'
@subPage_title = l :label_student_list
@render_file = 'member_list'
# @results = params[:result] if params[:result]
# unless @result.nil?
# @results = @result.reverse
#
# end
# @results = paginateHelper @results@score_sort_by = "desc"
@is_remote = true
@score_sort_by = params[:sort_by] if params[:sort_by]
group_id = params[:group_id]
if group_id == '0'
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@results = student_homework_score(0,page, 10,@score_sort_by)
@results = paginateHelper_for_members @results, 10
else
@group = CourseGroup.find(group_id)
@results = student_homework_score(group_id, 0, 0,@score_sort_by)
@results = paginateHelper @results, 10
end
end
# 显示每个学生的作业评分详情
def show_member_score
@member_score = Member.find(params[:member_id]) if params[:member_id]
respond_to do |format|
format.html {render :layout => 'course_base'}
format.js
end
end end
def handle_course courses, activities def handle_course courses, activities
@ -504,12 +572,13 @@ class CoursesController < ApplicationController
# end # end
end end
def course def
course
@school_id = params[:school_id] @school_id = params[:school_id]
per_page_option = 10 per_page_option = 10
if @school_id == "0" or @school_id.nil? if @school_id == "0" or @school_id.nil?
@courses_all = Course.active.visible. @courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id")
else else
@courses_all = Course.active.visible. @courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id"). joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
@ -912,4 +981,104 @@ class CoursesController < ApplicationController
render_404 render_404
end end
end end
def student_homework_score(groupid,start_from, nums, score_sort_by)
#teachers = find_course_teachers(@course)
start_from = start_from * nums
sql_select = ""
if groupid == 0
if nums == 0
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
UNION all
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
)
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
else
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id}) GROUP BY members.user_id
UNION all
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id} AND
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
)
GROUP BY members.user_id ORDER BY score #{score_sort_by} limit #{start_from}, #{nums}"
end
else
sql_select = "SELECT members.*, SUM(homework_attaches.score) as score FROM members, homework_attaches
WHERE members.course_id = #{@course.id} AND members.user_id in (SELECT students_for_courses.student_id FROM students_for_courses WHERE course_id = #{@course.id}) AND members.user_id = homework_attaches.user_id
and members.course_group_id = #{groupid} AND homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id})
GROUP BY members.user_id
UNION all
SELECT members.*, 0 as score FROM members,homework_attaches,students_for_courses WHERE members.course_id = #{@course.id}
and members.course_group_id = #{groupid} AND
students_for_courses.course_id = #{@course.id} and members.user_id = students_for_courses.student_id AND
members.user_id NOT IN (SELECT homework_attaches.user_id FROM homework_attaches WHERE homework_attaches.bid_id in (SELECT bid_id FROM homework_for_courses WHERE course_id = #{@course.id} )
)
GROUP BY members.user_id ORDER BY score #{score_sort_by}"
end
sql = ActiveRecord::Base.connection()
homework_scores = Member.find_by_sql(sql_select)
sql.close()
homework_scores
end
#获取课程的老师列表
def find_course_teachers course
searchTeacherAndAssistant(course).map{|teacher| teacher.user_id}.join(",")
end
#当加入,退出分班时查询分班的学生
def search_group_members group
@subPage_title = l :label_student_list
@render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@score_sort_by = "desc"
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(group.id,0,0, "desc")
@results = paginateHelper @results, 10
end
def member_to_xls members,groups
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "student"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
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_homework_score)])
count_row = 1
group0 = CourseGroup.new();
group0.id = 0;
group0.name = l(:excel_member_with_out_class)
groups_dup = groups.dup
groups_dup << group0
groups_dup.each do |group|
sheet1[count_row,0] = l(:excel_class)
sheet1[count_row,1] = group.name
count_row += 1
members.each do |member|
if member.course_group_id == group.id
sheet1[count_row,0]= member.user.id
sheet1[count_row,1] = member.user.lastname.to_s + member.user.firstname.to_s
sheet1[count_row,2] = member.user.login
sheet1[count_row,3] = member.user.user_extensions.student_id
sheet1[count_row,4] = member.user.mail
sheet1[count_row,5] = format("%0.2f",member.score.nil? ? 0:member.score.to_s)
count_row += 1
end
end
end
book.write xls_report
xls_report.string
end
end end

@ -201,6 +201,7 @@ class FilesController < ApplicationController
def quote_resource_show def quote_resource_show
@file = Attachment.find(params[:id]) @file = Attachment.find(params[:id])
@can_quote = attachment_candown @file
end end
def new def new
@ -394,8 +395,7 @@ class FilesController < ApplicationController
render :layout => 'base_courses' render :layout => 'base_courses'
} }
end end
end else
show_attachments @containers show_attachments @containers
@attachtype = params[:type].to_i @attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s @contenttype = params[:contentType].to_s
@ -404,6 +404,9 @@ class FilesController < ApplicationController
format.js format.js
format.html format.html
end end
end
end end
end end

@ -13,6 +13,44 @@ class ForumsController < ApplicationController
include SortHelper include SortHelper
PageLimit = 20 PageLimit = 20
def create_feedback
if User.current.logged?
@memo = Memo.new(params[:memo])
@memo.forum_id = "1"
@memo.author_id = User.current.id
#@forum = @memo.forum
respond_to do |format|
if @memo.save
format.html { redirect_to forum_path(@memo.forum) }
else
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{Memo.table_name}.created_at",
'replies' => "#{Memo.table_name}.replies_count",
'updated_at' => "COALESCE (last_replies_memos.created_at, #{Memo.table_name}.created_at)"
@topic_count = @forum.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @forum.topics.
reorder("#{Memo.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
preload(:author, {:last_reply => :author}).
all
flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
# back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
format.html { render action: :show, layout: 'base_forums' }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
format.json { render json: @memo.errors, status: :unprocessable_entity }
end
end
else
respond_to do |format|
format.html { redirect_to signin_path }
end
end
end
def create_memo def create_memo
@memo = Memo.new(params[:memo]) @memo = Memo.new(params[:memo])
@ -56,7 +94,6 @@ class ForumsController < ApplicationController
@forums_count = @forums_all.count @forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page'] @forums_pages = Paginator.new @forums_count, @limit, params['page']
@offset ||= @forums_pages.offset @offset ||= @forums_pages.offset
@forums = @forums_all.offset(@offset).limit(@limit).all @forums = @forums_all.offset(@offset).limit(@limit).all
#@forums = Forum.all #@forums = Forum.all
@ -86,8 +123,6 @@ class ForumsController < ApplicationController
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all all
# @offset, @limit = api_offset_and_limit({:limit => 10}) # @offset, @limit = api_offset_and_limit({:limit => 10})
# @forum = Forum.find(params[:id]) # @forum = Forum.find(params[:id])
# @memos_all = @forum.topics # @memos_all = @forum.topics
@ -176,7 +211,6 @@ class ForumsController < ApplicationController
@forums_count = @forums_all.count @forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page'] @forums_pages = Paginator.new @forums_count, @limit, params['page']
@offset ||= @forums_pages.offset @offset ||= @forums_pages.offset
@forums = @forums_all.offset(@offset).limit(@limit).all @forums = @forums_all.offset(@offset).limit(@limit).all
respond_to do |format| respond_to do |format|
@ -208,11 +242,8 @@ class ForumsController < ApplicationController
end end
end end
private private
def find_forum_if_available def find_forum_if_available
@forum = Forum.find(params[:id]) if params[:id] @forum = Forum.find(params[:id]) if params[:id]
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound

@ -21,20 +21,25 @@ class HomeworkAttachController < ApplicationController
#获取未批作业列表 #获取未批作业列表
def get_not_batch_homework def get_not_batch_homework
@not_batch_homework = true
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc" sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
teachers = find_course_teachers @course get_not_batch_homework_list sort,direction, @bid.id
get_not_batch_homework_list sort,direction,teachers, @bid.id
@cur_page = params[:page] || 1 @cur_page = params[:page] || 1
@cur_type = 1 @cur_type = 1
@direction = direction == 'asc'? 'desc' : 'asc' @direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format| respond_to do |format|
format.js format.js
format.xls {
send_data(homework_to_xls(@all_homework_list), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@bid.name}#{l(:excel_homework_list)}(#{l(:excel_not_rated)}).xls")
}
end end
end end
#获取已评作业列表 #获取已评作业列表
def get_batch_homeworks def get_batch_homeworks
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc" sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
@is_batch_homeworks = true
if sort == 't_socre' if sort == 't_socre'
order_by = "t_score #{direction}" order_by = "t_score #{direction}"
elsif sort == 's_socre' elsif sort == 's_socre'
@ -42,10 +47,9 @@ class HomeworkAttachController < ApplicationController
elsif sort == 'time' elsif sort == 'time'
order_by = "created_at #{direction}" order_by = "created_at #{direction}"
end end
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*, all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers}) and stars IS NOT NULL) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1 ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NOT NULL") WHERE table1.t_score IS NOT NULL")
@ -55,11 +59,18 @@ class HomeworkAttachController < ApplicationController
@direction = direction == 'asc'? 'desc' : 'asc' @direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format| respond_to do |format|
format.js format.js
format.xls {
send_data(homework_to_xls(all_homework_list), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@bid.name}#{l(:excel_homework_list)}(#{l(:excel_been_rated)}).xls")
}
end end
end end
#获取所有作业列表 #获取所有作业列表
def get_homeworks def get_homeworks
@is_all_homeworks = true
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc" sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
if sort == 't_socre' if sort == 't_socre'
order_by = "t_score #{direction}" order_by = "t_score #{direction}"
@ -68,10 +79,9 @@ class HomeworkAttachController < ApplicationController
elsif sort == 'time' elsif sort == 'time'
order_by = "created_at #{direction}" order_by = "created_at #{direction}"
end end
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id in (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id not in (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}") ORDER BY #{order_by}")
@cur_page = params[:page] || 1 @cur_page = params[:page] || 1
@ -80,17 +90,20 @@ class HomeworkAttachController < ApplicationController
@direction = direction == 'asc'? 'desc' : 'asc' @direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format| respond_to do |format|
format.js format.js
format.xls {
send_data(homework_to_xls(all_homework_list), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@bid.name}#{l(:excel_homework_list)}.xls")
}
end end
end end
#获取学生匿评列表 #获取学生匿评列表
def get_student_batch_homework def get_student_batch_homework
@is_student_batch_homework = true @is_student_batch_homework = true
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = 0) AS m_score
FROM homework_attaches FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC") WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id} ORDER BY m_score DESC")
@ -105,17 +118,16 @@ class HomeworkAttachController < ApplicationController
#获取我的作业 #获取我的作业
def get_my_homework def get_my_homework
@is_my_homework = true @is_my_homework = true
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches FROM homework_attaches
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_attaches.user_id = #{User.current.id}") WHERE homework_attaches.bid_id = #{@bid.id} AND homework_attaches.user_id = #{User.current.id}")
#如果我没有创建过作业,就检索我是否参与了某个作业 #如果我没有创建过作业,就检索我是否参与了某个作业
if all_homework_list.empty? if all_homework_list.empty?
all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*, all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches FROM homework_attaches
INNER JOIN homework_users ON homework_users.homework_attach_id = homework_attaches.id INNER JOIN homework_users ON homework_users.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_users.user_id = #{User.current.id}") WHERE homework_attaches.bid_id = #{@bid.id} AND homework_users.user_id = #{User.current.id}")
@ -348,7 +360,7 @@ class HomeworkAttachController < ApplicationController
else else
end end
else else
render_403 :message => :notice_not_authorized render_403
end end
end end
@ -358,12 +370,11 @@ class HomeworkAttachController < ApplicationController
# 作业打分列表 # 作业打分列表
@stars_reates = @homework.rates(:quality) @stars_reates = @homework.rates(:quality)
#我的评分 #我的评分
@has_evaluation = @stars_reates.where("rater_id = #{User.current.id}").first
@m_score = @has_evaluation.nil? ? 0 : @has_evaluation.stars
teachers = find_course_teachers(@course)
@teacher_stars = @stars_reates.where("rater_id in (#{teachers})") #老师评分列表
@student_stars = @stars_reates.where("rater_id not in (#{teachers})") #学生评分列表
@is_teacher = is_course_teacher User.current,@course @is_teacher = is_course_teacher User.current,@course
@has_evaluation = @stars_reates.where("rater_id = #{User.current.id} and is_teacher_score=#{@is_teacher ? 1 : 0}").first
@m_score = @has_evaluation.nil? ? 0 : @has_evaluation.stars
@teacher_stars = @stars_reates.where("is_teacher_score = 1") #老师评分列表
@student_stars = @stars_reates.where("is_teacher_score = 0") #学生评分列表
@is_anonymous_comments = @bid.comment_status == 1 && !@homework.users.include?(User.current) && @homework.user != User.current && !@is_teacher #判断是不是匿评(开启匿评,当前用户不是作业的创建者或者参与者,不是老师) @is_anonymous_comments = @bid.comment_status == 1 && !@homework.users.include?(User.current) && @homework.user != User.current && !@is_teacher #判断是不是匿评(开启匿评,当前用户不是作业的创建者或者参与者,不是老师)
jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据 jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言 @jour = paginateHelper jours,5 #留言
@ -385,10 +396,9 @@ class HomeworkAttachController < ApplicationController
@journal_destroyed = JournalsForMessage.find(params[:object_id]) @journal_destroyed = JournalsForMessage.find(params[:object_id])
if @journal_destroyed.is_comprehensive_evaluation == 3 && @journal_destroyed.destroy if @journal_destroyed.is_comprehensive_evaluation == 3 && @journal_destroyed.destroy
render_403 unless User.current == @journal_destroyed.user || User.current.admin? render_403 unless User.current == @journal_destroyed.user || User.current.admin?
teachers = find_course_teachers(@homework.bid.courses.first)
@stars_reates = @homework.rates(:quality) @stars_reates = @homework.rates(:quality)
@teacher_stars = @stars_reates.where("rater_id in (#{teachers})") #老师评分列表 @teacher_stars = @stars_reates.where("is_teacher_score = 1)") #老师评分列表
@student_stars = @stars_reates.where("rater_id not in (#{teachers})") #学生评分列表 @student_stars = @stars_reates.where("is_teacher_score = 0") #学生评分列表
jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据 jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言 @jour = paginateHelper jours,5 #留言
else else
@ -425,41 +435,67 @@ class HomeworkAttachController < ApplicationController
@is_teacher,@is_anonymous_comments,@m_score = params[:is_teacher]=="true",params[:is_anonymous_comments]=="true",params[:stars_value] @is_teacher,@is_anonymous_comments,@m_score = params[:is_teacher]=="true",params[:is_anonymous_comments]=="true",params[:stars_value]
@cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5 @cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5
@homework = HomeworkAttach.find(params[:homework_id]) @homework = HomeworkAttach.find(params[:homework_id])
@stars_reates = @homework.rates(:quality)
homework = @homework
is_teacher = @is_teacher ? 1 : 0
#保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0))
if @m_score
rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first
if rate
rate.stars = @m_score
rate.save!
else
@homework.rates(:quality).new(:stars => @m_score, :rater_id => User.current.id, :is_teacher_score => is_teacher).save!
end
if homework.is_teacher_score == 0
if is_teacher == 1
homework.score = @m_score
homework.is_teacher_score = 1
else
sql = "SELECT AVG(stars) as stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id}"
score= HomeworkAttach.find_by_sql(sql).first.stars
homework.score = score
end
else
if is_teacher == 1
homework.score = @m_score
homework.is_teacher_score = 1
end
end
homework.save!
end
#保存评分
@homework.rate(@m_score.to_i,User.current.id,:quality) if @m_score
#保存评论 #保存评论
@is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言 @is_comprehensive_evaluation = @is_teacher ? 1 : (@is_anonymous_comments ? 2 : 3) #判断当前评论是老师评论?匿评?留言
if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言 if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #有没有留言
@homework.addjours User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation @homework.addjours User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation
end end
teachers = find_course_teachers(@homework.bid.courses.first) @teacher_stars = @stars_reates.where("is_teacher_score = 1") #老师评分列表
@stars_reates = @homework.rates(:quality) @student_stars = @stars_reates.where("is_teacher_score = 0") #学生评分列表
@teacher_stars = @stars_reates.where("rater_id in (#{teachers})") #老师评分列表
@student_stars = @stars_reates.where("rater_id not in (#{teachers})") #学生评分列表
jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据 jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")#jours留言 is null条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言 @jour = paginateHelper jours,5 #留言
if @cur_type == "1" #如果当前是老师未批列表,需要刷新整个作业列表界面 if @cur_type == "1" #如果当前是老师未批列表,需要刷新整个作业列表界面
@bid = @homework.bid @bid = @homework.bid
get_not_batch_homework_list "s_socre","desc",teachers,@homework.bid_id get_not_batch_homework_list "s_socre","desc",@homework.bid_id
elsif @cur_type == "2" #老师已批列表 elsif @cur_type == "2" #老师已批列表
@result_homework = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, @result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers}) and stars IS NOT NULL) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE id = #{@homework.id}").first FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "3" #全部作业列表 elsif @cur_type == "3" #全部作业列表
@result_homework = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, @result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id in (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id not in (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE id = #{@homework.id}").first FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "4" #匿评作业列表 elsif @cur_type == "4" #匿评作业列表
@is_student_batch_homework = true @is_student_batch_homework = true
@result_homework = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, @result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = #{is_teacher}) AS m_score
FROM homework_attaches FROM homework_attaches
WHERE homework_attaches.id = #{@homework.id}").first WHERE homework_attaches.id = #{@homework.id}").first
else #其他的不用管 else #其他的不用管
@ -552,7 +588,7 @@ class HomeworkAttachController < ApplicationController
teacher_proportion teacher_proportion
end end
def get_not_batch_homework_list sort,direction,teachers,bid_id def get_not_batch_homework_list sort,direction,bid_id
if sort == 't_socre' if sort == 't_socre'
order_by = "t_score #{direction}" order_by = "t_score #{direction}"
elsif sort == 's_socre' elsif sort == 's_socre'
@ -560,18 +596,65 @@ class HomeworkAttachController < ApplicationController
elsif sort == 'time' elsif sort == 'time'
order_by = "created_at #{direction}" order_by = "created_at #{direction}"
end end
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*, @all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN (#{teachers})) AS t_score, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN (#{teachers})) AS s_score (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{bid_id} FROM homework_attaches WHERE bid_id = #{bid_id}
ORDER BY #{order_by}) AS table1 ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NULL") WHERE table1.t_score IS NULL")
@homework_list = paginateHelper all_homework_list,10 @homework_list = paginateHelper @all_homework_list,10
end end
#获取指定作业的所有成员 #获取指定作业的所有成员
def users_for_homework homework def users_for_homework homework
homework.nil? ? [] : (homework.users + [homework.user]) homework.nil? ? [] : (homework.users + [homework.user])
end end
def homework_to_csv items
encoding = l(:general_csv_encoding)
columns = ["student_id","user_name","login","student_num","mail","work_name","teacher_score","ni_score","commit_time"]
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
csv << columns.collect {|c| Redmine::CodesetUtil.from_utf8(c, encoding) }
# csv lines
items.each do |homework|
csv << [homework.user.id,Redmine::CodesetUtil.from_utf8(homework.user.lastname.to_s + homework.user.firstname.to_s, encoding),Redmine::CodesetUtil.from_utf8(homework.user.login, encoding),
Redmine::CodesetUtil.from_utf8(homework.user.user_extensions.student_id, encoding),Redmine::CodesetUtil.from_utf8(homework.user.mail, encoding),Redmine::CodesetUtil.from_utf8(homework.name, encoding),
Redmine::CodesetUtil.from_utf8((homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score), encoding),
Redmine::CodesetUtil.from_utf8( homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score), encoding),Redmine::CodesetUtil.from_utf8(format_time(homework.created_at), encoding)]
end
end
export
end
def homework_to_xls items
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "homework"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
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_homework_name),
l(:excel_t_score),l(:excel_n_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] =(homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)
sheet1[count_row,7] = homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score)
sheet1[count_row,8] = format_time(homework.created_at)
count_row += 1
end
book.write xls_report
xls_report.string
end
end end

@ -129,7 +129,7 @@ class MembersController < ApplicationController
member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id) member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
role = Role.find_by_id(params[:membership][:role_ids]) role = Role.find_by_id(params[:membership][:role_ids])
# 这里的判断只能通过角色名,可以弄成常量 # 这里的判断只能通过角色名,可以弄成常量
if role.name == "学生" if role.name == "学生" || role.name == "Student"
StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id) StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id)
end end
members << member members << member
@ -210,7 +210,7 @@ class MembersController < ApplicationController
if (params[:membership][:role_ids]) if (params[:membership][:role_ids])
role = Role.find(params[:membership][:role_ids][0]) role = Role.find(params[:membership][:role_ids][0])
# 这里的判断只能通过角色名,可以弄成常量 # 这里的判断只能通过角色名,可以弄成常量
if role.name == "学生" if role.name == "学生" || role.name == "Student"
StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id) StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id)
else else
joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id) joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id)

@ -150,6 +150,7 @@ class MyController < ApplicationController
File.delete(diskfile1) File.delete(diskfile1)
end end
end end
end end
# Destroys user's account # Destroys user's account

@ -0,0 +1,2 @@
class PollAnswerController < ApplicationController
end

@ -0,0 +1,2 @@
class PollController < ApplicationController
end

@ -0,0 +1,2 @@
class PollQuestionController < ApplicationController
end

@ -0,0 +1,2 @@
class PollUserController < ApplicationController
end

@ -0,0 +1,2 @@
class PollVoteController < ApplicationController
end

@ -48,7 +48,7 @@ class SoftapplicationsController < ApplicationController
def show def show
@softapplication = Softapplication.find(params[:id]) @softapplication = Softapplication.find(params[:id])
@project = @softapplication.project #@project = @softapplication.project
# 打分统计 # 打分统计
stars_reates = @softapplication. stars_reates = @softapplication.
rates(:quality) rates(:quality)

@ -41,7 +41,7 @@ class UsersController < ApplicationController
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index] :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index]
before_filter :auth_user_extension, only: :show before_filter :auth_user_extension, only: :show
before_filter :rest_user_score, only: :show #before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects #before_filter :select_entry, only: :user_projects
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx accept_api_auth :index, :show, :create, :update, :destroy,:tag_save , :tag_saveEx
@ -129,7 +129,7 @@ class UsersController < ApplicationController
end end
def show_new_score def show_new_score
render :layout => false render :layout => 'users_base'
end end
# end # end
@ -393,7 +393,6 @@ class UsersController < ApplicationController
end end
@users = scope.offset(@offset).limit(limit).all.reverse @users = scope.offset(@offset).limit(limit).all.reverse
end end
respond_to do |format| respond_to do |format|
format.html { format.html {
@groups = Group.all.sort @groups = Group.all.sort
@ -435,9 +434,16 @@ class UsersController < ApplicationController
else else
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc') activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
end end
@activity_count = activity.count @activity_count = activity.count
@activity_pages = Paginator.new @activity_count, pre_count, params['page'] @activity_pages = Paginator.new @activity_count, pre_count, params['page']
@activity = activity.offset(@activity_pages.offset).limit(@activity_pages.per_page).all activity_page = activity.slice(@activity_pages.offset,@activity_pages.per_page * 2)
activity_page = activity_page.reject { |e|
((e.act_type=="Issue") && ( !e.act.visible?(User.current))) ||
((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) ||
((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?)))
}
@activity = activity.slice(0,@activity_pages.per_page)
@state = 0 @state = 0
end end

@ -62,9 +62,45 @@ class WelcomeController < ApplicationController
@course_page = FirstPage.find_by_page_type('course') @course_page = FirstPage.find_by_page_type('course')
@school_id = params[:school_id] || User.current.user_extensions.school.try(:id) @school_id = params[:school_id] || User.current.user_extensions.school.try(:id)
@logoLink ||= logolink() @logoLink ||= logolink()
end
##3-8月份为查找春季课程9-2月份为查找秋季课程
#month_now = Time.now.strftime("%m").to_i
#year_now = Time.new.strftime("%Y").to_i
#(month_now >= 3 && month_now < 9) ? course_term = l(:label_spring) : course_term = l(:label_autumn)
##year_now -= 1 if year_now < 3
#@school_id.nil? ? @cur_school_course = [] : @cur_school_course = find_miracle_course(10,7,@school_id, year_now, course_term)
##未登录或者当前学校未开设课程
#if @cur_school_course.empty?
# @has_course = false
# User.current.logged? ? course_count = 9 : course_count = 10
# @cur_school_course += find_all_new_hot_course(course_count, @school_id, year_now, course_term)
# while @cur_school_course.count < 9 do
# if course_term == l(:label_spring)
# course_term = l(:label_autumn)
# year_now -= 1
# else
# course_term = l(:label_spring)
# end
# @cur_school_course += find_all_new_hot_course((10-@cur_school_course.count), nil, year_now, course_term)
# end
#else
# if @cur_school_course.count < 9
# @has_course = false
# @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, @school_id, year_now, course_term)
# if @cur_school_course.count < 9
# if course_term == l(:label_spring)
# course_term = l(:label_autumn)
# year_now -= 1
# else
# course_term = l(:label_spring)
# end
# @cur_school_course += find_all_new_hot_course(9-@cur_school_course.count, nil, year_now, course_term)
# end
# else
# @has_course = true
# end
#end
end
def logolink() def logolink()
@course_page = FirstPage.find_by_page_type('course') @course_page = FirstPage.find_by_page_type('course')
@ -110,6 +146,7 @@ class WelcomeController < ApplicationController
def search def search
search_condition = params[:q] search_condition = params[:q]
search_type = params[:search_type].to_sym unless search_condition.blank? search_type = params[:search_type].to_sym unless search_condition.blank?
search_by = params[:search_by]
if search_type.nil? && params[:contests_search] && params[:name] != "" if search_type.nil? && params[:contests_search] && params[:name] != ""
search_type = :contests search_type = :contests
@ -127,11 +164,11 @@ class WelcomeController < ApplicationController
when :contests when :contests
redirect_to contests_url(:name => search_condition) redirect_to contests_url(:name => search_condition)
when :users when :users
redirect_to users_search_url(:name => search_condition) redirect_to users_search_url(:name => search_condition,:search_by => search_by)
when :users_teacher when :users_teacher
redirect_to users_search_url(:name => search_condition, :role => :teacher) redirect_to users_search_url(:name => search_condition, :search_by => search_by, :role => :teacher)
when :users_student when :users_student
redirect_to users_search_url(:name => search_condition, :role => :student) redirect_to users_search_url(:name => search_condition, :search_by => search_by, :role => :student)
else else
#redirect_to home_path, :alert => l(:label_sumbit_empty) #redirect_to home_path, :alert => l(:label_sumbit_empty)
(redirect_to home_url, :notice => l(:label_sumbit_empty);return) #if params[:name].blank? (redirect_to home_url, :notice => l(:label_sumbit_empty);return) #if params[:name].blank?

@ -75,16 +75,21 @@ class ZipdownController < ApplicationController
def zip_homework_by_user(homeattach) def zip_homework_by_user(homeattach)
homeworks_attach_path = [] homeworks_attach_path = []
not_exist_file = []
# 需要将所有homework.attachments遍历加入zip # 需要将所有homework.attachments遍历加入zip
# 并且返回zip路径 # 并且返回zip路径
homeattach.attachments.each do |attach| homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) if File.exist?(attach.diskfile)
homeworks_attach_path << attach.diskfile
else
not_exist_file << attach.filename
end
end end
zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true, not_exist_file)
end end
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false) def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
# 输入待打包的文件列表已经打包文件定位到ouput_path # 输入待打包的文件列表已经打包文件定位到ouput_path
ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE') ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE')
input_filename = files_paths input_filename = files_paths
@ -101,9 +106,11 @@ class ZipdownController < ApplicationController
zipfile.add(rename_file, filename) zipfile.add(rename_file, filename)
end end
#zipfile.get_output_stream('ReadMe') do |os| unless not_exist_file.empty?
# os.write 'Homeworks' zipfile.get_output_stream('FILE_LOST.txt') do |os|
#end os.write l(:label_file_lost) + not_exist_file.join(',').to_s
end
end
end end
zipfile_name zipfile_name
rescue Errno => e rescue Errno => e

@ -1594,6 +1594,12 @@ module ApplicationHelper
s s
end end
def get_memo
@new_memo = Memo.new
#@new_memo.subject = "有什么想说的,尽管来咆哮吧~~"
@public_forum = Forum.find(1)
end
private private
def wiki_helper def wiki_helper

@ -20,7 +20,7 @@ module CoursesHelper
# 返回教师数量即roles表中定义的Manager # 返回教师数量即roles表中定义的Manager
def teacherCount project def teacherCount project
searchTeacherAndAssistant(project).count project.members.count - studentCount(project).to_i
# or # or
# searchTeacherAndAssistant(project).count # searchTeacherAndAssistant(project).count
end end
@ -114,7 +114,7 @@ module CoursesHelper
# 学生人数计算 # 学生人数计算
# add by nwb # add by nwb
def studentCount course def studentCount course
searchStudent(course).count.to_s#course.student.count course.student.count.to_s#course.student.count
end end
#课程成员数计算 #课程成员数计算
@ -166,11 +166,18 @@ module CoursesHelper
def searchStudent project def searchStudent project
#searchPeopleByRoles(project, StudentRoles) #searchPeopleByRoles(project, StudentRoles)
members = [] members = []
project.members.each do |m| project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_student,project) if m && m.user && m.user.allowed_to?(:as_student,project)
members << m
end
end end
members members
end end
def searchStudent_by_name project, name def searchStudent_by_name project, name
#searchPeopleByRoles(project, StudentRoles) #searchPeopleByRoles(project, StudentRoles)
members = [] members = []
@ -184,6 +191,39 @@ module CoursesHelper
end end
members members
end end
def searchmember_by_name members, name
#searchPeopleByRoles(project, StudentRoles)
mems = []
if name != ""
members.each do |m|
username = m.user[:lastname].to_s + m.user[:firstname].to_s
if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
mems << m
end
end
else
mems = members
end
mems
end
def searchgroupmember_by_name members, name, group
#searchPeopleByRoles(project, StudentRoles)
mems = []
if name != ""
members.each do |m|
if m.course_group_id == group.id
username = m.user[:lastname].to_s + m.user[:firstname].to_s
if(m.user[:login].to_s.include?(name) || m.user.user_extensions[:student_id].to_s.include?(name) || username.include?(name))
mems << m
end
end
end
else
mems = members
end
mems
end
def searchgroupstudent_by_name(group, project, name) def searchgroupstudent_by_name(group, project, name)
members = [] members = []
group.members.each do |m| group.members.each do |m|
@ -392,7 +432,13 @@ module CoursesHelper
return teacher_score_for_homework homework return teacher_score_for_homework homework
end end
end end
def score_for_homework_new homework
if teacher_score_for_homework(homework) != 0
return teacher_score_for_homework homework
else
return student_score_for_homework homework
end
end
#获取作业的互评得分 #获取作业的互评得分
def student_score_for_homework homework def student_score_for_homework homework
#member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first #member = searchTeacherAndAssistant(homework.bid.courses.first).first#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first

@ -227,7 +227,7 @@ module IssuesHelper
strings = [] strings = []
values_by_field = {} values_by_field = {}
details.each do |detail| details.each do |detail|
unless detail.property == 'attachment'
if detail.property == 'cf' if detail.property == 'cf'
field_id = detail.prop_key field_id = detail.prop_key
field = CustomField.find_by_id(field_id) field = CustomField.find_by_id(field_id)
@ -243,7 +243,7 @@ module IssuesHelper
end end
end end
strings << show_detail(detail, no_html, options) strings << show_detail(detail, no_html, options)
end
end end
values_by_field.each do |field_id, changes| values_by_field.each do |field_id, changes|
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id) detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)

@ -98,7 +98,7 @@ module WatchersHelper
# modify by nwb # modify by nwb
# 主讲教师不允许退出课程 # 主讲教师不允许退出课程
return '' if user.id == course.tea_id return '' if user.id == course.tea_id
joined = user.member_of_course?(course) joined = course.members.map{|m| m.user}.include? user
text = joined ? l(:label_exit_course) : l(:label_new_join) text = joined ? l(:label_exit_course) : l(:label_new_join)
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post' method = joined ? 'delete' : 'post'

@ -36,9 +36,9 @@ class Course < ActiveRecord::Base
acts_as_attachable :view_permission => :view_course_files, acts_as_attachable :view_permission => :view_course_files,
:delete_permission => :manage_files :delete_permission => :manage_files
validates_presence_of :password, :term,:name,:description validates_presence_of :password, :term,:name
validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/
validates_length_of :description, :maximum => 10000 validates_length_of :description, :maximum => 10000
before_save :self_validate before_save :self_validate
after_create :create_board_sync after_create :create_board_sync

@ -51,7 +51,7 @@ class Issue < ActiveRecord::Base
acts_as_nested_set :scope => 'root_id', :dependent => :destroy acts_as_nested_set :scope => 'root_id', :dependent => :destroy
acts_as_attachable :after_add => :attachment_added, :after_remove => :attachment_removed acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
acts_as_customizable acts_as_customizable
acts_as_watchable acts_as_watchable
acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"], acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base
# Callback on file attachment # Callback on file attachment
def attachment_added(obj) def attachment_added(obj)
if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename) @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end end
end end

@ -114,9 +114,36 @@ class Member < ActiveRecord::Base
member member
end end
# 查找每个学生每个作业的评分
def student_homework_score
score_count = 0
homework_score = HomeworkAttach.find_by_sql("SELECT bids.name, homework_attaches.score as score
FROM homework_attaches, bids where homework_attaches.user_id = #{self.user_id}
and homework_attaches.bid_id IN (SELECT bid_id FROM homework_for_courses where course_id = #{self.course_id})
AND homework_attaches.bid_id = bids.id ")
homework_score.each do |homework|
mem_score = 0
if homework[:score]
mem_score = homework[:score]
end
score_count = score_count + mem_score
end
[homework_score, format("%0.2f", score_count)]
end
protected protected
def validate_role def validate_role
errors.add_on_empty :role if member_roles.empty? && roles.empty? errors.add_on_empty :role if member_roles.empty? && roles.empty?
end end
def searchTeacherAndAssistant project
#searchPeopleByRoles(project, TeacherRoles)
members = []
project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
end
members
end
end end

@ -0,0 +1,9 @@
class Poll < ActiveRecord::Base
#attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id
include Redmine::SafeAttributes
belongs_to :user
has_many :poll_questions, :dependent => :destroy
has_many :poll_users, :dependent => :destroy
has_many :users, :through => :poll_users #该文件被哪些用户提交答案过
end

@ -0,0 +1,7 @@
class PollAnswer < ActiveRecord::Base
# attr_accessible :answer_position, :answer_text, :poll_questions_id
include Redmine::SafeAttributes
belongs_to :poll_question
has_many :poll_votes, :dependent => :destroy
end

@ -0,0 +1,8 @@
class PollQuestion < ActiveRecord::Base
# attr_accessible :is_necessary, :polls_id, :question_title, :question_type
include Redmine::SafeAttributes
belongs_to :poll
has_many :poll_answers, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy
end

@ -0,0 +1,7 @@
class PollUser < ActiveRecord::Base
# attr_accessible :poll_id, :user_id
include Redmine::SafeAttributes
belongs_to :poll
belongs_to :user
end

@ -0,0 +1,8 @@
class PollVote < ActiveRecord::Base
# attr_accessible :poll_answers_id, :poll_questions_id, :user_id, :vote_text
include Redmine::SafeAttributes
belongs_to :poll_answer
belongs_to :poll_question
belongs_to :user
end

@ -173,6 +173,7 @@ class Query < ActiveRecord::Base
:string => [ "=", "~", "!", "!~", "!*", "*" ], :string => [ "=", "~", "!", "!~", "!*", "*" ],
:text => [ "~", "!~", "!*", "*" ], :text => [ "~", "!~", "!*", "*" ],
:integer => [ "=", ">=", "<=", "><", "!*", "*" ], :integer => [ "=", ">=", "<=", "><", "!*", "*" ],
:integer_done => [ "=", ">=", "<=", "><", "!*", "*" ],
:float => [ "=", ">=", "<=", "><", "!*", "*" ], :float => [ "=", ">=", "<=", "><", "!*", "*" ],
:relation => ["=", "=p", "=!p", "!p", "!*", "*"] :relation => ["=", "=p", "=!p", "!p", "!*", "*"]
} }
@ -217,6 +218,8 @@ class Query < ActiveRecord::Base
case type_for(field) case type_for(field)
when :integer when :integer
add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^[+-]?\d+$/) } add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^[+-]?\d+$/) }
when :integer_done
add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^[+-]?\d+$/) || (v.match(/^[+-]?\d+$/) && (v.to_i<0 || v.to_i> 100)) }
when :float when :float
add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^[+-]?\d+(\.\d*)?$/) } add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^[+-]?\d+(\.\d*)?$/) }
when :date, :date_past when :date, :date_past
@ -602,6 +605,12 @@ class Query < ActiveRecord::Base
else else
sql = "#{db_table}.#{db_field} = #{value.first.to_i}" sql = "#{db_table}.#{db_field} = #{value.first.to_i}"
end end
when :integer_done
if is_custom_filter
sql = "(#{db_table}.#{db_field} <> '' AND CAST(CASE #{db_table}.#{db_field} WHEN '' THEN '0' ELSE #{db_table}.#{db_field} END AS decimal(30,3)) = #{value.first.to_i})"
else
sql = "#{db_table}.#{db_field} = #{value.first.to_i}"
end
when :float when :float
if is_custom_filter if is_custom_filter
sql = "(#{db_table}.#{db_field} <> '' AND CAST(CASE #{db_table}.#{db_field} WHEN '' THEN '0' ELSE #{db_table}.#{db_field} END AS decimal(30,3)) BETWEEN #{value.first.to_f - 1e-5} AND #{value.first.to_f + 1e-5})" sql = "(#{db_table}.#{db_field} <> '' AND CAST(CASE #{db_table}.#{db_field} WHEN '' THEN '0' ELSE #{db_table}.#{db_field} END AS decimal(30,3)) BETWEEN #{value.first.to_f - 1e-5} AND #{value.first.to_f + 1e-5})"

@ -0,0 +1,3 @@
class SeemsRateableRates < ActiveRecord::Base
attr_accessible :rater_id, :rateable_id, :rateable_type, :stars, :dimension, :is_teacher_score
end

@ -77,6 +77,13 @@ class User < Principal
has_many :homework_attaches, :through => :homework_users has_many :homework_attaches, :through => :homework_users
has_many :homework_evaluations has_many :homework_evaluations
#问卷相关关关系
has_many :poll_users, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy
has_many :poll, :dependent => :destroy #用户创建的问卷
has_many :answers, :source => :poll, :through => :poll_users, :dependent => :destroy #用户已经完成问答的问卷
# end
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)}, has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)} :after_remove => Proc.new {|user, group| group.user_removed(user)}
has_many :changesets, :dependent => :nullify has_many :changesets, :dependent => :nullify
@ -206,11 +213,11 @@ class User < Principal
pattern = "%#{arg.to_s.strip.downcase}%" pattern = "%#{arg.to_s.strip.downcase}%"
#where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) #where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern)
if type == "0" if type == "0"
where(" LOWER(login) LIKE :p ", :p => pattern) where(" LOWER(login) LIKE '#{pattern}' ")
elsif type == "1" elsif type == "1"
where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) where(" LOWER(concat(lastname, firstname)) LIKE '#{pattern}' ")
else else
where(" LOWER(mail) LIKE :p ", :p => pattern) where(" LOWER(mail) LIKE '#{pattern}' ")
end end
end end
} }

@ -175,7 +175,7 @@ class UsersService
"show_changesets" => true "show_changesets" => true
} }
scope = User.logged.status(@status) scope = User.logged.status(@status)
@search_by = params[:search_by] ? params[:search_by][:id] : 0 @search_by = params[:search_by] ? params[:search_by] : "0"
scope = scope.like(params[:name],@search_by) if params[:name].present? scope = scope.like(params[:name],@search_by) if params[:name].present?
scope scope
end end

@ -4,7 +4,7 @@
<title>注册帐号</title> <title>注册帐号</title>
<style type="text/css"> <style type="text/css">
#jihuo { #jihuo {
background-image: url("./images/jingtanhao.JPG"); background-image: url("/images/jingtanhao.JPG");
} }
</style> </style>
</head> </head>
@ -32,7 +32,9 @@
border: none; border: none;
padding: 10px 16px; padding: 10px 16px;
line-height: 1.33;" target="_blank">立即查收邮件</a></p> line-height: 1.33;" target="_blank">立即查收邮件</a>
&nbsp; &nbsp; <%= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :remote => true, :method => 'get' %>
</p>

@ -50,7 +50,7 @@
<h2>开启匿评功能</h2> <h2>开启匿评功能</h2>
<p> <p>
开启匿评后学生将不能对作业进行 开启匿评后学生将不能对作业进行
<span class="c_blue">提交、修改、删除</span> <span class="c_blue">修改、删除</span>
等操作,目前有 等操作,目前有
<span class="c_pink"><%= totle_size%>个</span> <span class="c_pink"><%= totle_size%>个</span>
学生,共提交了 学生,共提交了

@ -45,7 +45,7 @@
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td valign="top">
<strong> <strong>
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %> <%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
</strong> </strong>
@ -55,6 +55,8 @@
<span> <span>
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %> <%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
</span> </span>
</td>
<td style="width: 110px;">
<span style="float: right"> <span style="float: right">
<% if User.current.logged? && is_cur_course_student(@course) %> <% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %>
@ -124,14 +126,6 @@
</strong>) </strong>)
<% end %> <% end %>
</span> </span>
<span class="font_lighter">
<%= l(:label_students_responses) %>
(
<strong>
<%= bid.commit.nil? ? 0 : bid.commit %>
</strong>
)
</span>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -164,7 +158,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left"> <td style="text-align: left" colspan="2">
<span class="font_lighter"> <span class="font_lighter">
<%= l(:label_create_time) %> <%= l(:label_create_time) %>
:&nbsp; :&nbsp;
@ -184,7 +178,6 @@
<% end %> <% end %>
</span> </span>
</td> </td>
<td></td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>

@ -22,7 +22,7 @@
<%= error_messages_for 'bid' %> <%= error_messages_for 'bid' %>
<p> <p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onkeyup => "regexName();" %>
</p> </p>
<p> <p>
<span id="bid_name_span"></span> <span id="bid_name_span"></span>
@ -48,7 +48,7 @@
<span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span> <span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span>
</p> </p>
<p id="evaluation_num_p"> <p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onkeyup => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span> <span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span>
</p> </p>
<p> <p>

@ -59,7 +59,7 @@
:locals => {:homeworks => @homework_list, :locals => {:homeworks => @homework_list,
:homework_count => @obj_count, :homework_count => @obj_count,
:remote => false, :remote => false,
:is_student_batch_homework => @is_student_batch_homework}%> :not_batch_homework => @not_batch_homework,:is_student_batch_homework => @is_student_batch_homework}%>
</div> </div>
</div> </div>
</div> </div>

@ -1,10 +1,7 @@
<script type="text/javascript"> <script type="text/javascript">
function submitCoursesBoard() function submitCoursesBoard()
{ {
if(regexSubject()&&regexContent()) if(regexSubject()&&regexContent()){$("#message-form").submit();}
{
$("#message-form").submit();
}
} }
</script> </script>
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">

@ -7,7 +7,7 @@
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;} div,img,tr,td{ border:0;}
table,tr,td{border:0 cellspacing:0; cellpadding:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none} ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; } a{ text-decoration:none; }

@ -7,7 +7,7 @@
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;} body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;} div,img,tr,td{ border:0;}
table,tr,td{border:0 cellspacing:0; cellpadding:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none} ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; } .cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; } a{ text-decoration:none; }

@ -60,7 +60,7 @@
:size => 60, :size => 60,
:maxlength => 60, :maxlength => 60,
:style => "width:488px;", :style => "width:488px;",
:onblur => "regexTitle();" :onkeyup => "regexTitle();"
%> %>
</p> </p>
<span id="title_span" style="padding-left: 100px;"></span> <span id="title_span" style="padding-left: 100px;"></span>
@ -71,7 +71,7 @@
:rows => 11, :rows => 11,
:class => 'wiki-edit', :class => 'wiki-edit',
:style => "width:490px;", :style => "width:490px;",
:onblur => "regexDescription();" :onkeyup => "regexDescription();"
%> %>
</p> </p>
<span id="description_span" style="padding-left: 100px;"></span> <span id="description_span" style="padding-left: 100px;"></span>

@ -121,7 +121,7 @@
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => "regexName();" :onkeyup => "regexName();"
%> %>
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span> <span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
@ -143,7 +143,7 @@
:required => true, :required => true,
:size => 60, :size => 60,
:rows => 3, :rows => 3,
:onblur => 'regexDescription();', :onkeyup => 'regexDescription();',
:style => "width:320px; " :style => "width:320px; "
%> %>
<span style="font-size: 10px;" id="span_sofapplication_description">(<%= l(:label_work_description_lengthlimit) %>)</span> <span style="font-size: 10px;" id="span_sofapplication_description">(<%= l(:label_work_description_lengthlimit) %>)</span>
@ -162,7 +162,7 @@
:required => true, :required => true,
:size => 60, :size => 60,
:style => "width:320px;", :style => "width:320px;",
:onblur => 'regexDevelopers();' :onkeyup => 'regexDevelopers();'
%> %>
<span style="font-size: 10px; " id="span_softapplication_application_developers"> <span style="font-size: 10px; " id="span_softapplication_application_developers">

@ -1,5 +1,5 @@
<div class="top-content"> <div class="top-content">
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get, :id => 'contests_serch') do %>
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2"> <td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
@ -10,7 +10,7 @@
<td class="location-list"> <td class="location-list">
<strong><%= l(:label_user_location) %> :</strong> <strong><%= l(:label_user_location) %> :</strong>
</td> </td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged? %> <% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %> <% unless User.current.user_extensions.identity == 1 %>
<%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %>
@ -20,19 +20,41 @@
</td> </td>
<td rowspan="2" > <td rowspan="2" >
<div class="project-search" style="float: right"> <div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %> <script type="text/javascript">
function regexName1()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
$("#contest_name_span_head").css('color','#ff0000');
$("#contest_name_span_head").focus();
return false;
}
else
{
$("#contest_name_span_head").text("");
return true;
}
}
function submitSerch()
{
if(regexName1()){$("#contests_serch").submit();}
}
</script>
<%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();', :width => "125px" %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="padding-top: 7px !important;">
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span_head"></span>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px">
<a>
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
</td>
<td > <td >
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a> <a><%= l(:label_contest_innovate) %></a>
@ -43,14 +65,14 @@
<% end %> <% end %>
</div> </div>
<% if @contests.size > 0%> <% if @contests.size > 0%>
<%= sort_contest(@s_state)%> <%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>
<% elsif @is_search%> <% elsif @is_search%>
<%= render :partial => "layouts/no_content"%> <%= render :partial => "layouts/no_content"%>
<% else %> <% else %>
<%= sort_contest(@s_state)%> <%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>

@ -1,8 +1,10 @@
<div class="dis"> <div class="dis">
<div class="msg_box" id='leave-message'> <div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <%# reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3> <h3>
<%= l(:label_user_response) %>
</h3>
<% if !User.current.logged?%> <% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
@ -30,5 +32,7 @@
<div id="history"> <div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %> <%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div> </div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
</div> </div>

@ -1,17 +1,19 @@
<div class="cl"></div>
<ul> <ul>
<li class="classbox" id = "group_name_0" name="check_group_name"> <li class="classbox" id = "group_name_0" name="check_group_name">
<% course_member_count = l(:label_all) + " ( " + @membercount.to_s + "人)" %> <% course_member_count = l(:label_all) %>
<%= link_to course_member_count, searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('group_name_0')", method: 'get', remote: true,:style => " border:0px; color: #0d90c3; float:left;"%> <%= link_to course_member_count, searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('group_name_0')", method: 'get', remote: true,:style => " border:0px; color: #0d90c3; float:left;"%>
</li> </li>
<% if course_groups.any? %> <% if course_groups.any? %>
<% course_groups.each do |group| %> <% course_groups.each do |group| %>
<% group_display = group.name + " ( " + group.members.count.to_s + "人)" %> <% group_display = group.name %>
<% group_count = " ( " + group.members.count.to_s + "人)" %>
<li class="classbox" id="group_name_<%= group.id %>" name="check_group_name"> <li class="classbox" id="group_name_<%= group.id %>" name="check_group_name">
<%= link_to group_display, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true, <%= link_to group_display, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
:onclick => "checkclass('group_name_#{group.id}')",:style => " border:0px; color: #0d90c3; float:left;"%> :onclick => "checkclass('group_name_#{group.id}')"%>
<%= link_to group_count, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
:onclick => "checkclass('group_name_#{group.id}')", :style => "color: red;"%>
<% if @canShowCode && group.members.count == 0 %> <% if @canShowCode && group.members.count == 0 %>
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true, <%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
:data => {confirm: l(:label_delete_group)}, :data => {confirm: l(:label_delete_group)},
@ -20,7 +22,7 @@
%> %>
<% end %> <% end %>
<% if @canShowCode %> <% if @canShowCode %>
<a href="javascript:void(0)" class="f_l" onclick="$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a> <a href="javascript:void(0)" class="f_l" onclick="document.getElementById('group_name<%= group.id %>').value='';$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
<% end %> <% end %>
</li> </li>
<li> <li>
@ -36,7 +38,7 @@
<% end %> <% end %>
<% if @canShowCode %> <% if @canShowCode %>
<li style="margin-left:15px;"> <li style="margin-left:15px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#add_tag04').slideToggle();">+添加分班</a> <a href="javascript:void(0)" class="st_add f_l" onclick="document.getElementById('group_name').value='';$('#add_tag04').slideToggle();">+添加分班</a>
</li> </li>
<li> <li>
<span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l"> <span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
@ -44,7 +46,7 @@
<%= text_field_tag "group_name", params[:group_name], size: "20", class: "isTxt w90 f_l", style: "padding: 0px", maxlength: "100" %> <%= text_field_tag "group_name", params[:group_name], size: "20", class: "isTxt w90 f_l", style: "padding: 0px", maxlength: "100" %>
<%= submit_tag '', class: "submit f_l",:onclick => "validate_add_group()", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %> <%= submit_tag '', class: "submit f_l",:onclick => "validate_add_group()", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
<%= link_to_function '', "$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%> <%= link_to_function '', "document.getElementById('group_name').value='';$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%>
<% end %> <% end %>
</span> </span>

@ -5,18 +5,29 @@
<% if journals.size > 0 %> <% if journals.size > 0 %>
<% for journal in journals %> <% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'> <div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><a target="_blank" href="#"><%= image_tag(url_to_avatar(journal.user)) %></a></div> <div class="ping_dispic">
<a target="_blank" href="#">
<%= image_tag(url_to_avatar(journal.user)) %>
</a>
</div>
<div class="ping_discon" style="width: 85%;"> <div class="ping_discon" style="width: 85%;">
<div class="ping_distop"> <div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span> <span>
<%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
</span>
<span style="color:#a6a6a6; margin-right:40px; margin-left:30px;">
<%= format_time(journal.created_on) %>
</span>
<div class="cl"></div> <div class="cl"></div>
<p><%= textilizable journal.notes%></p> <p>
<%= textilizable journal.notes%>
</p>
</div> </div>
<div class="ping_disfoot"> <div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<span style="float: right"> <span style="float: right">
<% if journal.user == User.current|| User.current.admin? %> <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
<%= link_to(l(:label_bid_respond_delete), <%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
@ -43,7 +54,7 @@
<% end %> <% end %>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div> <div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %> <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

@ -24,7 +24,7 @@
<p> <p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;",
:maxlength => Bid::NAME_LENGTH_LIMIT, :maxlength => Bid::NAME_LENGTH_LIMIT,
:onblur => "regexName();" %> :onkeyup => "regexName();" %>
</p> </p>
<p> <p>
@ -53,7 +53,7 @@
<span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span> <span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span>
</p> </p>
<p id="evaluation_num_p"> <p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> <%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onkeyup => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span> <span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span>
</p> </p>
<p> <p>

@ -13,7 +13,7 @@
a{ text-decoration:none; } a{ text-decoration:none; }
a:hover{ } a:hover{ }
.alert_box {width:488px;height:550px;position:fixed;z-index:1002;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; }
#popbox{width:488px;height:308px;} #popbox{width:488px;height:308px;}
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; } .alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
.C_top{ margin-top:20px; width:368px; height:100px; background:#e9e9e9; padding:0px 60px; } .C_top{ margin-top:20px; width:368px; height:100px; background:#e9e9e9; padding:0px 60px; }
@ -21,7 +21,7 @@
.C_top p{ color:#a9aaaa; line-height:22px;} .C_top p{ color:#a9aaaa; line-height:22px;}
.C_form{ margin:20px 0 0 60px;} .C_form{ margin:20px 0 0 60px;}
.C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; } .C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; }
.C_form ul li input{ margin-left:30px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; } .C_form ul li input{ margin-left:20px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding: 0 !important; }
.C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:90px;} .C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:90px;}
.width190{ width:190px; height:26px; border-color:#e1e1e1;} .width190{ width:190px; height:26px; border-color:#e1e1e1;}
.C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;} .C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;}
@ -35,6 +35,11 @@
hideModal(obj); hideModal(obj);
$("#new-watcher-form").submit(); $("#new-watcher-form").submit();
} }
function hidden_join_course_form()
{
hideModal($("#popbox"));
}
</script> </script>
</head> </head>
@ -55,6 +60,7 @@
<li> <li>
<span class="tips">课&nbsp;程&nbsp;ID</span> <span class="tips">课&nbsp;程&nbsp;ID</span>
<input class=" width190" name="object_id" id="object_id" type="text" value="" > <input class=" width190" name="object_id" id="object_id" type="text" value="" >
<input type="text" style="display: none"/>
</li> </li>
<li class="mB5">课程ID是所在课程网址中显示的序号</li> <li class="mB5">课程ID是所在课程网址中显示的序号</li>
<li> <li>
@ -62,8 +68,12 @@
<input class=" width190" type="password" name="course_password" id="course_password" value="" > <input class=" width190" type="password" name="course_password" id="course_password" value="" >
</li> </li>
<li> <li>
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);"><%= l(:label_new_join) %></a> <a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);"><%= l(:button_cancel)%></a> <%= l(:label_new_join) %>
</a>
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);">
<%= l(:button_cancel)%>
</a>
</li> </li>
</ul> </ul>
<% end%> <% end%>

@ -1,4 +1,5 @@
<div style="margin-left: 15px">
<div style="margin-left: 15px" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %> <% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<% if !@canShowCode %> <% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %> <%= join_in_course_group(@course.course_groups,@group, User.current) %>
@ -8,50 +9,97 @@
<%= @group.name %> <%= @group.name %>
</span> </span>
<% end %> <% end %>
<% if @subPage_title && @subPage_title == l(:label_student_list)%>
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member_in_group), :name => "ingroup",:class => "f_2"%>
<% end %>
<%= submit_tag l(:label_search_member_in_course), :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if members.any? %> <% if members.any? %>
<% if @result_count %> <% if @result_count %>
<p style="font-size: 18px;"><%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %></p> <p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
</p>
<% end %> <% end %>
<% members.each do |member| %> <div class="cl"></div>
<div class="well"> <div class="st_box">
<% next if member.new_record? %> <ul class="st_box_top" style="margin-left: 17px;">
<% unless member.created_on.nil? %> <% if @subPage_title == l(:label_student_list) %>
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %> <li class="ml358"><%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<a id="pic" href="#" class= "st_down"></a>
<% else %>
<a id="pic" href="#" class= "st_up"></a>
<% end %> <% end %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :class => 'avatar')) %> </li>
<li class="ml50">
<a href="#" >加入时间</a>
</li>
<% else %>
<li class="ml50">
</li>
<li class="ml50" style="margin-left: 470px">
</li>
<li class="ml50" style="margin-left: 80%">
<a href="#" >加入时间</a>
</li>
<% end %>
</ul>
<div id="list_detail" style="margin-left: 17px">
<% members.each do |member| %>
<div class="cl"></div><!--st_box_top end-->
<div class="st_boxlist">
<a href="#" class="st_img" style="float:left;">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
</a>
<ul style="margin-left: 15px">
<% if @canShowCode %> <% if @canShowCode %>
<%= content_tag "div", link_to(member.user.show_name, user_path(member.user)), :class => "nomargin avatar_name" %> <li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li>
</br>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %> <% else %>
<%= content_tag "div", link_to(member.user.name, user_path(member.user)), :class => "nomargin avatar_name" %> <%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
<% end %> <% end %>
<!--teacher's code disapeared moified by huang--> <!--teacher's code disapeared moified by huang-->
<% if @canShowCode %> <% if @canShowCode %>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> <li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %>
<% end %> <% end %>
<div class ="clear avatar_name"> &nbsp; </ul>
<p> <% if @subPage_title == l(:label_student_list) %>
</p> <%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
</div> :action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red', :style => "color:red;" %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %>
<% end %>
<% else %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey", :style=>"margin-left:195px" %>
<% end %>
<% end %>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %> <%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div> </div>
<% end; reset_cycle %> <% end; reset_cycle %>
<div class="pagination"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %></div> </div>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count,:per_page_links => false, :remote =>@is_remote %>
</div>
<% else %> <% else %>
<p class="nodata"> <p class="nodata">
<%= l(:label_no_data) %> <%= l(:label_no_data) %>

@ -0,0 +1,48 @@
<% members.each do |member| %>
<div class="cl"></div><!--st_box_top end-->
<div class="st_boxlist">
<% next if member.new_record? %>
<a href="#" class="st_img" style="float:left;"> <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %></a>
<ul style="margin-left: 15px">
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentname) %> :
<%= link_to member.user.show_name, user_path(member.user) %>
</li> </br>
<%#= content_tag "li", "#{l(:label_bidding_user_studentname)}#{' : '}"link_to(member.user.show_name, user_path(member.user)) %>
<% else %>
<%= content_tag "li", link_to(member.user.name, user_path(member.user)) %>
<% end %>
<!--teacher's code disapeared moified by huang-->
<% if @canShowCode %>
<li>
<%= l(:label_bidding_user_studentcode) %> :
<%= link_to member.user.user_extensions.student_id, user_path(member.user) %>
</li>
<%#= content_tag "li", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :style=> "color:#1c9ec7;" %>
<% end %>
</ul>
<% if @subPage_title == l(:label_student_list) %>
<%= link_to format("%0.2f",member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red', :style => "color:red;" %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey" %>
<% end %>
<% else %>
<% unless member.created_on.nil? %>
<%= content_tag "span", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "ml65 c_grey", :style=>"margin-left:195px" %>
<% end %>
<% end %>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<% end; reset_cycle %>

@ -0,0 +1,12 @@
<% if @subPage_title && @subPage_title == l(:label_student_list)%>
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px; float: left;"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member), :name => "ingroup",:class => "f_2", :style => "float: left "%>
<% else %>
<%= submit_tag l(:label_search_member),:style => "float: left", :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<% end %>
<% end %>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
<% end %>

@ -0,0 +1,50 @@
<style>
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; text-align:center; }
a:hover{ text-decoration:underline;}
/**** 常用***/
.f_l{ float:left;}
.f_r{ float:right;}
.b_lblue{ background:#64bdd9;}
.b_dblue{ background:#55a1b9; cursor:pointer;}
.f_b{ font-weight: bold;}
.c_blue{ color:#64bdd9;}
.c_grey{ color:#999999;}
.c_grey02{ color:#666666;}
.f_14{ font-size:14px;}
.c_dblue{ color:#3e6d8e;}
.w90{width:90px;}
.ml10{margin-left:10px;}
.ml5{margin-left:5px;}
.b_grey{ background:#a3a3a3;}
.c_blue02{ color:#15bcce; font-weight: bold;}
.w280{ display:block; width:280px;float:left;}
.w70{ display:block;width:70px; text-align:center; float:left;}
.c_red{ color:#e50000;}
.c_blue03{ color:#0d90c4;}
/***弹框***/
#popbox_tscore{width:480px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
.tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.tscore_box{ width:350px; margin:15px auto;}
.tscore_box li{ height:25px;}
</style>
<div class="tscore_con">
<h2><%= @member_score.user.name %> 历次作业积分</h2>
<ul class="tscore_box">
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
<% @member_score.student_homework_score[0].each do |homework_score| %>
<li><span class="c_grey02 w280"><%= homework_score.name %></span><span class="c_red w70"><%= format("%0.2f",homework_score[:score].nil? ? 0 : homework_score[:score]) %></span></li>
<% end %>
<li><span class="c_blue03 w280">作业积分(总得分)</span><span class="c_red w70"><%= @member_score.student_homework_score[1] %></span></li>
</ul>
</div>

@ -1,3 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>');
showModal('ajax-modal', '510px'); showModal('ajax-modal', '510px');
$('#ajax-modal').css('height','330px'); $('#ajax-modal').css('height','330px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='#' onclick='hidden_join_course_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

@ -1,3 +1,22 @@
<script type="text/javascript">
function check_groupname() {
var $group_name = $('#group_name');
$.get(
'<%=valid_ajax_course_path%>',
{ valid: "name",
value: document.getElementById('group_name').value },
function (data) {
if (!data.valid) {
alert(data.message);
}
});
}
</script>
<script type=" text/javascript" charset="utf-8"> <script type=" text/javascript" charset="utf-8">
function validate_groupname(value1) { function validate_groupname(value1) {
@ -29,23 +48,25 @@
} }
function validate_add_group() { function validate_add_group() {
value1 = document.getElementById('group_name').value;
validate_groupname(value1); check_groupname();
validate_groupname_null(value1);
} }
</script> </script>
<%= stylesheet_link_tag 'course_group', :media => 'all' %> <%= stylesheet_link_tag 'course_group', :media => 'all' %>
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script> <script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
<div class="st_list"> <div class="st_list">
<div class="st_search"> <div class="st_search" style="margin-left: 14px" >
<span class="f_l"><%= @subPage_title %></span> <span class="f_l"><%= @subPage_title %></span>
<span id = "search_members">
<%= render :partial => 'searchmembers' %>
</span>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if @subPage_title == l(:label_student_list) %> <% if @subPage_title == l(:label_student_list) %>
<div class="st_addclass" id = "st_groups"> <div class="st_addclass" id = "st_groups">
<%= render :partial => 'groups_name', locals: {:course_groups => @course_groups} %> <%= render :partial => 'groups_name', :locals => {:course_groups => @course_groups} %>
</div> </div>
<% end %> <% end %>

@ -0,0 +1 @@
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @members})%>");

@ -0,0 +1,4 @@
/**
* Created by Administrator on 2014/12/3.
*/
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");

@ -13,7 +13,7 @@
<td class="location-list"> <td class="location-list">
<strong><%= l(:label_user_location) %> :</strong> <strong><%= l(:label_user_location) %> :</strong>
</td> </td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged?%> <% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %> <% if User.current.user_extensions.identity == 0 %>
<%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_course, nil, :global => true) %></td> <%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_course, nil, :global => true) %></td>

@ -1,4 +1,5 @@
/** /**
* Created by Administrator on 2014/12/3. * Created by Administrator on 2014/12/3.
*/ */
$("#search_members").html("<%= escape_javascript( render :partial => 'searchmembers')%>");
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>"); $("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");

@ -35,7 +35,7 @@
<tr> <tr>
<td colspan="2" width="580px"> <td colspan="2" width="580px">
<p class="info-break"> <p class="info-break">
<%= h(truncate(strip_tags(e.event_description).gsub(/&nbsp;/, ' '), length: 30, omission: '...')) %> <%= e.event_description %>
</p> </p>
</td> </td>
</tr> </tr>

@ -0,0 +1,3 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/show_member_score', :locals => {:member => @member_score}) %>');
showModal('ajax-modal', '400px');
$('#ajax-modal').addClass('new-watcher');

@ -19,7 +19,7 @@
<div class=" "> <div class=" ">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<% if is_course_teacher(User.current,@course) && file.author_id == User.current.id %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %> <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %> <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>

@ -2,22 +2,21 @@
<% attachmenttypes = @project.attachmenttypes %> <% attachmenttypes = @project.attachmenttypes %>
<% sufixtypes = @project.contenttypes %> <% sufixtypes = @project.contenttypes %>
<span class="borad-title"><%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span> <span class="borad-title">
<%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>
资源共享区
</span>
<div class="content-title-top"> <div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<div class="clearfix"></div> <div class="clearfix"></div>
<div id="file_buttons" class="nhidden"> <div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<p></p> <p></p>
<div id="upload_file_div" class="relation_file_div hidden"> <div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %> <%= render :partial => 'new', locals: {project: @project} %>
</div> </div>
<div id="relation_file_div" class="relation_file_div hidden"> <div id="relation_file_div" class="relation_file_div hidden">
<fieldset> <fieldset>
<legend>搜索</legend> <legend>搜索</legend>
@ -48,16 +47,23 @@
</div> </div>
<div class="box" id="files-box"> <div class="box" id="files-box">
<label for="files-box" style="font-weight:bold;">&nbsp;&nbsp;<%= l(:label_files_filter) %></label> <label for="files-box" style="font-weight:bold;">
&nbsp;&nbsp;
<%= l(:label_files_filter) %>
</label>
<% if attachmenttypes.any? %> <% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <label for="attachment_browse_label">
<%= l(:attachment_browse) %>
</label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
:onchange => "attachmenttypes_searchex(this.value)" %> :onchange => "attachmenttypes_searchex(this.value)" %>
<% end %> <% end %>
<% if sufixtypes.any? %> <% if sufixtypes.any? %>
&nbsp; &nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label> <label for="attach_sufix_browse_label">
<%= l(:attachment_sufix_browse) %>
</label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "attachment_contenttypes_searchex(this.value)" %> :onchange => "attachment_contenttypes_searchex(this.value)" %>
<% end %> <% end %>
@ -65,20 +71,14 @@
</div> </div>
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> <%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<div id="all_browse_div" class="all_browse_div"> <div id="all_browse_div" class="all_browse_div">
<%#= render :partial => 'show_all_attachment' %> <%#= render :partial => 'show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %> <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "show_all_attachment"%> <%= render partial: "show_all_attachment"%>
<%else%> <%else%>
<%= render partial: "sort_by_attachtypel"%> <%= render partial: "sort_by_attachtypel"%>
<%end%> <%end%>
</div> </div>

@ -1,6 +1,11 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;"> <div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con"> <div class="upload_con">
<h2>将此课件引入我的课程资源库</h2> <h2>将此课件引入我的课程资源库</h2>
<% if error == '403' %>
<div class="upload_box">
<div style="color: red;">您没有权限引用此资源</div>
</div>
<% else %>
<div class="upload_box"> <div class="upload_box">
<div id="error_show" style="color: red;"></div> <div id="error_show" style="color: red;"></div>
<%= form_tag course_attach_relations_path, <%= form_tag course_attach_relations_path,
@ -12,6 +17,8 @@
<a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a> <a id="submit_quote" href="javascript:void(0)" class="upload_btn" onclick="submit_quote();">引&nbsp;&nbsp;用</a><a href="javascript:void(0)" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end -%> <% end -%>
</div> </div>
<% end %>
</div> </div>
</div> </div>

@ -1,4 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file}) %>'); <% if @can_quote %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file,:error => ''}) %>');
<% else %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource',:locals => {:course => @course,:file => @file,:error => '403'}) %>');
<% end %>
showModal('ajax-modal', '513px'); showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>"); $('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");

@ -0,0 +1,6 @@
$(function(){
$("#button1").click(function(){
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
});
})

@ -69,7 +69,7 @@
<%= f.text_area 'user_message', :rows => 3, :cols => 65, <%= f.text_area 'user_message', :rows => 3, :cols => 65,
:value => "#{comprehensive_evaluation.nil? ? l(:label_leave_a_message) : comprehensive_evaluation}", :value => "#{comprehensive_evaluation.nil? ? l(:label_leave_a_message) : comprehensive_evaluation}",
:onfocus => "clearInfo('new_form_user_message','#{l(:label_leave_a_message)}')", :onfocus => "clearInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
:onblur => "showInfo('new_form_user_message','#{l(:label_leave_a_message)}')", :onkeyup => "showInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
:style => "resize: none;", :class => 'noline'%> :style => "resize: none;", :class => 'noline'%>
</td> </td>
</tr> </tr>

@ -1,7 +1,9 @@
<% is_teacher = is_course_teacher(User.current,@bid.courses.first) %> <% is_teacher = is_course_teacher(User.current,@bid.courses.first) %>
<% is_my_homework ||= false %> <% is_my_homework ||= false %>
<% is_student_batch_homework ||= false %> <% is_student_batch_homework ||= false %>
<% is_batch_homeworks ||= false %>
<% not_batch_homework ||= false %>
<% is_all_homeworks ||= false %>
<% unless is_my_homework || is_student_batch_homework %> <% unless is_my_homework || is_student_batch_homework %>
<div class="code_list"> <div class="code_list">
<span> <span>
@ -9,6 +11,9 @@
(<font color="#CC0000"> (<font color="#CC0000">
<%= homework_count%> <%= homework_count%>
</font>) </font>)
<%= link_to l(:label_export_excel), get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_batch_homeworks%>
<%= link_to l(:label_export_excel), get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if not_batch_homework%>
<%= link_to l(:label_export_excel), get_homeworks_homework_attach_index_path(:bid_id => @bid.id,:format => 'xls'),:class=>'xls' if is_all_homeworks%>
</span> </span>
<span class="fr"> <span class="fr">
按&nbsp; 按&nbsp;

@ -64,7 +64,7 @@
<span class="c_red">*</span> <span class="c_red">*</span>
&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();"%> <%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();"%>
<span id="homework_attach_name_span"></span> <span id="homework_attach_name_span"></span>
</p> </p>
<p> <p>

@ -1,4 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list', $('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>'); :locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true,:is_batch_homeworks => @is_batch_homeworks} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");} for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_2").removeClass().addClass("hovertab"); $("#tb_2").removeClass().addClass("hovertab");

@ -1,5 +1,5 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list', $('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>'); :locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true,:is_all_homeworks => @is_all_homeworks} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");} for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_3").removeClass().addClass("hovertab"); $("#tb_3").removeClass().addClass("hovertab");

@ -1,4 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list', $('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>'); :locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true,:not_batch_homework => @not_batch_homework} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");} for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_1").removeClass().addClass("hovertab"); $("#tb_1").removeClass().addClass("hovertab");

@ -68,7 +68,7 @@
</span> </span>
&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();" %> <%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();" %>
<span id="homework_attach_name_span"></span> <span id="homework_attach_name_span"></span>
</p> </p>
<p> <p>
@ -78,9 +78,12 @@
</span> </span>
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :placeholder => "最多3000个汉字", :onblur => "regexDescription();"%> <%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
<br />
<span id="homework_attach_description_span" style="padding-left: 100px;"></span> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
</p> </p>
<br/> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
</p>
<div class="cl"></div> <div class="cl"></div>
<p> <p>
<label style="float: left;"> <label style="float: left;">

@ -8,13 +8,6 @@
<div style=""> <div style="">
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> <li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals =>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
</span>
<% if issue.tracker_id == 1 %> <% if issue.tracker_id == 1 %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %> <%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %> <% end %>
@ -30,21 +23,29 @@
<ul class="issue_list"> <ul class="issue_list">
<% unless issue.author.nil? || issue.author.name == "Anonymous" %> <% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;"> <ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;width: 100%;">
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span> <!-- 在这里添加赞和踩-->
<%= l(:label_post_on)%> <% a = [] %> <span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals =>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
</span>
<span>
<%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %>
</span>
<%= l(:label_post_on)%>
<% a = [] %>
<% a << column_content[1] %> <% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %> <%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %> <% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%> <%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
</ul>
<% end -%>
<ul class="list-group-item-meta"> <ul class="list-group-item-meta">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"> <div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %> <%= textilizable issue, :description %>
</div> </div>
</ul> </ul>
<ul class="list-group-item-meta"> </ul>
<ul class="list-group-item-meta" style="margin-top: -15px;">
<% unless issue.assigned_to_id.nil? %> <% unless issue.assigned_to_id.nil? %>
<span> <span>
<%= l(:field_assigned_to)%>&nbsp; <%= l(:field_assigned_to)%>&nbsp;
@ -59,6 +60,7 @@
<%= l(:label_comments_count, :count => issue.journals.all.count) %> <%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div> </div>
</ul> </ul>
<% end -%>
</ul> </ul>
</li> </li>
</div> </div>

@ -0,0 +1,64 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>浮动倒计时公告</title>
<style type="text/css">
/*网页高度*/
body{ height:3000px;}
div,ul,li,body{margin:0; padding:0;}
/*position:absolute;用于元素的定位*/
#roll{ background:url(/images/f_notice.jpg) 0 0 no-repeat;width:140px; height:217px; position:absolute;}
.timemsg{ margin-left:26px; margin-top:114px;color:#c02b2b; font-size:16px; font-weight:bold;}
</style>
</head>
<body>
<div id="roll">
<div class="timemsg">
<!-- <span id="t_d">00:</span> -->
<span id="t_h">00:</span>
<span id="t_m">00:</span>
<span id="t_s">00</span>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function getRTime(){
var EndTime= new Date('2014/12/31 12:30:00'); //截止时间
var NowTime = new Date();
var t =EndTime.getTime() - NowTime.getTime();
// var d=Math.floor(t/1000/60/60/24);
var h=Math.floor(t/1000/60/60%24);
var m=Math.floor(t/1000/60%60);
var s=Math.floor(t/1000%60);
// document.getElementById("t_d").innerHTML = d + ":";
document.getElementById("t_h").innerHTML = h + ":";
document.getElementById("t_m").innerHTML = m + ":";
document.getElementById("t_s").innerHTML = s ;
}
setInterval(getRTime,1000);
</script>
<script>
var roll=document.getElementById('roll'),
initX=0,
initY,
compY,
sp=15,
//可调整时间间隔步进值不宜过大不然IE下有点闪屏
timeGap=5,
doc=document.documentElement,
docBody=document.body;
compY=initY=100;
roll.style.right=initX+"px";
;(function(){
var curScrollTop=(doc.scrollTop||docBody.scrollTop||0)-(doc.clientTop||docBody.clientTop||0);
//每次comP的值都不一样直到roll.style.top===doc.scrollTop+initY
compY+=(curScrollTop+initY-compY)/sp;
roll.style.top=Math.ceil(compY)+"px";
setTimeout(arguments.callee,timeGap);
})();
</script>

@ -0,0 +1,150 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>意见反馈浮窗</title>
<script>
function mypostion(o){
var width=$(window).width();
var height=$(window).height();
var divW=$(o).outerWidth();
var divH=$(o).outerHeight();
var left=(width-divW)/2+$(window).scrollLeft();
var top=(height-divH)/2+$(window).scrollTop();
return {"left":left,"top":top};
};
function myTips(msg,status){
if(status!="success" && status!="error"){status="error";};
if (status=="success") {
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_success" id="change_success"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_success");
$("#change_success").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_success").show();
setTimeout(function(){
$("#change_success,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_success").remove();
});
},2500);
}
else{
$("body").append('<div class="ui-mask" id="ui-mask"></div><div class="change_error" id="change_error"><!--span class="send_close" onclick="$(this).parent().remove();$("#ui-mask").remove();"></span--><i></i>'+msg+'</div>');
var my=mypostion("#change_error");
$("#change_error").css({"position":"absolute","z-index":"9999999","top":my.top+"px","left":my.left+"px"});
$("#ui-mask").show();
$("#change_error").show();
setTimeout(function(){
$("#change_error,#ui-mask").fadeOut("slow",function(){
$("#ui-mask").remove();
$("#change_error").remove();
});
},1000);
};
};
$(function(){
$("#button1").click(function(){
myTips("您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!","success");
});
})
function f_submit()
{
$("#new_memo").submit();
}
</script>
<style type="text/css">
/*浮窗*/
body{ height:3000px; font-family:'微软雅黑';}
div,ul,li,body,h3,p{margin:0; padding:0;}
a{ text-decoration:none;}
#roll{ background:url(/images/f_opnion.jpg) 0 0 no-repeat;width:157px; height:332px; position:absolute;}
.opnionBox{ width: 130px; height:146px; margin:76px auto 20px; }
.opnionText{ width: 120px !important; height:130px; outline:none; border:none !important;padding: 0 5px !important; color: #03a8bb;line-height:1.5; font-size:12px; }
a.opnionButton{ width:40px; height:20px; display:block; margin:0 auto;font-size:14px; color:#fd6e2a; font-weight: bold; }
a:hover.opnionButton{ text-decoration:underline;}
.opnionCall{ color:#03a8bb; font-size:12px; width:105px; margin:0 auto;}
.opnionCall .tectitle{ font-size:14px; alignment-adjust: central; color:#03a8bb; margin-bottom:8px,}
/*提示框*/
.ui-mask{background-color:#000;opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;_position:absolute;left:0;top:0;z-index:9999998;display:none;}
.change_success{
display:block;
height:60px;
width:300px;
line-height:1.9;
font-size:14px;
font-weight:500;
background:#fff;
color:#1395a4;
border:5px solid #1395a4;
font-size:14px;
padding:30px 20px;
position: absolute;
_position: absolute;
left:0;
top:0;
z-index:9999999;
}
</style>
</head>
<body>
<div id="roll">
<div class="opnionBox">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<div class="actions" style="max-width:680px">
<p>
<%= f.text_area :subject, :class => "opnionText",:placeholder => "有什么想说的,尽管来咆哮吧~~"%>
</p>
<p>
<%= f.hidden_field :content, :required => true ,:value=>'该贴来自用户反馈!'%>
</p>
<%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
<a href="javascript:void(0);" class="opnionButton" id="" onclick="f_submit();">提&nbsp;&nbsp;交</a>
<% end %>
</div>
</form>
<div class="clear"></div>
</div>
<div class="opnionCall">
<div class="tectitle">技术支持:</div>
<p ><%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/12/user_newfeedback">黄井泉</a><br>
<%= l(:label_course_adcolick) %><a href="http://user.trustie.net/users/34/user_newfeedback">白羽</a></p>
</div>
</div>
</body>
</html>
<script>
var roll=document.getElementById('roll'),
initX=0,
initY,
compY,
sp=15,
//可调整时间间隔步进值不宜过大不然IE下有点闪屏
timeGap=5,
doc=document.documentElement,
docBody=document.body;
compY=initY=100;
roll.style.right=initX+"px";
;(function(){
var curScrollTop=(doc.scrollTop||docBody.scrollTop||0)-(doc.clientTop||docBody.clientTop||0);
//每次comP的值都不一样直到roll.style.top===doc.scrollTop+initY
compY+=(curScrollTop+initY-compY)/sp;
roll.style.top=Math.ceil(compY)+"px";
setTimeout(arguments.callee,timeGap);
})();
</script>

@ -27,6 +27,7 @@
#@nav_dispaly_user_label = 1 #@nav_dispaly_user_label = 1
end end
%> %>
<%= render :partial => "layouts/base_feedback" %>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div class="welcome_logo"> <div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%> <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>

@ -17,7 +17,8 @@
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a> <a><%= l(:label_contest_innovate) %></a>
<span> <span>
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> <% contest = @softapplication.contests.first %>
<%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
</span> </span>
</td> </td>

@ -41,11 +41,14 @@
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> <%= form_tag({:controller => 'bids', :action => 'contest'}, :id => "contest_search_form",:method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', @bid.reward_type %> <%= hidden_field_tag 'reward_type', @bid.reward_type %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <a href="#" onclick="$('#contest_search_form').submit();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>

@ -2,6 +2,8 @@
@nav_dispaly_forum_label = 1 @nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil @nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1 %> @nav_dispaly_store_all_label = 1 %>
<% teacher_num = teacherCount(@course) %>
<% student_num = studentCount(@course) %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -24,7 +26,6 @@
</head> </head>
<!--add by huang--> <!--add by huang-->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<%= render :partial => 'courses/course_ad' %>
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
@ -46,9 +47,13 @@
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get) do %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= text_field_tag 'name', params[:name], :size => 20, :style => "float:left" %>
<a href="#" onclick="$('#course_search_form').submit();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<%#= submit_tag l(:label_search), :class => "ButtonColor m3p10", :name => nil, :style => "float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" %>
<% end %> <% end %>
</div> </div>
</td> </td>
@ -120,19 +125,19 @@
<td class="font_index"> <td class="font_index">
<!-- 1 教师; 2 学生0 全部--> <!-- 1 教师; 2 学生0 全部-->
<% if User.current.member_of_course?(@course) %> <% if User.current.member_of_course?(@course) %>
<%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %> <%= link_to "#{teacher_num}", course_member_path(@course, :role => 1), :course => '1' %>
<% else %> <% else %>
<span> <span>
<%= teacherCount(@course)%> <%= teacher_num %>
</span> </span>
<% end%> <% end%>
</td> </td>
<td class="font_index"> <td class="font_index">
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %> <% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %> <%= link_to "#{student_num}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %> <% else %>
<span> <span>
<%= studentCount(@course)%> <%= student_num %>
</span> </span>
<% end %> <% end %>
</td> </td>
@ -141,10 +146,10 @@
</td> </td>
<tr class="font_aram"> <tr class="font_aram">
<td align="center" width="80px" id="teacherCount"> <td align="center" width="80px" id="teacherCount">
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %> <%= l(:label_x_base_courses_teacher, :count => teacher_num) %>
</td> </td>
<td align="center" width="80px" id="studentCount"> <td align="center" width="80px" id="studentCount">
<%= l(:label_x_base_courses_student, :count => studentCount(@course)) %> <%= l(:label_x_base_courses_student, :count => student_num) %>
</td> </td>
<td align="center" width="80px"> <td align="center" width="80px">
<%= l(:label_x_course_data, :count => files_count) %> <%= l(:label_x_course_data, :count => files_count) %>
@ -285,7 +290,7 @@
<%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %> <%= link_to l(:label_course_file), course_files_path(@course), :class => link_class(:files) %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :course_id => @course}, :class => link_class(:news) %> <%= link_to l(:label_course_news), course_news_index_path(@course), :class => link_class(:news) %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_board), {:controller => 'boards', :action => 'index', :course_id => @course}, :class => link_class(:boards) %> <%= link_to l(:label_course_board), {:controller => 'boards', :action => 'index', :course_id => @course}, :class => link_class(:boards) %>

@ -25,7 +25,7 @@
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main" class=""> <div id="main" class="">
<div class="top-content"> <div class="top-content">
<table> <table style="font-size: 13px !important;">
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf" rowspan="2"> <td class="info_font" style="width: 240px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;"> <a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
@ -33,23 +33,56 @@
</a> </a>
</td> </td>
<td style="width: 430px; color: #15bccf"> <td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong> <strong>
<%= l(:label_user_location) %> :
</strong>
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <script type="text/javascript">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %> function regexName1()
<%= text_field_tag 'name', params[:name], :size => 20 %> {
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#contest_name_span_head").text("<%= l(:label_search_conditions_not_null) %>");
$("#contest_name_span_head").css('color','#ff0000');
$("#contest_name_span_head").focus();
return false;
}
else
{
$("#contest_name_span_head").text("");
return true;
}
}
function submitSerch()
{
if(regexName1()){$("#contst_search_form").submit();}
}
</script>
<div class="project-search" style="float: left; margin: 0px">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px", :style=>"float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span_head"></span>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><%=link_to l(:field_homepage), home_path %> > <td>
<a><%= l(:label_contest_innovate) %></a> > <%=link_to l(:field_homepage), home_path %> >
<a href="http://<%= Setting.host_contest %>" class="link_other_item">
<%=l(:label_contests_management_platform)%>
</a> >
<span title="<%= @contest.name%>"> <span title="<%= @contest.name%>">
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), contest_contestnotifications_path(@contest) %>
</span> </span>
</td> </td>
</tr> </tr>
@ -61,7 +94,7 @@
<div class="spaceleft"> <div class="spaceleft">
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr style="line-height: normal;">
<td align="left" width="100px"> <td align="left" width="100px">
<%= image_tag(url_to_avatar(@user), :class => "avatar2") %> <%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
</td> </td>
@ -109,7 +142,7 @@
<!-- 参与人和参与项目的数量显示 --> <!-- 参与人和参与项目的数量显示 -->
<div class="user_fans"> <div class="user_fans">
<table width="240" border="0"> <table width="240" border="0">
<tr align="center" width="80px"> <tr align="center" width="80px" style="line-height: normal;">
<!--关注人数--> <!--关注人数-->
<td class="font_index"> <td class="font_index">
<span id="watcher_count_span"> <span id="watcher_count_span">
@ -124,27 +157,27 @@
<%=link_to "#{@contest.contesting_softapplications.count}",show_attendingcontest_contest_path(@contest) %> <%=link_to "#{@contest.contesting_softapplications.count}",show_attendingcontest_contest_path(@contest) %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<tr class="font_aram"> <tr class="font_aram">
<td align="center" width="70px"> <%= l(:label_contest_watchers) %></td> <td align="center" width="70px">
<td align="center" width="70px"> <%= l(:label_contest_work) %></td> <%= l(:label_contest_watchers) %>
</td>
<td align="center" width="70px">
<%= l(:label_contest_work) %>
</td>
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="inf_user_context"> <div class="inf_user_context" style="line-height: normal;margin-top: 10px;">
<div class="font_title_left"> <div class="font_title_left">
<%= l(:label_project_overview) %> <%= l(:label_project_overview) %>
</div> </div>
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<% if @contest.description.size>0 %> <% if @contest.description.size>0 %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
<%= textilizable @contest.description %> <%= textilizable @contest.description %>
</div> </div>
<% else %> <% else %>
@ -177,7 +210,9 @@
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @contest.watcher_users.count) %></strong> <strong>
<%= l(:label_x_followers, :count => @contest.watcher_users.count) %>
</strong>
<% if show_more_fans?(@contest) %> <% if show_more_fans?(@contest) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), show_contest_user_contest_path(@contest) %></span> <span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), show_contest_user_contest_path(@contest) %></span>
<% end %> <% end %>
@ -206,9 +241,15 @@
<% if display_main_menu?(@contest) %> <% if display_main_menu?(@contest) %>
<div class="tabs_new"> <div class="tabs_new">
<ul> <ul>
<li><%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %></li> <li>
<li><%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %></li> <%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %>
<li><%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %></li> </li>
<li>
<%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %>
</li>
<li>
<%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %>
</li>
</ul> </ul>
</div> </div>
<% end %> <% end %>
@ -223,7 +264,9 @@
</div> </div>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span>
<%= l(:label_loading) %>
</span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>

@ -40,10 +40,38 @@
</td> </td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(projects_search_path, :method => :get) do %> <script type="text/javascript">
<%= text_field_tag 'name', params[:name], :size => 20 %> function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
}
else
{
$("#project_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#project_search_form").submit();}
}
</script>
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span"></span>
<% end %> <% end %>
</div> </div>
</td> </td>

@ -205,7 +205,7 @@
<td align="right"> <td align="right">
<%#= submit_tag l(:button_submit), :name => nil , <%#= submit_tag l(:button_submit), :name => nil ,
:class => "bid_btn" %> :class => "bid_btn" %>
<a href="#" onclick='$("#my_brief_introduction").parent().submit();' class="ButtonColor m3p10" > <a href="#" onclick='$("#my_brief_introduction").parent().submit();' class="ButtonColor m3p10" style="padding: 5px 10px;" >
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>
</td> </td>
@ -221,16 +221,16 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:'微软雅黑'" width="240"> <table style="font-family:'微软雅黑'" width="240">
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:label_user_joinin) %> <span style="float: right"> <%= l(:label_user_joinin) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= format_time(@user.created_on) %> <%= format_time(@user.created_on) %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 5px"> <td style=" float: right" width="70px">
<%= l(:label_user_login) %> <span style="float: right"> <%= l(:label_user_login) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px"> <td class="font_lighter_sidebar" style="padding-left: 0px">
<%= format_time(@user.last_login_on) %> <%= format_time(@user.last_login_on) %>
@ -239,8 +239,8 @@
<% unless @user.user_extensions.nil? %> <% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %> <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:field_occupation) %> <span style="float: right"><%= l(:field_occupation) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<% unless @user.user_extensions.school.nil? %> <% unless @user.user_extensions.school.nil? %>
@ -250,8 +250,8 @@
</tr> </tr>
<% elsif @user.user_extensions.identity == 3 %> <% elsif @user.user_extensions.identity == 3 %>
<tr> <tr>
<td style="padding-left: 5px" width="70px"> <td style=" float: right" width="70px">
<%= l(:field_occupation) %> <span style="float: right"> <%= l(:field_occupation) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.occupation %> <%= @user.user_extensions.occupation %>
@ -259,8 +259,8 @@
</tr> </tr>
<% elsif @user.user_extensions.identity == 2 %> <% elsif @user.user_extensions.identity == 2 %>
<tr> <tr>
<td style="padding-left: 18px" width="70px"> <td style=" float: right" width="70px">
<%= l(:label_company_name) %> <span style="float: right"> <%= l(:label_company_name) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.firstname %> <%= @user.firstname %>
@ -268,8 +268,8 @@
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
<td style="padding-left: 31px" width="76px"> <td style=" float: right" width="70px">
<%= l(:label_location) %> <span style="float: right"> <%= l(:label_location) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.location %> <%= @user.user_extensions.location %>
@ -278,8 +278,8 @@
</tr> </tr>
<tr> <tr>
<% if @user.user_extensions.identity == 0 %> <% if @user.user_extensions.identity == 0 %>
<td style="padding-left: 31px" width="76px" > <td style=" float: right" width="70px" >
<%= l(:label_technical_title) %> <span style="float: right"> <%= l(:label_technical_title) %></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<span id = "td_tech_title"></span> <span id = "td_tech_title"></span>
@ -289,8 +289,8 @@
<% if @user.user_extensions.identity == 1 %> <% if @user.user_extensions.identity == 1 %>
<% if(is_watching?(@user) ) %> <% if(is_watching?(@user) ) %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_bidding_user_studentcode)%> <span style="float: right"> <%= l(:label_bidding_user_studentcode)%></span>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.student_id %> <%= @user.user_extensions.student_id %>
@ -298,7 +298,7 @@
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_identity)%> <%= l(:label_identity)%>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
@ -309,7 +309,7 @@
<% end %> <% end %>
<% elsif @user.user_extensions.identity == 3 %> <% elsif @user.user_extensions.identity == 3 %>
<tr> <tr>
<td style="padding-left: 31px" width="70px" > <td style=" float: right" width="70px" >
<%= l(:label_identity)%> <%= l(:label_identity)%>
</td> </td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">

@ -30,7 +30,7 @@
<div id="content_"> <div id="content_">
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_course %>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<%=render :partial => 'layouts/base_footer'%> <%=render :partial => 'layouts/base_footer'%>
</div> </div>

@ -1,7 +1,8 @@
<% @nav_dispaly_course_all_label = 1 <% @nav_dispaly_home_path_label = 1
@nav_dispaly_forum_label = 1 @nav_dispaly_main_course_label = 1
@nav_dispaly_course_label = nil @nav_dispaly_main_project_label = 1
@nav_dispaly_store_all_label = 1 %> @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%= current_language %>"> <html lang="<%= current_language %>">
<head> <head>

@ -1,7 +1,7 @@
<% @nav_dispaly_home_path_label = 1 <% @nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1 @nav_dispaly_user_label = 1
@nav_dispaly_main_project_label = 1 @nav_dispaly_store_all_label = 1
@nav_dispaly_main_contest_label = 1 %> %>
<% @nav_dispaly_forum_label = 1%> <% @nav_dispaly_forum_label = 1%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%= current_language %>"> <html lang="<%= current_language %>">
@ -45,6 +45,6 @@
</div> </div>
</div> </div>
<!--<#%= call_hook :view_layouts_base_body_bottom %>--> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>

@ -49,7 +49,7 @@
<% if replying %> <% if replying %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
<% else %> <% else %>
<%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onblur: "regexSubject();" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject", onkeyup: "regexSubject();" }.merge(extra_option) %>
<% end %> <% end %>
<span id="subject_span"></span> <span id="subject_span"></span>
</p> </p>
@ -75,7 +75,7 @@
</p> </p>
<p> <p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();", :maxlength => 5000 %> <%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000 %>
<span id="message_content_span"></span> <span id="message_content_span"></span>
</p> </p>
<p> <p>

@ -15,7 +15,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form', <%= render :partial => 'form',
:locals => {:f => f, :replying => !@message.parent.nil?} %> :locals => {:f => f, :replying => !@message.parent.nil?} %>
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10"> <a href="#" onclick="if(regexSubject()&&regexContent()){$('#message-form').submit();}" class="ButtonColor m3p10">
<%= l(:button_save) %> <%= l(:button_save) %>
</a> </a>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %> <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>

@ -1,7 +1,15 @@
<% if @project %> <% if @project %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% elsif @course %> <% elsif @course %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% end %> <% end %>
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

@ -3,12 +3,24 @@
<%= is_new ? l(:bale_news_notice):l(:bale_edit_notice)%> <%= is_new ? l(:bale_news_notice):l(:bale_edit_notice)%>
</div> </div>
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:468px;", :onblur => "regexTitle();" %></p> <p>
<P><span id="title_notice_span">(60个字符以内)</span></P> <%= f.text_field :title, :required => true, :size => 60, :style => "width:468px;", :onkeyup => "regexTitle();", :maxlength => 60 %>
<!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> --> </p>
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:470px;", :onblur => "regexDescription();" %></p> <P>
<P><span id="description_notice_span"></span></P> <span id="title_notice_span">(60个字符以内)</span>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p> </P>
<p>
<%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:470px;", :onkeyup => "regexDescription();" %>
</p>
<P>
<span id="description_notice_span"></span>
</P>
<p id="attachments_form" style="margin-left:-10px;">
<label style="padding-right: 15px;">
<%= l(:label_attachment_plural) %>
</label>
<%= render :partial => 'attachments/form', :locals => {:container => @news} %>
</p>
</div> </div>
<%= wikitoolbar_for 'news_description'%> <%= wikitoolbar_for 'news_description'%>

@ -3,10 +3,10 @@
<%= @project ? l(:label_news_new) : l(:bale_news_notice) %> <%= @project ? l(:label_news_new) : l(:bale_news_notice) %>
</div> </div>
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onblur => "regexTitle();" %></p> <p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onkeyup => "regexTitle();" %></p>
<P><span id="title_notice_span">(60个字符以内)</span></P> <P><span id="title_notice_span">(60个字符以内)</span></P>
<!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> --> <!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;", :onblur => "regexDescription();" %></p> <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;", :onkeyup => "regexDescription();" %></p>
<P><span id="description_notice_span"></span></P> <P><span id="description_notice_span"></span></P>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p> <p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div> </div>

@ -1,3 +1,4 @@
<div class="member_header"> <div class="member_header">
<p> <p>
<%= @subPage_title %> <%= @subPage_title %>

@ -10,7 +10,7 @@
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged?%> <% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %> <% if User.current.user_extensions.identity == 0 %>
<%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td> <%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
@ -35,7 +35,7 @@
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td> <td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td> <td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2"> <td rowspan="2" valign="bottom">
<% if User.current.logged? %> <% if User.current.logged? %>
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %> <% end %>

@ -1,71 +0,0 @@
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= hubspot_head %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<% if @project %>
<h3 class="title"><%= l(:label_projects_score) %></h3>
<div class="inf_user_image">
<table style="border-bottom: solid 1px #80a6d2;" width="100%">
<tr>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td>
<table>
<tr class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><td><%= @project.name %></td>
</tr>
</table>
</td>
<td width="35%">
<table>
<tr class="info_font"><td><%= l(:label_projects_score) %></td></tr>
<tr class="buttons_for_score" style="margin-top:30px;margin-left:144px"><td><span style="color:#ec6300"><%= format("%.2f" , project_scores(@project) ).to_i %></span></td></tr>
</table>
</td>
</tr>
</table>
</div>
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_projects_score), {:controller => 'projects', :action => 'show_projects_score', :remote => true}%> :
<%= format("%.2f" , project_scores(@project) ).to_i %>
</li>
<li>
<%= link_to l(:label_issue_score), {:controller => 'projects', :action => 'issue_score_index', :remote => true}%> :
<%= format("%.2f" , issue_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_news_score), {:controller => 'projects', :action => 'news_score_index', :remote => true}%> :
<%= format("%.2f" , news_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_file_score), {:controller => 'projects', :action => 'file_score_index', :remote => true}%> :
<%= format("%.2f" , documents_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_code_submit_score), {:controller => 'projects', :action => 'code_submit_score_index', :remote => true}%> :
<%= format("%.2f" , changesets_score(@project)).to_i %>
</li>
<li>
<%= link_to l(:label_topic_score), {:controller => 'projects', :action => 'projects_topic_score_index', :remote => true}%> :
<%= format("%.2f" , board_message_score(@project)).to_i %>
</li>
</ul>
</div>
<div id="show_score_detail">
<%= render :partial => 'projects/project_score_index', :locals => {:index => 0,:project => @project } %>
</div>
<% end %>

@ -29,6 +29,7 @@
</p> </p>
<p> <p>
<%= f.text_field :login, :size => 30 %> <%= f.text_field :login, :size => 30 %>
<input type="text" hidden="hidden">
</p> </p>
<p> <p>
<%= f.password_field :password, :size => 30, :name => 'ignore', <%= f.password_field :password, :size => 30, :name => 'ignore',

@ -1,4 +1,5 @@
<%= render :partial => 'layouts/base_softapplication_top_content' %> <%= render :partial => 'layouts/base_softapplication_top_content' %>
<% html_title(@softapplication.name) -%>
<div style="height: auto; padding-bottom: 10px" class="softapplications-div"> <div style="height: auto; padding-bottom: 10px" class="softapplications-div">
<tr> <tr>
<td colspan="2" valign="top" width="320"> <td colspan="2" valign="top" width="320">
@ -15,7 +16,8 @@
<tr> <tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all"> <td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all">
<%=l(:label_attendingcontestwork_belongs_type)%> <%=l(:label_attendingcontestwork_belongs_type)%>
<%= @softapplication.app_type_name %></td> <%= @softapplication.app_type_name %>
</td>
<% contest = @softapplication.contests.first %> <% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all"> <td style="width: 240px; word-wrap: break-word; word-break: break-all">
<%=l(:label_attendingcontestwork_belongs_contest)%> <%=l(:label_attendingcontestwork_belongs_contest)%>
@ -34,21 +36,34 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"> <td style="padding-left: 40px">
<span><%=l(:label_attendingcontestwork_download)%></span>
<span> <span>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> <%=l(:label_attendingcontestwork_download)%>
</span>
<span>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %>
<%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
</span> </span>
</td> </td>
<td><%=l(:label_attendingcontestwork_developers)%><%= @softapplication.application_developers %></td> <td>
<%=l(:label_attendingcontestwork_developers)%>
<%= @softapplication.application_developers %>
</td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td> <td style="padding-left: 40px">
<td><%=l(:label_attendingcontestwork_release_time)%><%=format_time @softapplication.created_at %></td> <%=l(:label_attendingcontestwork_average_scores)%>:
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
</td>
<td>
<%=l(:label_attendingcontestwork_release_time)%>
<%=format_time @softapplication.created_at %>
</td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"> <td style="padding-left: 40px">
<% if @project %> <% if @softapplication.project %>
<%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %> <%=l(:label_attendingcontestwork_deposit_project)%>
<%= link_to "#{@softapplication.project}", project_path(@softapplication.project) %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
@ -60,18 +75,28 @@
<div style="height: auto; padding-bottom: 10px;word-break:break-all;word-wrap: break-word;"> <div style="height: auto; padding-bottom: 10px;word-break:break-all;word-wrap: break-word;">
<strong> <strong>
<div style="font-size: 15px;"><%=l(:label_work_description)%></div> <div style="font-size: 15px;">
<%=l(:label_work_description)%>
</div>
</strong> </strong>
<div style="padding-top: 5px"><%= @softapplication.description %></div> <div style="padding-top: 5px">
<%= @softapplication.description %>
</div>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
<div style="height: auto; padding-bottom: 10px"> <div style="height: auto; padding-bottom: 10px">
<div style="font-size: 15px;"><strong><%=l(:label_work_scores)%></strong></div> <div style="font-size: 15px;">
<strong>
<%=l(:label_work_scores)%>
</strong>
</div>
<!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> --> <!-- <div>打分总人数:<%= @softapplication.raters(:quality).count %></div> -->
<div style="overflow: hidden"> <div style="overflow: hidden">
<div style="margin-left: 15%; float: left"> <div style="margin-left: 15%; float: left">
<div style="padding-left: 45px; padding-bottom: 5px"><%=l(:label_work_scores_people)%></div> <div style="padding-left: 45px; padding-bottom: 5px">
<%=l(:label_work_scores_people)%>
</div>
<div> <div>
<% 100.step(20, -20) do |star| %> <% 100.step(20, -20) do |star| %>
<div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;"> <div data-kls="Softapplication" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled" style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
@ -85,15 +110,26 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<div style="float: left; padding-left: 100px; padding-top:35px " align="center"> <div style="float: left; padding-left: 100px; padding-top:35px ">
<div><%=l(:label_final_scores)%></div> <div>
<div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分</div> <%=l(:label_final_scores)%>
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div> </div>
<div style="padding-top: 1px; font-size: 15px; color: blue">
<%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分
</div>
<div>
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
</div>
</div> </div>
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center"> <div style="float: left; padding-left: 100px; padding-top:35px;" align="center">
<div><%=l(:label_rating_person_amount)%></div> <div>
<%=l(:label_rating_person_amount)%>
</div>
<div style="padding-top: 1px; font-size: 25px; color: blue;"> <div style="padding-top: 1px; font-size: 25px; color: blue;">
<strong><%= @softapplication.raters(:quality).count %></strong></div> <strong>
<%= @softapplication.raters(:quality).count %>
</strong>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -101,7 +137,9 @@
<div style="height: auto; padding-bottom: 10px"> <div style="height: auto; padding-bottom: 10px">
<strong> <strong>
<div style="font-size: 15px"><%=l(:label_work_photo)%></div> <div style="font-size: 15px">
<%=l(:label_work_photo)%>
</div>
</strong> </strong>
<div class="softapplication-img" > <div class="softapplication-img" >
@ -109,7 +147,9 @@
<% @image_results.take(4).each do |attachment| %> <% @image_results.take(4).each do |attachment| %>
<li> <li>
<div class="title"> <div class="title">
<a href="#"><%= attachment.filename.to_s -%></a> <a href="#">
<%= attachment.filename.to_s -%>
</a>
</div> </div>
<%= link_to_attachment_img attachment, :class => "soft-application", :download => "true"%> <%= link_to_attachment_img attachment, :class => "soft-application", :download => "true"%>
</li> </li>
@ -123,11 +163,18 @@
<div style="height: 50px"> <div style="height: 50px">
<div style="font-size: 15px"> <div style="font-size: 15px">
<strong><%=l(:label_work_comment)%></strong> <strong>
<%=l(:label_work_comment)%>
</strong>
</div> </div>
<% if (User.current.logged? and User.current.id != @softapplication.user_id) %> <% if (User.current.logged? and User.current.id != @softapplication.user_id) %>
<div style="padding-left: 210px"><%=l(:label_work_rating)%>: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %> <div style="padding-left: 210px">
<span style="font-size: 11px">(<%=l(:label_attendingcontestwork_sorting_intimation)%>)</span></div> <%=l(:label_work_rating)%>:
<%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
<span style="font-size: 11px">(
<%=l(:label_attendingcontestwork_sorting_intimation)%>)
</span>
</div>
<% end %> <% end %>
</div> </div>
<!--提示登录后对应用进行评价--> <!--提示登录后对应用进行评价-->

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

Loading…
Cancel
Save