Merge branch 'szzh' into api

Conflicts:
	app/controllers/account_controller.rb
	app/controllers/courses_controller.rb
	db/schema.rb
This commit is contained in:
= 2014-12-17 16:41:28 +08:00
commit bb23468c7d
122 changed files with 3392 additions and 3070 deletions

View File

@ -144,6 +144,36 @@ class AccountController < ApplicationController
end
end
#should_confirmation_password是否验证密码
def create_and_save_user login,password,email,password_confirmation,should_confirmation_password
@user = User.new
@user.admin = false
@user.register
@user.login = login
@user.mail = email
if should_confirmation_password && !password.blank? && !password_confirmation.blank?
@user.password,@user.password_confirmation = password,password_confirmation
elsif !should_confirmation_password && !password.blank?
@user.password = password
else
@user.password = ""
end
case Setting.self_registration
when '1'
register_by_email_activation(@user)
when '3'
register_automatically(@user)
else
register_manually_by_administrator(@user)
end
if @user.id != nil
ue = @user.user_extensions ||= UserExtensions.new
ue.user_id = @user.id
ue.save
end
@user
end
# Token based account activation
def activate
(redirect_to(home_url); return) unless Setting.self_registration? && params[:token].present?

View File

@ -309,7 +309,7 @@ class ApplicationController < ActionController::Base
# Find project of id params[:id]
def find_project
@project = Project.find_by_id(params[:id])
@project = Project.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end

View File

@ -87,8 +87,9 @@ class AttachmentsController < ApplicationController
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
elsif @attachment.container.class.to_s=="HomeworkAttach" && @attachment.container.bid.reward_type == 3
candown = true
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses
candown = User.current.member_of_course?(@attachment.container.courses.first) || (course.is_public == 1 && @attachment.is_public == 1)
elsif @attachment.container_type == "Bid" && @attachment.container && @attachment.container.courses.first
course = @attachment.container.courses.first
candown = User.current.member_of_course?(course) || (course.is_public == 1 && @attachment.is_public == 1)
else
candown = @attachment.is_public == 1
@ -204,7 +205,6 @@ class AttachmentsController < ApplicationController
@attachment.container.init_journal(User.current)
end
if @attachment.container
# Make sure association callbacks are called
@attachment.container.attachments.delete(@attachment)
else
@attachment.destroy
@ -351,8 +351,13 @@ class AttachmentsController < ApplicationController
courses.each do |course|
c = Course.find(course);
if course_contains_attachment?(c,file)
@message += l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed)
next
if @message && @message == ""
@message += l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed)
next
else
@message += "<br/>" + l(:label_course_prompt) + c.name + l(:label_contain_resource) + file.filename + l(:label_quote_resource_failed)
next
end
end
attach_copied_obj = file.copy
attach_copied_obj.tag_list.add(file.tag_list) # tag关联
@ -366,6 +371,7 @@ class AttachmentsController < ApplicationController
@obj = c
@save_flag = attach_copied_obj.save
@save_message = attach_copied_obj.errors.full_messages
update_quotes attach_copied_obj
end
respond_to do |format|
format.js
@ -378,6 +384,20 @@ class AttachmentsController < ApplicationController
end
end
def update_quotes attachment
if attachment.copy_from
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.copy_from} or id = #{attachment.copy_from}")
else
attachments = Attachment.find_by_sql("select * from attachments where copy_from = #{attachment.id} or id = #{attachment.copy_from}")
end
attachment.quotes = get_qute_number attachment
attachment.save
attachments.each do |att|
att.quotes = attachment.quotes
att.save
end
end
private
def find_project
@attachment = Attachment.find(params[:id])

View File

@ -842,7 +842,7 @@ class BidsController < ApplicationController
# 编辑作业
def edit
@bid = Bid.find(params[:bid_id])
if (User.current.admin?||User.current.id==@bid.author_id)
if (User.current.admin?||User.current.allowed_to?(:as_teacher,@bid.courses.first))
@course_id = params[:course_id]
respond_to do |format|
format.html {
@ -868,7 +868,7 @@ class BidsController < ApplicationController
@bid.reward_type = 3
@bid.deadline = params[:bid][:deadline]
@bid.budget = 0
@bid.author_id = User.current.id
#@bid.author_id = User.current.id
@bid.commit = 0
@bid.homework_type = 1
@bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
@ -884,6 +884,7 @@ class BidsController < ApplicationController
def new_submit_homework
#render html to prepare create submit homework
find_bid
find_bid
render :layout => 'base_homework'
end

View File

@ -39,13 +39,18 @@ class BoardsController < ApplicationController
end
render :layout => false if request.xhr?
elsif @course
@boards = @course.boards.includes(:last_message => :author).all
@boards = [] << @boards[0] if @boards.any?
if @boards.size == 1
@board = @boards.first
show and return
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@boards = @course.boards.includes(:last_message => :author).all
@boards = [] << @boards[0] if @boards.any?
if @boards.size == 1
@board = @boards.first
show and return
end
render :layout => 'base_courses'
else
render_403
end
render :layout => 'base_courses'
end
end

View File

@ -37,7 +37,7 @@ class ContestsController < ApplicationController
def index
render_404
render_404 unless params[:name]
# @contests = Contest.visible
# @contests ||= []
@offset, @limit = api_offset_and_limit(:limit => 10)
@ -188,10 +188,10 @@ class ContestsController < ApplicationController
# Added by Longjun
def destroy_contest
@contest = Contest.find(params[:id])
if @contest.author_id == User.current.id
if @contest.author_id == User.current.id || User.current.admin?
@contest.destroy
redirect_to action: 'index'
redirect_to welcome_contest_url
else
render_403 :message => :notice_not_contest_delete_authorized
end

View File

@ -84,6 +84,8 @@ class CoursesController < ApplicationController
end
end
def join_private_courses
respond_to do |format|
format.js
@ -150,62 +152,66 @@ class CoursesController < ApplicationController
# 课程搜索
# add by nwb
def search
#courses_all = Course.all_course
#name = params[:name]
courses_all = Course.all_course
name = params[:name]
#(redirect_to courses_url, :notice => l(:label_sumbit_empty);return) if name.blank?
#@courses = courses_all.visible
#if params[:name].present?
# @courses_all = @courses.like(params[:name])
#else
# @courses_all = @courses;
#end
cs = CoursesService.new
@courses_all = cs.search_course params
@course_count = @courses_all.count
@course_pages = Paginator.new @course_count, per_page_option, params['page']
# 课程的动态数
@course_activity_count=Hash.new
@courses_all.each do |course|
@course_activity_count[course.id]=0
end
case params[:course_sort_type]
when '0'
@courses = @courses_all.order("created_at desc")
@s_type = 0
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '1'
@courses = @courses_all.order("course_ac_para desc")
@s_type = 1
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '2'
@courses = @courses_all.order("watchers_count desc")
@s_type = 2
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '3'
@course_activity_count=get_course_activity @courses_all,@course_activity_count_array
@courses=handle_course @courses_all,@course_activity_count
@s_type = 3
@courses = @courses[@course_pages.offset, @course_pages.per_page]
if name.blank?
@courses = []
@courses_all = []
@course_count = 0
@course_pages = Paginator.new @course_count, per_page_option, params['page']
else
@courses = courses_all.visible
if params[:name].present?
@courses_all = @courses.like(params[:name])
else
@s_type = 0
@courses = @courses_all.order("created_at desc")
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@courses_all = @courses;
end
@course_count = @courses_all.count
@course_pages = Paginator.new @course_count, per_page_option, params['page']
@course_activity_count=get_course_activity @courses,@course_activity_count
# 课程的动态数
@course_activity_count=Hash.new
@courses_all.each do |course|
@course_activity_count[course.id]=0
end
case params[:course_sort_type]
when '0'
@courses = @courses_all.order("created_at desc")
@s_type = 0
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '1'
@courses = @courses_all.order("course_ac_para desc")
@s_type = 1
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '2'
@courses = @courses_all.order("watchers_count desc")
@s_type = 2
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
when '3'
@course_activity_count=get_course_activity @courses_all,@course_activity_count_array
@courses=handle_course @courses_all,@course_activity_count
@s_type = 3
@courses = @courses[@course_pages.offset, @course_pages.per_page]
else
@s_type = 0
@courses = @courses_all.order("created_at desc")
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses,@course_activity_count
end
end
respond_to do |format|
@ -228,11 +234,11 @@ class CoursesController < ApplicationController
end
end
def member
## 有角色参数的才是课程,没有的就是项目
def searchmembers
@subPage_title = l :label_student_list
@render_file = 'member_list'
#@teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
case params[:role]
when '1'
@subPage_title = l :label_teacher_list
@ -243,7 +249,18 @@ class CoursesController < ApplicationController
else
@subPage_title = ''
#@members = @course.member_principals.includes(:roles, :principal).all.sort
@is_remote = true
q = "#{params[:name].strip}"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:incourse]
@results = searchStudent_by_name(@course, q)
elsif params[:ingroup]
@group = CourseGroup.find(params[:search_group_id])
@results = searchgroupstudent_by_name(@group, @course, q)
end
@result_count = @results.count
@results = paginateHelper @results
cs = CoursesService.new
@members = cs.course_teacher_or_student_list(params,@course,User.current)
@members = paginateHelper @members
@ -255,6 +272,125 @@ class CoursesController < ApplicationController
end
end
def addgroups
@subPage_title = l :label_student_list
if params[:group_name]
group = CourseGroup.new
group.name = params[:group_name]
group.course_id = @course.id
group.save
end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups
end
def deletegroup
CourseGroup.delete(params[:group_id])
@subPage_title = l :label_student_list
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups
end
def updategroupname
@subPage_title = l :label_student_list
if params[:group_name]
group = CourseGroup.find(params[:group_id])
group.name = params[:group_name]
group.save
end
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@members = searchStudent(@course)
@membercount = @members.count
@course_groups = @course.course_groups
end
def join_group
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id])
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
member.course_group_id = group.id
member.save
@group = group
@members = searchStudent(@course)
@course_groups = @course.course_groups
@membercount = @members.count
search_group_members group
end
def unjoin_group
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id])
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
member.course_group_id = 0
member.save
@group = group
@course_groups = @course.course_groups
@members = searchStudent(@course)
@membercount = @members.count
search_group_members group
end
def searchgroupmembers
@subPage_title = l :label_student_list
@render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
if params[:group_id] && params[:group_id] != "0"
@group = CourseGroup.find(params[:group_id])
@results = searchStudent_by_group(@group, @course)
else
@results = searchStudent(@course)
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
def member
## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@render_file = 'member_list'
@teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@role = params[:role]
@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'
case params[:role]
when '1'
@subPage_title = l :label_teacher_list
@members = searchTeacherAndAssistant(@course)
when '2'
@subPage_title = l :label_student_list
@members = searchStudent(@course)
@membercount = @members.count
else
@subPage_title = ''
@members = @course.member_principals.includes(:roles, :principal).all.sort
end
@members = paginateHelper @members
render :layout => 'base_courses'
else
render_403
end
end
#判断指定用户是否为课程教师
def isCourseTeacher(id)
result = false
@ -546,7 +682,7 @@ class CoursesController < ApplicationController
end
def homework
if @course.is_public != 0 || User.current.member_of_course?(@course)
if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin?
@offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @course.homeworks.order('deadline DESC')
@bids = @bids.like(params[:name]) if params[:name].present?
@ -724,24 +860,29 @@ class CoursesController < ApplicationController
end
def feedback
page = params[:page]
# Find the page of the requested reply
@jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
if params[:r] && page.nil?
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
page = params[:page]
# Find the page of the requested reply
@jours = @course.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
if params[:r] && page.nil?
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
page = 1 + offset / @limit
end
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, page
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@state = false
respond_to do |format|
format.html{render :layout => 'base_courses'}
format.api
end
else
render_403
end
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, page
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@state = false
respond_to do |format|
format.html{render :layout => 'base_courses'}
format.api
end
end

View File

@ -45,37 +45,56 @@ class FilesController < ApplicationController
end
def search
sort = ""
@sort = ""
@order = ""
@is_remote = true
if params[:sort]
order_by = params[:sort].split(":")
@sort = order_by[0]
if order_by.count > 1
@order = order_by[1]
end
sort = "#{@sort} #{@order}"
end
begin
@is_remote = true
q = "%#{params[:name].strip}%"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:insite]
@result = find_public_attache q
@result = visable_attachemnts @result
@result = find_public_attache q,sort
@result = visable_attachemnts_insite @result,@course
@searched_attach = paginateHelper @result,10
else
@result = find_course_attache q,@course
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
@searched_attach = paginateHelper @result,10
end
rescue Exception => e
#render 'stores'
redirect_to stores_url
#rescue Exception => e
# #render 'stores'
# redirect_to search_course_files_url
end
end
def find_course_attache keywords,course
def find_course_attache keywords,course,sort = ""
if sort == ""
sort = "created_on DESC"
end
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%").
reorder("created_on DESC")
reorder(sort)
#resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
end
def find_public_attache keywords
def find_public_attache keywords,sort = ""
# StoresController#search 将每条文件都查出来,再次进行判断过滤。---> resultSet.to_a.map
# 此时内容不多速度还可但文件增长每条判断多则进行3-4次表连接。
# 现在还木有思路 药丸
resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%").
reorder("created_on DESC")
if sort == ""
sort = "created_on DESC"
end
resultSet = Attachment.where("attachments.container_type IS NOT NULL AND attachments.copy_from IS NULL AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort)
end
def index
@ -114,9 +133,9 @@ class FilesController < ApplicationController
end
if order_by.count == 1
sort += "#{Attachment.table_name}.#{attribute} asc "
sort += "#{Attachment.table_name}.#{attribute} asc " if attribute
elsif order_by.count == 2
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} " if attribute && order_by[1]
end
if sort_type != params[:sort].split(",").last
sort += ","
@ -152,16 +171,21 @@ class FilesController < ApplicationController
attribute = "downloads"
when "created_on"
attribute = "created_on"
when "quotes"
attribute = "quotes"
end
@sort = order_by[0]
@order = order_by[1]
if order_by.count == 1
if order_by.count == 1 && attribute
sort += "#{Attachment.table_name}.#{attribute} asc "
elsif order_by.count == 2
if sort_type != params[:sort].split(",").last
sort += ","
end
elsif order_by.count == 2 && order_by[1]
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
end
if sort_type != params[:sort].split(",").last
sort += ","
if sort_type != params[:sort].split(",").last
sort += ","
end
end
end
end
@ -372,14 +396,14 @@ class FilesController < ApplicationController
end
end
# show_attachments @containers
# @attachtype = params[:type].to_i
# @contenttype = params[:contentType].to_s
#
# respond_to do |format|
# format.js
# format.html
# end
show_attachments @containers
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
respond_to do |format|
format.js
format.html
end
end
end

View File

@ -22,23 +22,10 @@ class HomeworkAttachController < ApplicationController
#获取未批作业列表
def get_not_batch_homework
sort, direction = params[:sort] || "s_socre", params[:direction] || "desc"
if sort == 't_socre'
order_by = "t_score #{direction}"
elsif sort == 's_socre'
order_by = "s_score #{direction}"
elsif sort == 'time'
order_by = "created_at #{direction}"
end
teachers = find_course_teachers @course
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 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
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NULL")
get_not_batch_homework_list sort,direction,teachers, @bid.id
@cur_page = params[:page] || 1
@cur_type = 1
@homework_list = paginateHelper all_homework_list,10
@direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format|
format.js
@ -57,8 +44,8 @@ class HomeworkAttachController < ApplicationController
end
teachers = find_course_teachers @course
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 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 rater_id IN (#{teachers}) and stars IS NOT NULL) 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
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NOT NULL")
@ -83,8 +70,8 @@ class HomeworkAttachController < ApplicationController
end
teachers = find_course_teachers @course
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 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 rater_id in (#{teachers})) 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
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}")
@cur_page = params[:page] || 1
@ -101,8 +88,8 @@ class HomeworkAttachController < ApplicationController
@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.*,
(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 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 rater_id IN (#{teachers})) 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 stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score
FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
@ -120,15 +107,15 @@ class HomeworkAttachController < ApplicationController
@is_my_homework = true
teachers = find_course_teachers @course
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 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 rater_id IN (#{teachers})) 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
FROM homework_attaches
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_attaches.user_id = #{User.current.id}")
#如果我没有创建过作业,就检索我是否参与了某个作业
if all_homework_list.empty?
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 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 rater_id IN (#{teachers})) 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
FROM homework_attaches
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}")
@ -297,11 +284,6 @@ class HomeworkAttachController < ApplicationController
end
end
#获取指定作业的所有成员
def users_for_homework homework
homework.nil? ? [] : (homework.users + [homework.user])
end
#获取可选成员列表
#homework作业
#users该作业所有成员
@ -318,7 +300,8 @@ class HomeworkAttachController < ApplicationController
end
def edit
if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first)
bid = @homework.bid
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current.member_of_course?(bid.courses.first))
get_homework_member @homework
else
render_403 :message => :notice_not_authorized
@ -350,7 +333,8 @@ class HomeworkAttachController < ApplicationController
end
def destroy
if User.current.admin? || User.current == @homework.user
bid = @homework.bid
if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current == @homework.user)
if @homework.destroy
#respond_to do |format|
# format.html { redirect_to course_for_bid_url @homework.bid }
@ -370,48 +354,21 @@ class HomeworkAttachController < ApplicationController
#显示作业信息
def show
if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first)
# 打分统计
stars_reates = @homework. rates(:quality)
#是否已经进行过评价
temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{@homework.id} AND rater_id = #{User.current.id}").first
@m_score = temp.nil? ? 0:temp.stars
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
#@jours留言 is null条件用以兼容历史数据
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
if User.current.admin? || User.current.member_of_course?(@course)
# 作业打分列表
@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_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条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言
@cur_page = params[:cur_page] || 1
@cur_type = params[:cur_type] || 5
@jour = paginateHelper @jours,5
teachers = searchTeacherAndAssistant @course
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
is_student = is_cur_course_student @homework.bid.courses.first
is_teacher = is_course_teacher User.current,@homework.bid.courses.first
@is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评
if !User.current.member_of_course?(@homework.bid.courses.first)
@is_comprehensive_evaluation = 3 #留言
elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分
@is_comprehensive_evaluation = 2 #匿评
elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分
@is_comprehensive_evaluation = 2 #匿评
elsif is_student && !@is_anonymous_comments #是学生未开启匿评
@is_comprehensive_evaluation = 3 #留言
elsif is_teacher
@is_comprehensive_evaluation = 1 #教师评论
else
@is_comprehensive_evaluation = 3
end
respond_to do |format|
format.html
@ -424,30 +381,40 @@ class HomeworkAttachController < ApplicationController
#删除留言
def destroy_jour
@homework = HomeworkAttach.find(params[:jour_id])
@course=@homework.bid.courses.first
@homework = HomeworkAttach.find(params[:homework_id])
@journal_destroyed = JournalsForMessage.find(params[:object_id])
@is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation
@journal_destroyed.destroy
if @is_comprehensive_evaluation == 3
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
@jour = paginateHelper @jours,5
elsif @is_comprehensive_evaluation == 2
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
elsif @is_comprehensive_evaluation == 1
teachers = searchTeacherAndAssistant @course
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
if @journal_destroyed.is_comprehensive_evaluation == 3 && @journal_destroyed.destroy
render_403 unless User.current == @journal_destroyed.user || User.current.admin?
teachers = find_course_teachers(@homework.bid.courses.first)
@stars_reates = @homework.rates(:quality)
@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条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言
else
render_404
end
#@course=@homework.bid.courses.first
#@journal_destroyed = JournalsForMessage.find(params[:object_id])
#@is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation
#@journal_destroyed.destroy
#if @is_comprehensive_evaluation == 3
# @jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
# @jour = paginateHelper @jours,5
#elsif @is_comprehensive_evaluation == 2
# annymous_users = @homework.homework_evaluations.map { |homework_evaluation| homework_evaluation.user.id}.join(',')
# unless annymous_users.nil? || annymous_users.count == ""
# @anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in (#{annymous_users})").order("created_on DESC")
# end
#elsif @is_comprehensive_evaluation == 1
# teachers = searchTeacherAndAssistant @course
# @comprehensive_evaluation = []
# teachers.each do|teacher|
# temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
# @comprehensive_evaluation << temp if temp
# end
#end
respond_to do |format|
format.js
end
@ -455,55 +422,49 @@ class HomeworkAttachController < ApplicationController
#添加留言
def addjours
@homework = HomeworkAttach.find(params[:jour_id])
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
if @add_jour.is_comprehensive_evaluation == 3
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
@jour = paginateHelper @jours,5
elsif @add_jour.is_comprehensive_evaluation == 2
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
elsif @add_jour.is_comprehensive_evaluation == 1
teachers = searchTeacherAndAssistant @homework.bid.courses.first
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
@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
@homework = HomeworkAttach.find(params[:homework_id])
#保存评分
@homework.rate(@m_score.to_i,User.current.id,:quality) if @m_score
#保存评论
@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] != "" #有没有留言
@homework.addjours User.current.id, params[:new_form][:user_message],0,@is_comprehensive_evaluation
end
teachers = find_course_teachers(@homework.bid.courses.first)
@stars_reates = @homework.rates(:quality)
@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条件用以兼容历史数据
@jour = paginateHelper jours,5 #留言
#@limit = 10
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
#@jour = @jours[@offset, @limit]
#@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
if @cur_type == "1" #如果当前是老师未批列表,需要刷新整个作业列表界面
@bid = @homework.bid
get_not_batch_homework_list "s_socre","desc",teachers,@homework.bid_id
elsif @cur_type == "2" #老师已批列表
@result_homework = 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}) and stars IS NOT NULL) 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
FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "3" #全部作业列表
@result_homework = 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 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
FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "4" #匿评作业列表
@is_student_batch_homework = true
@result_homework = 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 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 stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id}) AS m_score
FROM homework_attaches
WHERE homework_attaches.id = #{@homework.id}").first
else #其他的不用管
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
stars_reates = @homework. rates(:quality)
is_student = is_cur_course_student @homework.bid.courses.first
is_teacher = is_course_teacher User.current,@homework.bid.courses.first
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
@is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评
if !User.current.member_of_course?(@homework.bid.courses.first)
@is_comprehensive_evaluation = 3 #留言
elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分
@is_comprehensive_evaluation = 2 #匿评
elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分
@is_comprehensive_evaluation = 3 #留言
elsif is_student && !@is_anonymous_comments #是学生未开启匿评
@is_comprehensive_evaluation = 3 #留言
elsif is_teacher
@is_comprehensive_evaluation = 1 #教师评论
else
@is_comprehensive_evaluation = 3
end
respond_to do |format|
format.js
end
@ -578,16 +539,7 @@ class HomeworkAttachController < ApplicationController
#获取课程的老师列表
def find_course_teachers course
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
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
teachers
searchTeacherAndAssistant(course).map{|teacher| teacher.user_id}.join(",")
end
#获取作业教师评分所占比例
@ -599,5 +551,27 @@ class HomeworkAttachController < ApplicationController
end
teacher_proportion
end
def get_not_batch_homework_list sort,direction,teachers,bid_id
if sort == 't_socre'
order_by = "t_score #{direction}"
elsif sort == 's_socre'
order_by = "s_score #{direction}"
elsif sort == 'time'
order_by = "created_at #{direction}"
end
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 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
FROM homework_attaches WHERE bid_id = #{bid_id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NULL")
@homework_list = paginateHelper all_homework_list,10
end
#获取指定作业的所有成员
def users_for_homework homework
homework.nil? ? [] : (homework.users + [homework.user])
end
end

View File

@ -217,6 +217,7 @@ class MembersController < ApplicationController
joined.each do |join|
join.delete
end
@member.course_group_id = 0
end
if role.allowed_to?(:is_manager)
@courseInfo = CourseInfos.new(:user_id => @member.user_id, :course_id => @course.id)

View File

@ -65,23 +65,27 @@ class NewsController < ApplicationController
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end
elsif @course
scope = @course ? @course.news.course_visible : News.course_visible
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
scope = @course ? @course.news.course_visible : News.course_visible
@news_count = scope.count
@news_pages = Paginator.new @news_count, @limit, params['page']
@offset ||= @news_pages.offset
@newss = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC",
:offset => @offset,
:limit => @limit)
@news_count = scope.count
@news_pages = Paginator.new @news_count, @limit, params['page']
@offset ||= @news_pages.offset
@newss = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC",
:offset => @offset,
:limit => @limit)
respond_to do |format|
format.html {
@news = News.new
render :layout => 'base_courses'
}
format.api
format.atom { render_feed(@newss, :title => (@course ? @course.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
respond_to do |format|
format.html {
@news = News.new
render :layout => 'base_courses'
}
format.api
format.atom { render_feed(@newss, :title => (@course ? @course.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end
else
render_403
end
end
end

View File

@ -58,7 +58,7 @@ class SchoolController < ApplicationController
options_s = ""
school.each do |s|
options_s << "<li style = 'width: 33%; float: left'><a id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
options_s << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
res = Hash.new
@ -78,7 +78,7 @@ class SchoolController < ApplicationController
@school.each do |s|
#options << "<option value=#{s.id}>#{s.name}</option>"
options << "<li style = 'width: 33%; float: left'><a id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
@ -91,7 +91,7 @@ class SchoolController < ApplicationController
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'><a id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
render :text => options
@ -105,7 +105,7 @@ class SchoolController < ApplicationController
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'> <a id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
options << "<li style = 'width: 33%; float: left'> <a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
options = "<div class='flash error' id='flash_error'>#{l(:label_school_not_fount)}</div>" if options.blank?

View File

@ -26,19 +26,19 @@ class StoresController < ApplicationController
resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%").
reorder("created_on DESC")
# result = resultSet.to_a.dup
result = resultSet.to_a.dup
# resultSet.to_a.map { |res|
# if(res.container.nil? ||
# (res.container.class.to_s=="Project" && res.container.is_public == false) ||
# (res.container.has_attribute?(:project) && res.container.project.is_public == false) ||
# (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) ||
# false
# )
# result.delete(res)
# end
# }
# result
resultSet.to_a.map { |res|
if(res.container.nil? ||
(res.container.class.to_s=="Project" && res.container.is_public == false) ||
(res.container.has_attribute?(:project) && res.container.project.is_public == false) ||
(res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) ||
false
) || (res.container.is_a?(Course) && res.container.is_public == 0)
result.delete(res)
end
}
result
end
LIMIT = 12 unless const_defined?(:LIMIT)

View File

@ -47,7 +47,6 @@ class WordsController < ApplicationController
# 删除留言功能要调用destroy也记得在destroy.js中修改
# deny api. api useless
@show_real_name = params[:show_real_name] || false
parent_id = params[:reference_id]
author_id = User.current.id
reply_user_id = params[:reference_user_id]
@ -256,7 +255,7 @@ class WordsController < ApplicationController
elsif referer.match(/course/)
obj = Course.find_by_id(obj_id)
else
raise "create reply obj unknow type.#{referer}"
#raise "create reply obj unknow type.#{referer}"
end
obj
end
@ -264,7 +263,8 @@ class WordsController < ApplicationController
def add_reply_adapter options
#modify by nwb
#添加对课程留言的支持
obj = obj_distinguish_url_origin
#留言回复应该不关系其所属的Class而关心的是其所属的父留言
obj = obj_distinguish_url_origin || User.find_by_id(2)
if obj.kind_of? User
obj.add_jour(nil, nil, nil, options)
elsif obj.kind_of? Project

View File

@ -44,7 +44,9 @@ class ZipdownController < ApplicationController
if homework != nil
unless homework.attachments.empty?
zipfile = zip_homework_by_user homework
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
send_file zipfile, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
"_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) +
"_" + homework.name + ".zip", :type => detect_content_type(zipfile) if(zipfile)
else
render file: 'public/no_file_found.html'
end
@ -78,7 +80,7 @@ class ZipdownController < ApplicationController
homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end
zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{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)
end
@ -99,9 +101,9 @@ class ZipdownController < ApplicationController
zipfile.add(rename_file, filename)
end
zipfile.get_output_stream('ReadMe') do |os|
os.write 'Homeworks'
end
#zipfile.get_output_stream('ReadMe') do |os|
# os.write 'Homeworks'
#end
end
zipfile_name
rescue Errno => e

View File

@ -251,7 +251,7 @@ module ApplicationHelper
end
def toggle_link(name, id, options={})
onclick = "$('##{id}').toggle(); "
onclick = "$('##{id}').slideToggle(); "
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
onclick << "return false;"
link_to(name, "#", :onclick => onclick)

View File

@ -69,13 +69,26 @@ module AttachmentsHelper
def course_contains_attachment? course,attachment
course.attachments.each do |att|
if att.id == attachment.id || att.copy_from == attachment.copy_from || att.copy_from = attachment.id || att.id == attachment.copy_from
if att.id == attachment.id || (!att.copy_from.nil? && !attachment.copy_from.nil? && att.copy_from == attachment.copy_from) || att.copy_from == attachment.id || att.id == attachment.copy_from
return true
end
end
false
end
def get_qute_number attachment
if attachment.copy_from
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.copy_from}")
else
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.id}")
end
if result.nil? || result.count <= 0
return 0
else
return result[0].number
end
end
private
def deletable? container, user=User.current

View File

@ -114,28 +114,13 @@ module CoursesHelper
# 学生人数计算
# add by nwb
def studentCount course
count = searchStudent(course).count#course.student.count
if count <= 5
result = count.to_s
elsif count < 10 && count > 5
result = "5+"
else
result = (count-count % 10).to_s + "+"
end
result
searchStudent(course).count.to_s#course.student.count
end
#课程成员数计算
def memberCount course
count = searchStudent(course).count + searchTeacherAndAssistant(course).count
if count <= 5
result = count.to_s
elsif count < 10 && count > 5
result = "5+"
else
result = (count-count % 10).to_s + "+"
end
result
count.to_s
end
def eventToLanguageCourse event_type, course
@ -170,7 +155,7 @@ module CoursesHelper
members
end
def searchStudent project
def search_student_in_group(project, course_group_id)
#searchPeopleByRoles(project, StudentRoles)
members = []
project.members.each do |m|
@ -178,6 +163,47 @@ module CoursesHelper
end
members
end
def searchStudent project
#searchPeopleByRoles(project, StudentRoles)
members = []
project.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_student,project)
end
members
end
def searchStudent_by_name project, name
#searchPeopleByRoles(project, StudentRoles)
members = []
project.members.each do |m|
if m && m.user && m.user.allowed_to?(:as_student,project)
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))
members << m
end
end
end
members
end
def searchgroupstudent_by_name(group, project, name)
members = []
group.members.each do |m|
if m && m.user && m.user.allowed_to?(:as_student,project)
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))
members << m
end
end
end
members
end
def searchStudent_by_group group, project
#searchPeopleByRoles(project, StudentRoles)
members = []
group.members.each do |m|
members << m if m && m.user && m.user.allowed_to?(:as_student,project)
end
members
end
# =====================================================================================
#def searchCountByRoles project, roles_id
@ -450,9 +476,9 @@ module CoursesHelper
end
#课程实践年份下拉框
def course_time_option
def course_time_option year
type = []
now_year = Time.now.year
now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year)
for i in (now_year..now_year + 10)
option = []
option << i

View File

@ -1,5 +1,6 @@
# encoding: utf-8
module FilesHelper
include AttachmentsHelper
def downloadAll containers
paths = []
@ -54,11 +55,11 @@ module FilesHelper
s.html_safe
end
#判断用户是否拥有课程,需用户在该课程中角色为教师
def has_course? user
#判断用户是否拥有不包含当前资源的课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期
def has_course? user,file
result = false
user.courses.each do |course|
if is_course_teacher(user,course)
if !course_contains_attachment?(course,file) && is_course_teacher(User.current,course) && course_in_current_or_next_term(course)
return true
end
end
@ -86,23 +87,68 @@ module FilesHelper
def visable_attachemnts attachments
result = []
attachments.each do |attachment|
if attachment.is_public? || attachment.author_id == User.current.id
if attachment.is_public? || (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
result << attachment
end
end
result
end
def get_qute_number attachment
if attachment.copy_from
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.copy_from}")
else
result = Attachment.find_by_sql("select count(*) as number from attachments where copy_from = #{attachment.id}")
end
if result.nil? || result.count <= 0
return 0
else
return result[0].number
def visable_attachemnts_incourse attachments
result = []
attachments.each do |attachment|
if attachment.is_public? || (attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
result << attachment
end
end
result
end
def visable_attachemnts_insite attachments,course
result = []
attachments.each do |attachment|
if attachment.is_public? || (attachment.container_type == "Course" && attachment.container_id == course.id && User.current.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
result << attachment
end
end
result
end
def attachment_candown attachment
candown = false
if attachment.container
if attachment.container.class.to_s != "HomeworkAttach" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
project = attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif attachment.container.is_a?(Project)
project = attachment.container
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board &&
attachment.container.board.project
project = attachment.container.board.project
candown = User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif (attachment.container.has_attribute?(:course) ||attachment.container.has_attribute?(:course_id) ) && attachment.container.course
course = attachment.container.course
candown = User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
elsif attachment.container.is_a?(Course)
course = attachment.container
candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board &&
attachment.container.board.course
course = attachment.container.board.course
candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
elsif attachment.container.class.to_s=="HomeworkAttach" && attachment.container.bid.reward_type == 3
candown = true
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
course = attachment.container.courses.first
candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1)
else
candown = (attachment.is_public == 1 || attachment.is_public == true)
end
end
candown
end
end

View File

@ -87,8 +87,13 @@ module HomeworkAttachHelper
#获取用户对作业的评分
def get_homework_score user, homework
seems_rateable_rate = HomeworkAttach.find_by_sql("SELECT * FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}")
seems_rateable_rate.nil? || seems_rateable_rate.count == 0 ? 0:seems_rateable_rate[0].stars
temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}").first
@m_score = temp.nil? ? 0:temp.stars.to_i
end
#获取评分对应的评论
def get_homework_review homework,is_teacher,user
homework.journals_for_messages.where("is_comprehensive_evaluation = #{is_teacher ? 1 : 2} and user_id = #{user.id}").order("created_on DESC").first
end
def convert_array array

View File

@ -156,11 +156,11 @@ module StoresHelper
klass = project.class.to_s
case klass
when "Project"
project_list = link_to l(:label_project_plural), projects_path
project_list = "<lable>#{l(:label_project_plural)}</lable>"
project_item = link_to project.to_s, project_path(project)
[project_list, project_item]
when "Course"
course_list = link_to l(:label_new_course), courses_path
course_list = "<lable>#{l(:label_new_course)}</lable>"
course_item = link_to project.name, course_path(project)
[course_list, course_item]
else

View File

@ -100,15 +100,45 @@ module WatchersHelper
return '' if user.id == course.tea_id
joined = user.member_of_course?(course)
text = joined ? l(:label_exit_course) : l(:label_new_join)
url_t = join_path(:object_id => course.id)
url_f = 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'
if joined
link_to text, url_t, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
else
link_to text, url_f, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
end
end
def join_in_course_group(coursegroups,group, user, options=[])
return '' unless user && user.logged?
@isjoin = false
coursegroups.each do |g|
g.members.each do |mem|
if mem.user_id == user.id
@isjoin = true
end
end
end
url_t = join_group_path(:object_id => group.id)
url_f = join_group_path(:object_id => group.id)
if @isjoin == true
joined = user.member_of_course_group?(group)
text = l(:label_exit_group)
if joined
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},
:remote => true, :method => 'delete',
:id => "#{group.id}", :style => "padding: 8px 8px 4px; ",
:confirm => l(:text_are_you_sure_out_group), :class => 'group_in'
end
else
text = l(:label_new_join_group)
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'post') do
submit_tag text, class: "group_in", style: "width: 43px;height: 21px;"
end
end
end
# 用户是否允许加入课程判断
# add by nwb
@ -125,7 +155,8 @@ module WatchersHelper
if joined
link_to text, url_t, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
else
link_to text, url_f, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
link_to text, url_f, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
end
end

View File

@ -7,7 +7,7 @@ class Course < ActiveRecord::Base
STATUS_ARCHIVED = 9
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
has_many :bid
@ -29,9 +29,11 @@ class Course < ActiveRecord::Base
has_many :news, :dependent => :destroy, :include => :author
has_one :course_status, :class_name => "CourseStatus", :dependent => :destroy
has_many :course_groups, :dependent => :destroy
acts_as_taggable
acts_as_nested_set :order => 'name', :dependent => :destroy
acts_as_attachable :view_permission => :view_files,
acts_as_attachable :view_permission => :view_course_files,
:delete_permission => :manage_files
validates_presence_of :password, :term,:name,:description

View File

@ -0,0 +1,22 @@
class CourseGroup < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :course
has_many :members
has_many :memberships, :class_name => 'Member'
has_many :member_principals, :class_name => 'Member',
:include => :principal,
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
has_many :principals, :through => :member_principals, :source => :principal
has_many :users, :through => :members
before_destroy :set_member_nil
attr_accessible :name
validates :name, :presence => true, :length => {:maximum => 20},
:uniqueness => {case_sensitive: false}
def set_member_nil
if self.members && self.members.count > 0
self.members.update_all("course_group_id = 0")
end
end
end

View File

@ -24,6 +24,7 @@ class Member < ActiveRecord::Base
belongs_to :project
belongs_to :course
belongs_to :course_group
validates_presence_of :principal
validates_uniqueness_of :user_id, :scope => [:project_id,:course_id]
validate :validate_role

View File

@ -26,10 +26,11 @@ class Principal < ActiveRecord::Base
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}", :order => "#{Project.table_name}.name"
has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :conditions => "#{Course.table_name}.status<>#{Course::STATUS_ARCHIVED}", :order => "#{Course.table_name}.name"
has_many :coursememberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :course, :roles ], :conditions => "#{Course.table_name}.status<>#{Course::STATUS_ARCHIVED}", :order => "#{Course.table_name}.name"
has_many :projects, :through => :memberships
#add by nwb
has_many :courses, :through => :coursememberships
has_many :course_groups, :through => :members
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
# Groups and active users

View File

@ -690,6 +690,9 @@ class User < Principal
courses.to_a.include?(course)
end
def member_of_course_group?(course_group)
course_groups.to_a.include?(course_group)
end
# Returns a hash of user's projects grouped by roles
def projects_by_role
return @projects_by_role if @projects_by_role

View File

@ -1,7 +1,7 @@
<% if !@save_flag && @save_message %>
$("#error_show").html("<%= @save_message.join(', ') %>");
<% elsif @message || @message != "" %>
$("#error_show").html("<%= @message %>");
<% elsif @message && @message != "" %>
$("#error_show").html("<%= @message.html_safe %>");
<% else %>
closeModal();
<% end %>

View File

@ -68,7 +68,7 @@
</span>
<% end %>
<% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %>
<% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%>
<span id="<%=bid.id %>_anonymous_comment" class="span_wping">
<% case bid.comment_status %>

View File

@ -58,53 +58,53 @@
{
hideModal($("#popbox"));
// 评了分的则刷新列表
switch (cur_type)
{
case 1:
$.ajax({
type: "GET",
url: "<%= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 2:
$.ajax({
type: "GET",
url: "<%= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 3:
$.ajax({
type: "GET",
url: "<%= get_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 4:
$.ajax({
type: "GET",
url: "<%= get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 5:
break;
default :
break;
}
// switch (cur_type)
// {
// case 1:
// $.ajax({
// type: "GET",
// url: "<%#= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 2:
// $.ajax({
// type: "GET",
// url: "<%#= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 3:
// $.ajax({
// type: "GET",
// url: "<%#= get_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 4:
// $.ajax({
// type: "GET",
// url: "<%#= get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
// data: 'text',
// success: function (data) {
//
// }
// });
// break;
// case 5:
// break;
// default :
// break;
// }
}
</script>
</div>

View File

@ -43,13 +43,13 @@
<p style="display: none">
<%= f.select :proportion, proportion_option %>
</p>
<p>
<p id="open_anonymous_evaluation_p">
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
<span>未开启匿评作业将直接进入众评点赞阶段</span>
<span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span>
</p>
<p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
<span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span>
</p>
<p>
<%= hidden_field_tag 'course_id', @course.id %>

View File

@ -22,7 +22,7 @@
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span id="jours_count" class="c_red f_12"><%= @jours_count %></span>)
</li>
<li style="padding-top: 5px;">
<li>
<%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
</li>
</ul>

View File

@ -2,8 +2,14 @@
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_contest_innovate) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
@ -20,8 +26,10 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/contest", :controller => 'bids', :action => 'index' %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a>
</td>
</tr>
</table>
<% end %>

View File

@ -91,16 +91,19 @@
}
});
});
$(function(){
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").show();
}
else
{
$("#evaluation_num_p").hide();
}
$("#bid_open_anonymous_evaluation").click(function(){
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").slideDown();
$("#open_anonymous_evaluation_span").slideUp();
}
else
{
$("#evaluation_num_p").slideUp();
$("#open_anonymous_evaluation_span").slideDown();
}
});
});
function submitHomework(id)
@ -118,6 +121,9 @@
<div class="box tabular">
<%#= render :partial => 'homework_form', :locals => { :f => f } %>
<%= render :partial => 'homework_form', :locals => { :f => f } %>
<input type="button" onclick="submitHomework(<%= @bid.id%>);" value="<%= l(:button_create)%>" class="enterprise">
<!--<input type="button" onclick="submitHomework(<%#= @bid.id%>);" value="<%#= l(:button_create)%>" class="enterprise">-->
<a href="#" onclick="submitHomework(<%= @bid.id%>);" class="ButtonColor m3p10" >
<%= l(:button_create)%>
</a>
<% end %>
</div>

View File

@ -19,8 +19,8 @@
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p>
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%= l(:button_submit)%>">-->
<a href="#" onclick="$('#message-form').submit();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
<!--<input type="button" onclick="submitCoursesBoard();" class = "ButtonColor m3p10 h30" value="<%#= l(:button_submit)%>">-->
<a href="#" onclick="submitCoursesBoard();"class="ButtonColor m3p10"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
</p>
<% end %>

View File

@ -2,8 +2,14 @@
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_contest_innovate) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
@ -29,7 +35,7 @@
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %>
<a><%= l(:label_contest_innovate) %></a>
<!-- end longjun -->
</td>
</tr>

View File

@ -38,12 +38,13 @@
<table>
<tr>
<td>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
<%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span>
</span>
<span class="info" style="width: 10px;">
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<span>&nbsp;<strong><%= l(:label_class_hour) %></strong></span>
<span>&nbsp;
<strong>
<%= l(:label_class_hour) %>
@ -98,7 +99,7 @@
</strong>
</td>
<td class="info" style="width: 10px">
<%= select_tag :time,options_for_select(course_time_option,@course.time), {} %>
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %>
</td>
<td class="info" style="width: 10px">
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>

View File

@ -14,11 +14,13 @@
<div style="width: 80%; margin-left:10%;">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%>
<%= f.text_area 'course_message', :rows => 3, :cols => 65,
<%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline',:maxlength => 250%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<!--<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>-->
<a href="#" onclick='$("#leave_meassge").parent().submit();' class="ButtonColor m3p10" style ="display: block; float: right; margin-right: 1%; margin-top: 1px;"> <%= l(:button_leave_meassge)%>
</a>
<% end %>
</div>
<% end %>

View File

@ -0,0 +1,56 @@
<ul>
<li class="classbox" id = "group_name_0" name="check_group_name">
<% course_member_count = l(:label_all) + " ( " + @membercount.to_s + "人)" %>
<%= 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>
<% if course_groups.any? %>
<% course_groups.each do |group| %>
<% group_display = group.name + " ( " + group.members.count.to_s + "人)" %>
<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,
:onclick => "checkclass('group_name_#{group.id}')",:style => " border:0px; color: #0d90c3; float:left;"%>
<% if @canShowCode && group.members.count == 0 %>
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
:data => {confirm: l(:label_delete_group)},
:class => 'f_1',
:style => "width: 16px;height: 21px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
%>
<% end %>
<% 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>
<% end %>
</li>
<li>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>
<span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
<%= text_field_tag "group_name#{group.id}", params[:group_name],:name => "group_name", :size=>10, :class=>"isTxt w90 f_l", :style=>"padding: 0px", :max => 20 %>
<!--<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>-->
<%= submit_tag '', class: "submit f_l", :onclick => "validate_update('group_name#{group.id}')", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
</span>
<% end %>
</li>
<% end %>
<% end %>
<% if @canShowCode %>
<li style="margin-left:15px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#add_tag04').slideToggle();">+添加分班</a>
</li>
<li>
<span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true) do %>
<%= 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;" %>
<%= link_to_function '', "$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%>
<% end %>
</span>
</li>
<% end %>
</ul>

View File

@ -48,13 +48,13 @@
<p style="display: none">
<%= f.select :proportion, proportion_option %>
</p>
<p>
<p id="open_anonymous_evaluation_p">
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %>
<span>未开启匿评作业将直接进入众评点赞阶段</span>
<span id='open_anonymous_evaluation_span' style="display: none">未开启匿评作业将直接进入众评点赞阶段</span>
</p>
<p id="evaluation_num_p">
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
<span id="bid_evaluation_num_span">即每份作业被允许匿评的人数</span>
</p>
<p>
<%= hidden_field_tag 'course_id', @course.id %>

View File

@ -1,4 +1,31 @@
<div style="margin-left: 15px">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<% if !@canShowCode %>
<%= join_in_course_group(@course.course_groups,@group, User.current) %>
<% end %>
<span style="font-size: 12px; float: left; margin-right: 5px">
<%= l(:label_current_group)%>:&nbsp;
<%= @group.name %>
</span>
<% 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 class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;"><%= l(:label_search_member_count) %><%= @result_count %><%= l(:label_member_people) %></p>
<% end %>
<% members.each do |member| %>
<div class="well">
<% next if member.new_record? %>

View File

@ -1,5 +1,5 @@
<% if object_id%>
$("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_course_for_list(course, user) %>');
$("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_course(course, user) %>');
<% end %>
<% if @state %>
<% if @state == 0 %>

View File

@ -0,0 +1 @@
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");

View File

@ -0,0 +1 @@
$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");

View File

@ -10,8 +10,14 @@
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_all) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
</a>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
<% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %>
@ -28,8 +34,12 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_all), :controller => 'courses', :action => 'index' %></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a href="http://<%= Setting.host_course%>" class="link_other_item">
<%=l(:label_courses_management_platform)%>
</a>
</td>
</tr>
</table>
<% end %>

View File

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

View File

@ -1,10 +1,59 @@
<div class="member_header">
<p>
<%= @subPage_title %>
</p>
</div>
<div class="member_content">
<%= error_messages_for 'member' %>
<%= render :partial => @render_file, :locals => {:members => @members} %>
<script type=" text/javascript" charset="utf-8">
function validate_groupname(value1) {
if(value1.length > 20) {
alert('<%= l(:label_limit_groupname) %>');
}
}
function checkclass(value) {
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
if(document.getElementsByName("check_group_name")[i].id == value) {
document.getElementById(value).className = "selected";
}
else {
document.getElementsByName("check_group_name")[i].className = "classbox";
}
}
}
function validate_groupname_null(value1) {
value1 = value1.trim();
if(value1.length == 0 ) {
alert('<%= l(:label_limit_groupname_null) %>');
}
}
function validate_update(name) {
value1 = document.getElementById(name).value;
validate_groupname(value1);
}
function validate_add_group() {
value1 = document.getElementById('group_name').value;
validate_groupname(value1);
validate_groupname_null(value1);
}
</script>
<%= 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>
<div class="st_list">
<div class="st_search">
<span class="f_l"><%= @subPage_title %></span>
</div>
<div class="cl"></div>
<% if @subPage_title == l(:label_student_list) %>
<div class="st_addclass" id = "st_groups">
<%= render :partial => 'groups_name', locals: {:course_groups => @course_groups} %>
</div>
<% end %>
<div class="cl"></div>
<div class="member_content" id = "member_content">
<%= error_messages_for 'member' %>
<%= render :partial => @render_file, :locals => {:members => @members} %>
</div>
</div>

View File

@ -84,10 +84,12 @@
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
{
$("#evaluation_num_p").slideDown();
$("#open_anonymous_evaluation_span").slideUp();
}
else
{
$("#evaluation_num_p").slideUp();
$("#open_anonymous_evaluation_span").slideDown();
}
});
});
@ -106,7 +108,8 @@
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
<div class="box tabular">
<%= render :partial => 'homework_form', :locals => { :f => f } %>
<input type="button" onclick="submitHomework();" value="<%= l(:button_create)%>" class="enterprise">
<!--<input type="button" onclick="submitHomework();" value="<%#= l(:button_create)%>" class="enterprise">-->
<a href="#" onclick="submitHomework();"class="ButtonColor m3p10"><%= l(:button_create)%></a>
<%= javascript_tag "$('#bid_name').focus();" %>
<% end %>
</div>

View File

@ -5,8 +5,14 @@
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
<table width="940px">
<tr>
<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="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
</a>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
<% if User.current.logged?%>
<% if User.current.user_extensions.identity == 0 %>
@ -22,8 +28,12 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host() + "/courses", :controller => 'courses', :action => 'index'%> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a href="http://<%= Setting.host_course%>" class="link_other_item">
<%=l(:label_courses_management_platform)%>
</a>
</td>
</tr>
</table>
<% end %>

View File

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

View File

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

View File

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

View File

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

View File

@ -4,55 +4,60 @@
<%= stylesheet_link_tag 'resource', :media => 'all' %>
<script>
function show_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
showModal('ajax-modal', '513px');
$('#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').parent().css("top","5").css("left","511");
}
function show_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
showModal('ajax-modal', '513px');
$('#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').parent().css("top","5").css("left","511");
}
function closeModal()
{
hideModal($("#popbox_upload"));
}
function closeModal()
{
hideModal($("#popbox_upload"));
}
function presscss(id)
{
if(id == "incourse")
{
$('#incourse').attr("class", "re_schbtn b_dblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
else
{
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_dblue");
}
}
function presscss(id)
{
if(id == "incourse")
{
$('#incourse').attr("class", "re_schbtn b_dblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
else
{
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_dblue");
}
}
function buttoncss()
{
$('#incourse').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
</script>
<div class="container">
<div class="resource"><!--资源库内容开始--->
<div class="re_top">
<div class="resource"><!--资源库内容开始--->
<div class="re_top">
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onclick => "presscss('incourse')"%>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onclick => "presscss('insite')" %>
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<% end %>
<% if is_course_teacher(User.current,@course) %>
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
<% end %>
</div><!---re_top end-->
<div class="cl"></div>
<% if is_course_teacher(User.current,@course) %>
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload()">上传资源</a>
<% end %>
</div><!---re_top end-->
<div class="cl"></div>
<div class="re_con" id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
</div><!---re_con end-->
<div class="re_con" id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
</div><!---re_con end-->
</div>
</div>
</div>
<% html_title(l(:label_attachment_plural)) -%>

View File

@ -2,16 +2,15 @@
<div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<!--<#% if @order == "asc" %>
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:desc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
<#%else%>
按&nbsp;<#%= link_to "时间",course_files_path(course,:sort=>"created_on:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<#%= link_to "下载次数",course_files_path(course,:sort=>"downloads:asc"),:class => "f_b c_grey" %><#%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<a href="#" class="f_b c_grey">引用次数</a>&nbsp;排序
<#% end %>-->
资源列表的多样化排序将在下周上线...
<% if order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% end %>
</p>
</div>
<div class="cl"></div>
@ -21,7 +20,7 @@
<%= 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 is_course_teacher(User.current,@course) && file.author_id == User.current.id %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %>
<%= 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" %>
<span id="is_public_<%= file.id %>">
@ -31,7 +30,7 @@
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
<% end %>
<% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current) %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %>
<% end %>
<% else %>
<% end %>
@ -41,7 +40,7 @@
<p class="f_l c_grey02 font">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= get_qute_number file %> </p>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">

View File

@ -8,7 +8,8 @@
<label style="margin-top:3px;">文件浏览:</label>
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
<div class="cl"></div>
<a id="submit_resource" href="javascript:void(0);" class="upload_btn" onclick="submit_resource();">上传资源</a><a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<a id="submit_resource" href="javascript:void(0);" class="upload_btn" onclick="submit_resource();">确&nbsp;&nbsp;认</a>
<a href="javascript:void(0);" class="upload_btn upload_btn_grey" onclick="closeModal();">取&nbsp;&nbsp;消</a>
<% end %>
</div>

View File

@ -1 +1 @@
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:"create_on",order:"",curse_attachments:@searched_attach})%>");
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");

View File

@ -1,35 +1,4 @@
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 60px;/*modified by ming*/
height: 25px;
line-height: 19px;
font-size: 14px;
color: rgb(0, 0, 0);
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].bid_btn {
width: 60px;/*modified by ming*/
height: 25px;
line-height: 19px;
font-size: 14px;
color: rgb(0, 0, 0);
background: buttonface;/*url("/images/button/bg103.jpg") no-repeat scroll left top transparent;*/
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
@ -50,32 +19,43 @@
}
}
function submit1(button)
function submit_jours(is_teacher)
{
$('#jours_submit').parent().submit();
if(!is_teacher&&$("#stars_value").val() == "0"){alert("您还没有打分");return;}
if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;}
$('#new_form_user_message').parent().submit();
}
</script>
<%= form_for('new_form', :remote => true, :method => :post,
:url => {:controller => 'homework_attach',
:action => 'addjours',
:jour_id => homework_attach.id,
:is_comprehensive_evaluation => is_comprehensive_evaluation,
:sta => sta}) do |f|%>
<div id = 'pre_show'>
<%= render :partial => 'words/pre_show', :locals => {:content => @content} %>
:homework_id => homework_attach.id,
:cur_page => cur_page,
:cur_type => cur_type,
:is_anonymous_comments => @is_anonymous_comments,
:is_teacher => @is_teacher
}) do |f|%>
<!-- 打分 -->
<div class="ping_star" id="star_score">
<% if @is_anonymous_comments || @is_teacher %>
<!-- 学生匿评或者教师评价 -->
<%= l(:label_work_rating) %>
<%= render :partial => 'show_star',:locals => {start_score:m_score} %>
<% end %>
</div>
<div class="cl"></div>
<!-- 打分js结束 -->
<% if User.current.logged? %>
<%= f.text_area 'user_message', :rows => 3, :cols => 65,
:style => "resize: none;", :class => 'noline', :placeholder => l(:text_caracters_maximum,:count=>250),
:maxlength => 250
%>
:maxlength => 250 %>
<%= f.text_field :reference_user_id, :style=>"display:none"%>
<div style="float:right">
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit1();"><%= l(:label_submit_comments) %></a>
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit_jours(<%= @is_teacher%>);">
<%= l(:label_confirmation) %>
</a>
</div>
<% else %>
<div style="font-size: 14px;margin:10px;text-align: center">

View File

@ -1,6 +1,6 @@
<% for attachment in attachments %>
<% if attachments.count > 1 && attachment != attachments.first%>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% if attachment.is_text? %>

View File

@ -1,25 +1,45 @@
<div class="ping_list">
<div id="ping_tb_" class="ping_tb_">
<ul>
<li id="ping_tb_4" class="ping_normaltab" onclick="i:HoverLi(4);">
<%= l(:label_teacher_comments) %><span class="c_red" id="jour_count_4"><%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %></span></li>
<li id="ping_tb_5" class="ping_normaltab" onclick="i:HoverLi(5);">
<%= l(:label_anonymous_comments) %><span class="c_red" id="jour_count_5" ><%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %></span></li>
<li id="ping_tb_3" class="ping_hovertab" onclick="x:HoverLi(3);">
<%= l(:label_responses) %><span class="c_red" id="jour_count_3"><%= @jours.nil? ? 0 : @jours.count %></span></li>
<li id="ping_tb_4" class="ping_normaltab" onclick="HoverLi(4);">
<%= l(:label_teacher_comments) %>
<span class="c_red" id="jour_count_4">
<%= @teacher_stars.count %>
</span>
</li>
<li id="ping_tb_5" class="ping_normaltab" onclick="HoverLi(5);">
<%= l(:label_anonymous_comments) %>
<span class="c_red" id="jour_count_5" >
<%= @student_stars.count %>
</span>
</li>
<li id="ping_tb_3" class="ping_hovertab" onclick="HoverLi(3);">
<%= l(:label_responses) %>
<span class="c_red" id="jour_count_3">
<%= @obj_count %>
</span>
</li>
</ul>
</div>
<div class="cl"></div>
<div class="ping_ctt">
<div class="ping_dis" id="tbc_03">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true} %>
<!-- 留言列表 -->
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @jour, :obj_pages => @obj_pages, :obj_count => @obj_count, :homework => @homework} %>
</div>
<div class="ping_undis" id="tbc_04">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false} %>
<!-- 老师评价列表 -->
<%= render :partial => 'homework_attach/review',:locals => {:review_list => @teacher_stars,:show_name => true,:show_jour => true} %>
</div>
<div class="ping_undis" id="tbc_05">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false} %>
<!-- 学生匿评列表 -->
<%= render :partial => 'homework_attach/review',:locals => {:review_list => @student_stars,:show_name => false || @is_teacher, :show_jour => false} %>
</div>
</div>
</div><!---ping_list end--->

View File

@ -1,4 +1,5 @@
<li class="pic_head">
<% bid = homework.bid%>
<li class="pic_head" style="line-height: 1.2;">
<% if is_student_batch_homework %>
<!-- 学生匿评 不现实姓名、头像,以及相关的连接 -->
<a><%= image_tag(url_to_avatar("匿名"), :width => "40", :height => "40")%></a>
@ -19,6 +20,10 @@
<% homework_filename = homework.name %>
<% end %>
<%= link_to homework_filename , homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type), :title => homework_filename, :remote => true%>
<span class="c_grey ">
提交时间:
<%= format_time homework.created_at%>
</span>
</li>
<li class="wdown">
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
@ -27,7 +32,7 @@
<% unless is_student_batch_homework %>
<%= l(:label_teacher_score)%>:
<span class="c_red">
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
<%= (homework.t_score.nil? || (homework.t_score && homework.t_score.to_i == 0)) ? l(:label_without_score) : format("%.2f",homework.t_score)%>
</span>
&nbsp;&nbsp;
<% end %>
@ -42,7 +47,7 @@
<!-- 是老师,所有列表正常显示 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<% if Time.parse(bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
@ -50,8 +55,8 @@
<!-- 是学生 -->
<% if is_my_homework %>
<!-- 我的作品,在未开启匿评和未使用匿评,显示为编辑和删除 -->
<% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %>
<li class="wmine" style="padding-top: 4px;">
<% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 %>
<li class="wmine">
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
<!-- 作业创建者显示删除作业 -->
@ -81,21 +86,21 @@
<% end %>
<% elsif is_student_batch_homework%>
<!-- 学生匿评列表 -->
<% if @bid.comment_status == 1 %>
<% if bid.comment_status == 1 %>
<!-- 处于开启匿评阶段,可以正常评分 -->
<li class="wping">
<%= link_to l(:label_anonymous_comments),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<% if Time.parse(bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% elsif @bid.comment_status == 2%>
<% elsif bid.comment_status == 2%>
<!-- 处于匿评已关闭阶段,不容许评分 -->
<li class="wping" title="关闭匿评后不可继续评分">
<a style="background:#8e8e8e;">
<%= l(:label_anonymous_comments) %>
</a>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<% if Time.parse(bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>

View File

@ -1,61 +1,50 @@
<% jours.nil? || jours.count == 0 || jours.each do |jour| %>
<div class="ping_C">
<div class="ping_dispic">
<% if show_name %>
<%= link_to image_tag(url_to_avatar(jour.user)) , user_path(jour.user), :target =>"_blank" %>
<% else %>
<a><%= image_tag(url_to_avatar(nil))%></a>
<% end %>
</div>
<div class="ping_discon">
<div class="ping_distop">
<span>
<% if show_name %>
<%= link_to jour.user, user_path(jour.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
<% else%>
<span style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;"><%= l(:label_anonymous) %></span>
<% end %>
</span>
<span style="color:#a6a6a6; margin-right:20px; margin-left:10px;"><%= format_time(jour.created_on) %></span>
<span style="font-weight:bold; color:#a6a6a6; ">
<% if show_score %>
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<%= render :partial => 'homework_attach/show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
<% end %>
</span>
<div class="cl"></div>
<p><%= textilizable jour.notes%></p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ jour.id.to_s%>
<span>
<% if (jour.user==User.current|| User.current.admin?) && show_name %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'homework_attach', :action => 'destroy_jour', :object_id => jour, :user_id => jour.user,:jour_id =>@homework.id },
<% unless jours.nil?%>
<% jours.each do |jour| %>
<div class="ping_C">
<div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(jour.user)) , user_path(jour.user), :target =>"_blank" %>
</div>
<div class="ping_discon">
<div class="ping_distop">
<span>
<%= link_to jour.user, user_path(jour.user),:style => " font-weight:bold; color:#15bccf; margin-right:5px; background:none;", :target => "_blank"%>
</span>
<span style="color:#a6a6a6; margin-right:30px; margin-left:10px;">
<%= format_time(jour.created_on) %>
</span>
<div class="cl"></div>
<p><%= textilizable jour.notes%></p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ jour.id.to_s%>
<span>
<% if jour.user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'homework_attach', :action => 'destroy_jour',
:object_id => jour,
:user_id => jour.user,
:homework_id =>homework.id },
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"} ##{l(:label_reply_plural)} #{jour.user.name}:
%>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"}
%>
</span>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => jour, :m_reply_id => jour,:show_name=> show_name} %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name, :show_real_name => true } %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<% end %>
<% if is_jour%>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => jour, :m_reply_id => jour,:show_name=> true} %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> true} %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<% end %>
<div class="dis">
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%></ul>
<ul class="wlist">
<%= pagination_links_full obj_pages, obj_count, :per_page_links => false, :remote => true, :flag => true%>
</ul>
</div>
<% end %>

View File

@ -1,4 +1,3 @@
<% show_real_name ||= false %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
@ -15,11 +14,7 @@
回复
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<% if show_real_name%>
<%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %>
<% else %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% end %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>

View File

@ -0,0 +1,63 @@
<!-- 评论列表,包括老师评论和学生匿评 -->
<% unless review_list.nil?%>
<% review_list.each do |review|%>
<% user = review.rater %>
<% jour = get_homework_review @homework,show_jour,user %>
<div class="ping_C">
<div class="ping_dispic">
<% if show_name %>
<%= link_to image_tag(url_to_avatar(user)) , user_path(user), :target =>"_blank" %>
<% else %>
<a><%= image_tag(url_to_avatar(nil))%></a>
<% end %>
</div>
<div class="ping_discon">
<div class="ping_distop">
<span>
<% if show_name %>
<%= link_to user, user_path(user),:style => " font-weight:bold; color:#15bccf; margin-right:5px; background:none;", :target => "_blank"%>
<% else%>
<span style=" font-weight:bold; color:#15bccf; margin-right:5px; background:none;">
<%= l(:label_anonymous) %>
</span>
<% end %>
</span>
<span style="color:#a6a6a6; margin-right:30px; margin-left:10px;">
<%= format_time(review.created_at) %>
</span>
<span style="font-weight:bold; color:#a6a6a6; float: right;">
<% if review.stars && review.stars.to_i > 0%>
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<div class="ping_star">
<%= render :partial => 'homework_attach/show_static_star', :locals => {:start_score => review.stars } %>
</div>
<% end %>
</span>
<div class="cl"></div>
<p><%= textilizable jour.nil? ? "" : jour.notes%></p>
</div>
<% unless jour.nil? %>
<% ids = 'project_respond_form_'+ jour.id.to_s%>
<div class="ping_disfoot">
<span>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), ''); $('##{ids} textarea') ;return false;"}
%>
</span>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => jour, :m_reply_id => jour,:show_name=> show_name} %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name} %>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<% end %>
<% end %>

View File

@ -1,59 +1,24 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
<script type="text/javascript" language="javascript">
var W3CDOM = document.createElement && document.getElementsByTagName;
// window.onload = setMaxLength;
$(document).ready(setMaxLength());
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
for (var i=0;i<textareas.length;i++) {
var textarea = textareas[i];
setMaxLengthItem(textareas[i]);
}
}
function setMaxLengthItem(textarea){
if (textarea.getAttribute('maxlength')) {
var counter = document.createElement('div');
counter.className = 'counter';
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
textarea.onkeyup = textarea.onchange = checkMaxLength;
textarea.onkeyup();
}
function g(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=3;i<=5;i++){g('ping_tb_'+i).className='ping_normaltab';g('tbc_0'+i).className='ping_undis';}g('tbc_0'+n).className='ping_dis';g('ping_tb_'+n).className='ping_hovertab';
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
function ChoseStars(num)
{
for (var i = num + 1; i <= 5; i++) {$("#star0" + i).css("background-position","-2px 0");}
for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");}
$("#stars_value").val(num);
}
function test(){alert('test');}
//<!CDATA[
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=3;i<=5;i++){g('ping_tb_'+i).className='ping_normaltab';g('tbc_0'+i).className='ping_undis';}g('tbc_0'+n).className='ping_dis';g('ping_tb_'+n).className='ping_hovertab';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]>
</script>
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<div id="popbox">
<div class="ping_con">
<h2><%= @homework.name %></h2>
<ul>
<li><%= l(:label_create_person) %>
<span class="c_grey">
<% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %>
<% if @is_anonymous_comments %>
<%= l(:label_anonymous) %>
<% else %>
<%= link_to @homework.user, user_path(@homework.user)%>
@ -61,16 +26,24 @@
</span>
</li>
<li style=" margin-left:130px;"><%= l(:label_activity_time) %><span class="c_grey" ><%=format_time @homework.created_at %></span></li>
<li style=" margin-left:130px;">
<%= l(:label_activity_time) %>
<span class="c_grey" >
<%=format_time @homework.created_at %>
</span>
</li>
</ul>
<div class="cl"></div>
<% if @homework.users.count > 0 %>
<div><%= l(:label_participation_person) %>
<% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %>
<div>
<%= l(:label_participation_person) %>
<% if @is_anonymous_comments %>
<%= l(:label_anonymous) %>
<%else%>
<% @homework.users.each do |homework_user| %>
<span class="c_grey"><%= link_to homework_user, user_path(homework_user)%></span>
<span class="c_grey">
<%= link_to homework_user, user_path(homework_user)%>
</span>
<% if @homework.users.count > 1 && homework_user != @homework.users.last %>
、&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
@ -84,30 +57,35 @@
<%= @homework.description %>
<% else %>
<div style="font-size: 15px;color: #15BCCC;vertical-align:middle;padding-top: 10px;padding-left: 10px ">
<strong><%= l(:label_homework_without_description) %></strong>
<strong>
<%= l(:label_homework_without_description) %>
</strong>
</div>
<% end %>
</p>
<p style=" border-bottom:none; color:#333; margin-top:8px;"><strong><%= l(:label_attachment) %>
<p style=" border-bottom:none; color:#333; margin-top:8px;">
<strong>
<%= l(:label_attachment) %>
</strong>
<span>
<% options = {:author => true } %>
<%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %>
<% if @homework.attachments.empty?%>
<span style="color: #999999">尚未提交附件</span>
<% else%>
<% options = {:author => true } %>
<%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %>
<% end%>
</span>
</p>
<div class="ping_star" id="star_score">
<%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation ,
:homework => @homework} %>
</div>
<div class="cl"></div>
<div id="add_jour">
<%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %>
<%= render :partial => 'addjour', :locals => {:homework_attach => @homework,
:m_score => @m_score,
:cur_page => @cur_page,
:cur_type => @cur_type,
:is_teacher => @is_teacher} %>
</div>
<div class="cl"></div>
</div><!---ping_con end--->
<%= render :partial => 'histoey_new' %>
</div>
</div>

View File

@ -1,16 +1,6 @@
<% if is_comprehensive_evaluation == 3 || User.current == homework.user%>
<!-- <#%= l(:label_work_rating) %>
<%#= render :partial => 'show_score', locals: {:stars => totle_score} %> -->
<% elsif is_comprehensive_evaluation == 2 %>
<% if has_evaluation %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %>
<% else %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
<% end %>
<% elsif @is_comprehensive_evaluation == 1%>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %>
<% end %>
<span><a href="#" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star02" onclick="ChoseStars(2)" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star01" onclick="ChoseStars(1)" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
<input type="hidden" value="<%= start_score%>" id="stars_value" name="stars_value"/>

View File

@ -0,0 +1,5 @@
<span><a href="#" id="star05" style="background-position:<%= start_score>=1 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star04" style="background-position:<%= start_score>=2 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star03" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star02" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="#" id="star01" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>

View File

@ -1,7 +1,7 @@
<% if @save_succ %>
var pre_append = $('<%= j(
render :partial => "journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm, :show_real_name => true}
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);

View File

@ -1,19 +1,31 @@
//教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %>
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
<% if @is_teacher %>
HoverLi(4);
$('#jour_count_4').html('<%= @teacher_stars.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/review',:locals => {:review_list => @teacher_stars,:show_name => true,:show_jour => true})) %>');
//匿评
<% elsif @add_jour.is_comprehensive_evaluation == 2 %>
$('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>');
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
<% elsif @is_anonymous_comments %>
HoverLi(5);
$('#jour_count_5').html('<%= @student_stars.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/review',:locals => {:review_list => @student_stars,:show_name => false || @is_teacher, :show_jour => false})) %>');
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
HoverLi(3);
$('#jour_count_3').html('<%= @obj_count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour, :obj_pages => @obj_pages, :obj_count => @obj_count,:homework => @homework})) %>');
<% end %>
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");
$('#new_form_reference_user_id').val("");
<% if @is_anonymous_comments || @is_teacher %>
<% if @cur_type == "1" %>
$("#tbc_01").html('<%= escape_javascript(render(:partial => 'homework_attach/homeworks_list',:locals => {:homeworks => @homework_list,
:homework_count => @obj_count,
:remote => false,:is_student_batch_homework => false})) %>');
<% elsif @cur_type == "2" || @cur_type == "3" || @cur_type == "4" %>
$("#homework_li_<%= @homework.id%>").html('<%= escape_javascript(render(:partial => 'homework_attach/homework',:locals => {:homework => @result_homework || @homework,
:is_student_batch_homework => @is_student_batch_homework || false,
:is_my_homework => false, :is_teacher => @is_teacher})) %>');
<% end %>
<% end %>

View File

@ -1,19 +1,8 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% else %>
<% if @is_comprehensive_evaluation == 1 %>
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>');
//匿评
<% elsif @is_comprehensive_evaluation == 2 %>
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>');
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>');
<% end %>
//只有留言才能被删除
HoverLi(3);
$('#jour_count_3').html('<%= @obj_count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => "homework_attach/jour",:locals => {:jours => @jour, :obj_pages => @obj_pages, :obj_count => @obj_count, :homework => @homework})) %>');
<% end %>

View File

@ -41,13 +41,13 @@
<div class="Newwork">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onclick="switchTab(1);this.blur();return false;" style="width: auto; padding:10px 10px 0;">
<li id="tb_1" class="hovertab" onclick="switchTab(1);this.blur();return false;" style="width: auto; padding:5px 10px 0;">
修改作业
</li>
<li id="tb_2" class="normaltab" onclick="switchTab(2);this.blur();return false;">
成员
</li>
<li class="N_top" style="width: 747px;line-height: 1.9;">
<li class="N_top" style="width: 747px;">
<%= link_to(l(:label_project_new), {:controller => 'projects',
:action => 'new',
:course => 0,
@ -60,22 +60,26 @@
<div class="N_con">
<%= form_for(@homework) do |f|%>
<p>
<label><span class="c_red">*</span>&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<label>
<span class="c_red">*</span>
&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();"%>
<span id="homework_attach_name_span"></span>
</p>
<p>
<label style="float:left;padding-left:10px;">
<span class="c_red"></span>
&nbsp;&nbsp;作业描述&nbsp;&nbsp;&nbsp;&nbsp;
<label style="float:left;">
<span class="c_red">*</span>
&nbsp;&nbsp;作业描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p>
<div class="cl"></div>
<p>
<label style="float: left;">&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%#= render :partial => 'attachments/form' %>
<label style="float: left;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<% unless @homework.attachments.empty?%>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<% options = {:author => true, :deletable => attach_delete(@homework)} %>

View File

@ -41,10 +41,10 @@
<div class="Newwork">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);" style="width: auto; padding:10px 10px 0;">
<li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);" style="width: auto; padding:5px 10px 0;">
创建作品
</li>
<li class="N_top" style="width: 835px;line-height: 1.9;">
<li class="N_top" style="width: 835px;">
<%= link_to(l(:label_project_new), {:controller => 'projects',
:action => 'new',
:course => 0,
@ -72,19 +72,20 @@
<span id="homework_attach_name_span"></span>
</p>
<p>
<label style="float:left;padding-right: 3px;">
<label style="float:left;">
<span class="c_red">
*
</span>
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;作品描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :placeholder => "最多3000个汉字", :onblur => "regexDescription();"%>
<span id="homework_attach_description_span" style="padding-left: 100px;"></span>
</p>
<div class="cl"></div>
<p>
<label style="float: left;">&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%#= render :partial => 'attachments/form' %>
<label style="float: left;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<%= render :partial => 'attachments/form' %>
</p>

View File

@ -1,11 +1,10 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score}) %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show') %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='#' onclick='hidden_homework_atert_form("+
<%= @cur_page%> + "," + <%= @cur_type%> +
");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
"<a href='#' onclick='hidden_homework_atert_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");

View File

@ -5,15 +5,32 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
</a>
</td>
<td style="width: auto; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%></a></td>
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span><%= link_to(homework_attach.bid.courses.first.name.to_s, homework_course_path(homework_attach.bid.courses.first)) if homework_attach.bid.courses.first%></span> >
<%=link_to(homework_attach.bid.name, course_for_bid_path(homework_attach.bid)) %> > <span><%= link_to homework_attach.name.nil? ? homework_attach.user.name + "提交的作业" : homework_attach.name,homework_attach_path(homework_attach)%></span></p></td>
<td>
<p class="top-content-list-homework">
<%=link_to "主页", home_path %> >
<a href="http://<%= Setting.host_course%>" class="link_other_item">
<%=l(:label_courses_management_platform)%>
</a> >
<span>
<%= link_to(homework_attach.bid.courses.first.name.to_s, homework_course_path(homework_attach.bid.courses.first)) if homework_attach.bid.courses.first%>
</span> >
<%=link_to(homework_attach.bid.name, course_for_bid_path(homework_attach.bid)) %> >
<span>
<%= link_to homework_attach.name.nil? ? homework_attach.user.name + "提交的作业" : homework_attach.name,homework_attach_path(homework_attach)%>
</span>
</p>
</td>
</tr>
</table>
</div>

View File

@ -13,8 +13,14 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
<td rowspan="2" width="305px">
<div class="project-search" style="float: right">
<%= form_tag({:controller => 'softapplications', :action => 'search'}, :method => :get, :id => "search_softapplications") do %>
@ -28,9 +34,9 @@
</tr>
<tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/softapplications", :controller=>'softapplications', :action=>'index' %></td>
<td ><%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %>
</td>
</tr>
</table>

View File

@ -1,18 +1,24 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
<td rowspan="2" width="250px"></td>
</tr>
<tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td>
<td ><%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
<span>
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
</span>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a>
<span>
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
</span>
</td>
</tr>

View File

@ -11,12 +11,12 @@
<div id="put-tag-form-issue" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form-issue").hide();' do |f| %>
:complete => '$("#put-tag-form-issue").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "name-issue",:size=>"30" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "add"%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form-issue").hide();'%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form-issue").slideUp();'%>
<% end %>
</div>
</div>
@ -29,12 +29,12 @@
<div id="put-tag-form" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "name",:size=>"28"%>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit "add"%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();'%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").slideUp();'%>
<% end %>
</div>
</div>

View File

@ -34,27 +34,42 @@
<div id="main">
<!-- added by bai -->
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"">企业众包社区</td>
<td style="width: 430px; color: #15bccf""><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="project-search">
<%= form_tag(calls_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', params[:reward_type] %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/calls", :controller => 'bids', :action => 'index' %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> >
<span><%=link_to @bid.name ,bid_path %></span></td>
</tr>
</table>
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">
企业众包社区
</td>
<td style="width: 430px; color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
</strong
></td>
<td rowspan="2" width="250px">
<div class="project-search">
<%= form_tag(calls_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', params[:reward_type] %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a>
</a>
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> >
<span>
<%=link_to @bid.name ,bid_path %>
</span>
</td>
</tr>
</table>
</div>
<!-- end -->
@ -66,50 +81,98 @@
<tr>
<td align="left" valign="middle">
<%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
</td>
</td>
<td>
<table>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= link_to @bid.name,bid_path %></td>
</tr>
<% if User.current.login? %>
<tr>
<td align="center"> <%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %></td>
</tr>
<tr>
<td align="center"> <span style="margin-right:10px;"><span class="icon-fav icon"></span><%= watcher_link(@bid, User.current) %></span></td>
</tr>
<% end %>
</table></td>
<table>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= link_to @bid.name,bid_path %>
</td>
</tr>
<% if User.current.login? %>
<tr>
<td align="center">
<%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %>
</td>
</tr>
<tr>
<td align="center">
<span style="margin-right:10px;">
<span class="icon-fav icon"></span>
<%= watcher_link(@bid, User.current) %>
</span>
</td>
</tr>
<% end %>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td><%= l(:label_investor) %><%= link_to(@user, user_path(@user))%></td>
<td>
<%= l(:label_investor) %>
<%= link_to(@user, user_path(@user))%>
</td>
</tr>
<tr>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<td><%= l(:label_bids_reward_method) %><span style="color: #ed8924; font-weight: bold"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= @bid.budget%></span></td>
<td>
<%= l(:label_bids_reward_method) %>
<span style="color: #ed8924; font-weight: bold">
<%= l(:label_call_bonus) %>&nbsp;
<%= l(:label_RMB_sign) %>
<%= @bid.budget%>
</span>
</td>
<% elsif @bid.reward_type == 2%>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
<% else %>
<td><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %>&nbsp;<%= @bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></td>
<td>
<%= l(:label_bids_reward_method) %>
<%= @bid.budget%>
</td>
<% else %>
<td>
<%= l(:label_bids_reward_method) %>
<%= l(:label_bids_credit) %>&nbsp;
<%= @bid.budget%>&nbsp;
<%= l(:label_bids_credit_number) %>
</td>
<% end %>
</tr>
<tr>
<td><%= l(:label_investment_time_limit) %><%= @bid.deadline%></td>
<td>
<%= l(:label_investment_time_limit) %>
<%= @bid.deadline%>
</td>
</tr>
<tr>
<td><div style="color:#ed8924 ; font-size: 14px">被&nbsp;<strong><%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %></strong>&nbsp;
个高校课程引用为作业!</div></td>
<td>
<div style="color:#ed8924 ; font-size: 14px">被&nbsp;
<strong>
<%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %>
</strong>&nbsp;
个高校课程引用为作业!
</div>
</td>
</tr>
<tr>
<td><div style="color:#ed8924 ; font-size: 14px">有&nbsp;<strong><%= link_to(count_bid_project, show_bid_project_path(@bid)) %></strong>&nbsp;
个项目正在实现该需求!</div></td>
</tr>
<td><div style="color: #ed8924; font-size: 14px">有&nbsp;<strong><%= link_to(count_bid_user, show_bid_user_path(@bid)) %></strong>&nbsp;
个高校用户正在努力完成此需求!</div></td>
<td>
<div style="color:#ed8924 ; font-size: 14px">
有&nbsp;
<strong><%= link_to(count_bid_project, show_bid_project_path(@bid)) %></strong>&nbsp;
个项目正在实现该需求!
</div>
</td>
</tr>
<tr>
<td>
<div style="color: #ed8924; font-size: 14px">
有&nbsp;
<strong><%= link_to(count_bid_user, show_bid_user_path(@bid)) %></strong>&nbsp;
个高校用户正在努力完成此需求!
</div>
</td>
</tr>
</table>
<div>
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
@ -121,10 +184,12 @@
<!--tags-->
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_tag) %></strong>
<strong>
<%= l(:label_tag) %>
</strong>
</div>
<div class="user_underline"></div>
<table style="font-family:微软雅黑">
<table style="font-family:'微软雅黑'">
<tr>
<td><!-- added by william -for tag -->
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%>
@ -144,11 +209,12 @@
<td style="padding-top: 5px">
<% if @bid.watcher_users.size>0 %>
<% for user in @bid.watcher_users%>
<%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ),user_path(user) %>
<% end %>
<% else %>
<p class="font_lighter"><%= l(:label_project_no_follow) %></p>
<p class="font_lighter">
<%= l(:label_project_no_follow) %>
</p>
<% end%>
</td>
</tr>
@ -177,10 +243,7 @@
</table>
</div>
</div>
</div>
</div>
<!-- end -->
</div>
@ -190,7 +253,6 @@
<%= render_menu :bid_menu %>
</div>
<% end %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
@ -199,12 +261,10 @@
</div>
</div>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>

View File

@ -29,8 +29,16 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%=l(:label_contest_innovate_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td style="width: 430px; color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
</strong>
</td>
<td rowspan="2" width="250px">
<div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
@ -43,9 +51,13 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
<span><%= link_to @bid.name, bid_path %></span></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<%= l(:label_contest_innovate)%> >
<span>
<%= link_to @bid.name, bid_path %>
</span>
</td>
</tr>
</table>
</div>
@ -58,27 +70,29 @@
<tr>
<td align="left" width="100px">
<%= image_tag(url_to_avatar(@user), :class => "avatar2") %>
</td>
</td>
<td>
<table>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= h @bid.name %></td>
</tr>
<% if User.current.login? %> <!--added by linchun-->
<tr colspan='3'>
<td valign="middle">
<span style="display:block; margin-left:20px;">
<%= join_in_contest(@bid, User.current)%>
</span>
<span style="display:block; margin-left:20px;">
<span class="icon-fav icon"></span>
<%= watcher_link(@bid, User.current) %>
</span>
<table>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= h @bid.name %>
</td>
</tr>
<% end %>
</table>
<!-- added by bai 增加了竞赛的配置 -->
</tr>
<% if User.current.login? %> <!--added by linchun-->
<tr colspan='3'>
<td valign="middle">
<span style="display:block; margin-left:20px;">
<%= join_in_contest(@bid, User.current)%>
</span>
<span style="display:block; margin-left:20px;">
<span class="icon-fav icon"></span>
<%= watcher_link(@bid, User.current) %>
</span>
</td>
</tr>
<% end %>
</table>
<!-- added by bai 增加了竞赛的配置 -->
<% if User.current.logged? %>
<% if @bid.author.id == User.current.id %>
<%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %>
@ -100,8 +114,12 @@
:action => 'show_project' %>
</td>
<tr class="font_aram">
<td align="center" width="70px"> <%= l(:label_participator) %></td>
<td align="center" width="70px"> <%= l(:label_bidding_project) %></td>
<td align="center" width="70px">
<%= l(:label_participator) %>
</td>
<td align="center" width="70px">
<%= l(:label_bidding_project) %>
</td>
</tr>
</table>
<div class="user_underline"></div>
@ -110,14 +128,22 @@
<div class="inf_user_image">
<table>
<tr>
<td><%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%></td>
</tr>
<tr>
<td><%= l(:label_bids_reward_method) %><%= @bid.budget%></td>
<td>
<%= l(:lable_contest_user) %>
<%= link_to(@user.name, user_path(@user))%>
</td>
</tr>
<tr>
<td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td>
<td>
<%= l(:label_bids_reward_method) %>
<%= @bid.budget%>
</td>
</tr>
<tr>
<td>
<%= l(:label_limit_time) %> :
<%= @bid.deadline%>
</td>
</tr>
</table>
</div>
@ -130,7 +156,6 @@
<div style="padding-bottom: 8px">
<% if @bid.description.size>0 %>
<div class="font_lighter_sidebar">
<%= textilizable @bid.description %>
</div>
<% else %>
@ -139,7 +164,10 @@
</div>
<% end %>
<div class="created_on_project">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@bid.created_on) %>
<strong style="color: #068d9c">
<%= l(:label_create_time) %>
</strong>
<%= format_time(@bid.created_on) %>
</div>
</div>
<div class="user_underline"></div>
@ -158,9 +186,13 @@
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong>
<strong>
<%= l(:label_x_followers, :count => @bid.watcher_users.count) %>
</strong>
<% if show_more_fans?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%></span>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;">
<%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%>
</span>
<% end %>
</div>
<div class="left_wf">
@ -177,9 +209,13 @@
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_bidding_project) %></strong>
<strong>
<%= l(:label_bidding_project) %>
</strong>
<% if show_more_bid_project?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%></span>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;">
<%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%>
</span>
<% end %>
</div>
<div class="left_wf">
@ -200,7 +236,9 @@
<!--fans fq-->
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong>
<strong>
<%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %>
</strong>
<% if show_more_participate?(@bid) %>
<span style="font-size: 12px; display: inline; float: right;" >
<%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%>
@ -210,7 +248,9 @@
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px"> <%= show_participate_picture(@bid) %> </td>
<td style="padding-top: 5px">
<%= show_participate_picture(@bid) %>
</td>
</tr>
</table>
</div>
@ -234,7 +274,9 @@
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
<span>
<%= l(:label_loading) %>
</span>
</div>
<div id="ajax-modal" style="display:none;"></div>

View File

@ -34,7 +34,11 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
</a>
</td>
<td style="color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
@ -50,14 +54,16 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %>
</td>
<td>
<p class="top-content-list">
<%= link_to "主页", home_path %>
> <a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
> <%= link_to @course.name, nil %>
>
<a href="http://<%= Setting.host_course%>" class="link_other_item">
<%=l(:label_courses_management_platform)%>
</a>
>
<%= link_to @course.name, nil %>
</p>
</td>
</tr>
@ -243,7 +249,7 @@
<%= l(:label_course_description_no) %>
</div>
<% end %>
<div class="created_on_course">
<div class="created_on_course" style="padding-left: 10px;">
<strong style="color: #068d9c">
<%= l(:label_create_time) %>
</strong>

View File

@ -29,7 +29,8 @@
background: #15bccf;
color: #fff;
text-align: center;
padding: 5px !important;
padding-left: 5px !important;
padding-right: 5px !important;
}
.span_wping a:hover{ background-color:#03a1b3;}
</style>
@ -46,19 +47,22 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
高校课程实践社区
</a>
</td>
<td style="width: auto; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %></a>
</td>
<td>
<p class="top-content-list-homework"><%= link_to "主页", home_path %>
>
<%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %>
<a href="http://<%= Setting.host_course%>" style="color: #15bccf;">
<%=l(:label_course_practice) %>
</a>
>
<span>
<%= link_to(course.name.to_s, homework_course_path(course)) if course %>
@ -115,7 +119,7 @@
<div class="inf_user_image">
<table>
<% if (User.current.admin?||User.current.id==@bid.author_id) %>
<% if (User.current.admin?||User.current.allowed_to?(:as_teacher,course)) %>
<tr>
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
<% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%>

View File

@ -27,8 +27,10 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">
<%=l(:label_contest_innovate_community)%>
<td class="info_font" style="width: 240px; color: #15bccf" rowspan="2">
<a href="http://<%= Setting.host_contest%>" style="color: #15bccf;">
<%=l(:label_contest_innovate_community)%>
</a>
</td>
<td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
@ -44,11 +46,8 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %>
</td>
<td><%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
<a><%= l(:label_contest_innovate) %></a> >
<span title="<%= @contest.name%>">
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>
</span>

View File

@ -30,8 +30,14 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">软件项目托管社区</td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 240px;" rowspan="2">
<a href="http://<%= Setting.host_name%>" style="color: #15bccf;">
软件项目托管社区
</a>
</td>
<td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<%= form_tag(projects_search_path, :method => :get) do %>
@ -43,8 +49,12 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %></td>
<td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to @project, project_path(@project) %></p></td>
<td>
<p class="top-content-list">
<%=link_to l(:label_home),home_path %> >
<%=link_to @project, project_path(@project) %>
</p>
</td>
</tr>
</table>
</div>
@ -54,7 +64,9 @@
<% @project = Project.find_by_id(@project.id)%>
<table>
<tr>
<td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td>
<%= image_tag(url_to_avatar(@project), :class => 'avatar2') %>
</td>
<td>
<div class="info-course">
<%= link_to @project.name, project_path(@project)%>
@ -86,15 +98,26 @@
<% @project.versions.each do |version| %>
<% files_count += version.attachments.count %>
<% end %>
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
<td class="font_index"><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %></td>
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
<!-- <td class="font_index"><%=link_to files_count, project_files_path(@project) %></td> -->
<td class="font_index">
<%=link_to "#{@project.members.count}", project_member_path(@project) %>
</td>
<td class="font_index">
<%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %>
</td>
<td class="font_index">
<%=link_to "#{@project.issues.count}", project_issues_path(@project) %>
</td>
</tr>
<tr class="font_aram">
<td align="center" width="70px"> <%= l(:label_member) %></td>
<td align="center" width="100px"><%= l(:label_user_watchered) %></td>
<td align="center" width="70px"> <%= l(:label_project_issues) %></td>
<td align="center" width="70px">
<%= l(:label_member) %>
</td>
<td align="center" width="100px">
<%= l(:label_user_watchered) %>
</td>
<td align="center" width="70px">
<%= l(:label_project_issues) %>
</td>
<!-- <td align="center" width="58px"><%#= l(:label_attachment) %></td> -->
</tr>
</table>
@ -109,7 +132,10 @@
<%= textilizable @project.description %>
</div>
<div class="created_on_project">
<strong style="color: #15bccf"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %>
<strong style="color: #15bccf">
<%= l(:label_create_time) %>
</strong>
<%= format_time(@project.created_on) %>
</div>
</div>
<div class="user_underline"></div>

View File

@ -101,8 +101,12 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 238px; color: #15bccf"><%= l(:label_user_home) %></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td class="info_font" style="width: 238px; color: #15bccf" rowspan="2">
<%= l(:label_user_home) %>
</td>
<td style="width: 430px; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
<td rowspan="2" width="250px">
<div class="top-content-search <%='hidden' if show_search_bar(params) %>">
<%= form_tag(:controller => 'users', :action => 'search', :method => :get) do %>
@ -113,12 +117,11 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %>
</td>
<td>
<%=link_to "主页", home_path %> >
<span><%=link_to @user.name, user_path %></span>
<span>
<%=link_to @user.name, user_path %>
</span>
</td>
</tr>
</table>
@ -131,23 +134,28 @@
<div class="inf_user_image">
<table>
<tr>
<td align="left" valign="middle" ><%= image_tag(url_to_avatar(@user), :class => 'avatar2') %></td>
<td align="left" valign="middle" >
<%= image_tag(url_to_avatar(@user), :class => 'avatar2') %>
</td>
<td>
<table>
<tr>
<!-- added by bai -->
<!-- modified by zjc 姓名添加超链接 -->
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all"><%= link_to h (@user.name) %>
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%></td>
<td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all">
<%= link_to h (@user.name) %>
<%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%>
</td>
</tr>
<tr>
<td align="center"> <% unless User.current == @user %>
<%= watcher_link(@user, User.current) %>
<% else %>
<%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %>
<% end %></td>
<td align="center">
<% unless User.current == @user %>
<%= watcher_link(@user, User.current) %>
<% else %>
<%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %>
<% end %>
</td>
</tr>
<tr>
<td class="score">
<div id="score_div">
@ -156,8 +164,8 @@
</td>
</tr>
<!-- end -->
</table></td>
</table>
</td>
</tr>
</table>
<div>
@ -181,7 +189,7 @@
<div id="introduction" style="display: none">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'add_brief_introdution'}) do |f|%>
<table border="0" width="100%" align="center" >
<table border="0" width="96%" align="center" id="my_brief_introduction">
<tr>
<td>
<%= f.text_area 'user_introduction', :rows => 3,
@ -195,8 +203,11 @@
<table border="0" width="200px" align="center">
<tr>
<td align="right">
<%= submit_tag l(:button_submit), :name => nil ,
<%#= submit_tag l(:button_submit), :name => nil ,
:class => "bid_btn" %>
<a href="#" onclick='$("#my_brief_introduction").parent().submit();' class="ButtonColor m3p10" >
<%= l(:label_submit)%>
</a>
</td>
</tr>
</table>
@ -228,29 +239,42 @@
<% unless @user.user_extensions.nil? %>
<% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
<tr>
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<td style="padding-left: 5px" width="70px">
<%= l(:field_occupation) %>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<% unless @user.user_extensions.school.nil? %>
<a href="http://course.trustie.net/?school_id=<%= @user.user_extensions.school.id%>"><%= @user.user_extensions.school.name %></a>
<% end %>
</td>
</td>
</tr>
<% elsif @user.user_extensions.identity == 3 %>
<tr>
<td style="padding-left: 5px" width="70px"><%= l(:field_occupation) %></td>
<td style="padding-left: 5px" width="70px">
<%= l(:field_occupation) %>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.occupation %>
</td>
</td>
</tr>
<% elsif @user.user_extensions.identity == 2 %>
<tr>
<td style="padding-left: 18px" width="70px"><%= l(:label_company_name) %></td>
<td style="padding-left: 18px" width="70px">
<%= l(:label_company_name) %>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.firstname %>
</td>
</tr>
<% end %>
<tr>
<td style="padding-left: 31px" width="76px"><%= l(:label_location) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %><%= @user.user_extensions.location_city %></td>
<td style="padding-left: 31px" width="76px">
<%= l(:label_location) %>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.location %>
<%= @user.user_extensions.location_city %>
</td>
</tr>
<tr>
<% if @user.user_extensions.identity == 0 %>
@ -307,7 +331,9 @@
<div class="user_underline"></div>
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_user_watcher) %></strong>
<strong>
<%= l(:label_user_watcher) %>
</strong>
<% if show_more_watchers?(@user) %>
<div style="font-size: 11px; display: inline; float: right; margin-top: 5px; margin-right: 20px" >
<%= link_to l(:label_more), :controller => "users", :action => "user_watchlist"%>
@ -318,7 +344,9 @@
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px"> <%= show_watcher_profile(@user) %> </td>
<td style="padding-top: 5px">
<%= show_watcher_profile(@user) %>
</td>
</tr>
</table>
</div>
@ -327,7 +355,9 @@
<!--fans-->
<div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %></strong>
<strong>
<%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %>
</strong>
<% if show_more_fans?(@user) %>
<div style="font-size: 11px; display: inline; float: right; margin-top: 5px; margin-right: 20px" >
<%= link_to l(:label_more), :controller => "users", :action => "user_fanslist"%>
@ -337,7 +367,9 @@
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px"> <%= show_fans_picture(@user) %> </td>
<td style="padding-top: 5px">
<%= show_fans_picture(@user) %>
</td>
</tr>
</table>
</div>

View File

@ -69,9 +69,9 @@
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %>
<%#= submit_tag l(:button_save) %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'whiteButton m3p10' %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'ButtonColor m3p10' %>
<%#= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'ButtonColor m3p10' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>

View File

@ -4,9 +4,15 @@
<% projects_results.each do |prj| %>
<div>
<p class="font_description2">
<strong><%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %></strong>
<strong>
<%= l(:label_tags_project_name) %>
<%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %>
</strong>
<br />
<strong><%= l(:label_tags_project_description) %></strong><%= textilizable prj.description %>
<strong>
<%= l(:label_tags_project_description) %>
</strong>
<%= textilizable prj.description %>
</p>
</div>
<div class="line_under"></div>

View File

@ -44,7 +44,7 @@
<span>
<%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);',
:class => "tags_icona",
:onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %>
:onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %>
<%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>
</span>
&nbsp;&nbsp;
@ -72,7 +72,7 @@
<div id="put-tag-form" style="display: none">
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form").hide();' do |f| %>
:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
@ -80,7 +80,7 @@
<a href="#" onclick='$("#tags_name").parent().submit();' class="ButtonColor m3p10" >
<%= l(:button_project_tags_add)%>
</a>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").hide();',:class=>'ButtonColor m3p10'%>
<%= link_to_function l(:button_cancel), '$("#put-tag-form").slideUp();',:class=>'ButtonColor m3p10'%>
<% end %>
</div>
<% end %>

View File

@ -2,32 +2,50 @@
<% unless show_flag.nil? %>
<% case %>
<% when show_flag == '1' %>
<strong><%=l(:label_user)%>(<%= @results_count %>)</strong>
<strong>
<%=l(:label_user)%>
(
<%= @results_count %>
)
</strong>
<%= render :partial => "show_users",:locals => {:users_results => users_results}%>
<% when show_flag == '2'%>
<strong><%=l(:label_project)%>(<%= @results_count %>)</strong>
<strong>
<%=l(:label_project)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_projects",:locals => {:projects_results => projects_results }%>
<% when show_flag == '3'%>
<strong><%=l(:label_issue)%>(<%= @results_count %>)</strong>
<%= render :partial => "show_issues",:locals => {:issues_results => issues_results }%>
<% when show_flag == '4'%>
<strong><%= l(:label_requirement)%>(<%= @results_count %>)</strong>
<strong>
<%= l(:label_requirement)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_bids",:locals => {:bids_results => bids_results}%>
<% when show_flag == '5'%>
<strong><%= l(:label_forum)%>(<%= @results_count %>)</strong>
<strong>
<%= l(:label_forum)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_forums",:locals => {:forums_results => forums_results}%>
<% when show_flag == '6'%>
<strong><%= l(:label_attachment)%>(<%= @results_count %>)</strong>
<strong>
<%= l(:label_attachment)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_attachments",:locals => {:attachments_results => attachments_results}%>
<% when show_flag == '7'%>
<strong><%= l(:label_contest_innovate)%>(<%= @results_count %>)</strong>
<strong>
<%= l(:label_contest_innovate)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_contests",:locals => {:contests_results => contests_results}%>
<% when show_flag == '8'%>
<strong><%#= l(:label_attachment)%>
开源项目:(<%= @results_count %>)</strong>
开源项目:(<%= @results_count %>)
</strong>
<%= render :partial => "show_open_source_projects",:locals => {:projects_results => open_source_projects_results}%>
<% when show_flag == '9'%>
<strong><%= l(:label_course)%>(<%= @results_count %>)</strong>
<strong>
<%= l(:label_course)%>(<%= @results_count %>)
</strong>
<%= render :partial => "show_courses",:locals => {:courses_results => courses_results}%>
<% else %>
<strong><%= l(:label_tags_all_objects)%></strong>

View File

@ -18,8 +18,12 @@
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf" ><%= l(:label_software_user ) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
<%= l(:label_software_user ) %>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
</td>
<td rowspan="2" >
@ -35,8 +39,10 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/users", :controller => 'users', :action => 'index' %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_software_user), :controller => 'users', :action => 'index' %></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_software_user)%></a>
</td>
</tr>
</table>
<% end %>

View File

@ -14,8 +14,12 @@
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf "><%= l(:label_software_user ) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td class="info_font" style="width: 220px; color: #15bccf " rowspan="2">
<%= l(:label_software_user ) %>
</td>
<td class="location-list">
<strong><%= l(:label_user_location) %> :</strong>
</td>
<td rowspan="2">
</td>
<td rowspan="2" >
@ -31,8 +35,10 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/users", :controller => 'users', :action => 'index' %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_software_user), :controller => 'users', :action => 'index' %></td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_software_user)%></a>
</td>
</tr>
</table>
</div>

View File

@ -25,8 +25,10 @@
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
<% end %>
(<%= course.members.count %>人)
<%# files_count = course.attachments.count.to_s %>
(<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)
<% files_count = course.attachments.count %>
<% if files_count > 0%>
(<%= link_to "#{files_count.to_s}份", course_files_path(course) %>资料)
<% end %>
</div>
</li>
<% end %>

View File

@ -153,7 +153,11 @@
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-left" >
<h3 style="margin-left: 5px; color: #e8770d;"><strong><%=l(:label_current_hot_contest)%></strong></h3>
<h3 style="margin-left: 5px; color: #e8770d;">
<strong>
<%=l(:label_current_hot_contest)%>
</strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
@ -171,15 +175,26 @@
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<%= link_to(contest.name.truncate(50, omission: '...'), contest_contestnotifications_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<span class="font_lighter">(
<span style="font-size: 13px">
<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>
</span>)
</span>
<% else %>
<span class="font_lighter">(<span style="font-size: 13px"><%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %></span>)</span>
<span class="font_lighter">(
<span style="font-size: 13px">
<%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %>
</span>)
</span>
<% end %>
</div>
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;" class="text_nowrap">
<span class='font_lighter' title ='<%=contest.description%>'><%=contest.description.truncate(100, omission: '...')%></span>
</div><br />
<span class='font_lighter' title ='<%=contest.description%>'>
<%=contest.description.truncate(100, omission: '...')%>
</span>
</div>
<br />
<div style="padding-left: 57px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time contest.created_on %></span>
@ -193,7 +208,9 @@
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_notification)%></strong>
<strong>
<%=l(:label_notification)%>
</strong>
</h3>
<ul class="contest-notification-list">
@ -204,13 +221,19 @@
</div>
<div class="font_lighter" style="padding-top: 7px;padding-left: 55px;" title="<%= notification.title%>">
<span>
<strong><%= link_to_user(notification.author) %></strong>
<strong>
<%= link_to_user(notification.author) %>
</strong>
<%= l(:label_project_notice) %>
<%= link_to notification.title.truncate(35, omission: '...'), contest_contestnotifications_path(notification.contest_id) %>
</span>
</div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>"><%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></div>
<div class="font_lighter" style="padding-left: 55px;" title="<%= notification.description%>">
<%= notification.description.truncate(30, omission: '...') %></div>
<div class="font_lighter" style="padding-left: 55px;">
<%=l(:label_release_time)%>:&nbsp;
<%=format_time notification.created_at %>
</div>
</li>
<% end %>
</ul>
@ -239,10 +262,14 @@
<%=l(:label_question_sponsor)%>:&nbsp;<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<%=l(:label_final_reply)%>:&nbsp;<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%=l(:label_final_reply)%>:&nbsp;
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>
<span class="memo_reply">
<%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)
<%=l(:label_reply)%>
(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</div>
@ -265,17 +292,21 @@
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/app1.png')%>
</div>
<div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.to_s.truncate(50, omission: '...')%></span>
<span class='font_lighter' title =<%=softapplication.description.to_s%>>
<%=softapplication.description.to_s.truncate(50, omission: '...')%>
</span>
</div><br />
<div style="padding-left: 55px; clear: left;">
<span class="font_lighter"><%=l(:label_release_time)%>:&nbsp;<%=format_time softapplication.created_at %></span>
<span class="font_lighter">
<%=l(:label_release_time)%>:&nbsp;
<%=format_time softapplication.created_at %>
</span>
</div>
</li>
@ -283,8 +314,9 @@
</div>
<% else %>
<p class="font_lighter"><%= l(:label_no_ftapplication) %></p>
<p class="font_lighter">
<%= l(:label_no_ftapplication) %>
</p>
<% end %>
</div>
</div>

View File

@ -153,8 +153,8 @@
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person" title="<%= topic.last_reply.author.login unless (topic.last_reply.nil? || topic.last_reply.author.nil?)%>">
<%= l(:label_final_reply)%>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%= l(:label_final_reply)%>
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>

View File

@ -174,8 +174,8 @@
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
<%= l(:label_final_reply)%>
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%= l(:label_final_reply)%>
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
<% end %>
</span>

View File

@ -1,8 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<% show_real_name ||= false%>
<div id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :show_real_name => show_real_name} %>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %>
<% end %>
</div>

View File

@ -1,58 +1,51 @@
<% show_real_name ||= false %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head">
<% if show_name %>
<%= image_tag url_to_avatar(reply.user) %>
<% else %>
<%= image_tag url_to_avatar(nil) %>
<% end %>
</div>
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<% if show_real_name%>
<%= link_to reply.user.lastname+reply.user.firstname, user_path(reply.user) %>
<% else %>
<%= link_to reply.user.name, user_path(reply.user) %>
<% end %>
回复
<% parent_jour = JournalsForMessage.find reply.m_reply_id %>
<% if show_name && parent_jour %>
<% if show_real_name%>
<%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %>
<% else %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% end %>
<% else %>
<% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
<% if parent_jour%>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head">
<% if show_name %>
<%= image_tag url_to_avatar(reply.user) %>
<% else %>
<%= image_tag url_to_avatar(nil) %>
<% end %>
</div>
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.name, user_path(reply.user) %>
回复
<% if show_name %>
<%= link_to parent_jour.user.name, user_path(parent_jour.user) %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>
<% end %>
<p>
<span class="message-notes">
<%= reply.notes %>
</span>
</p>
<p>
</p>
<p>
<span class="time">
<%= format_time reply.created_on %>
</span>
<span class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<% if User.current.admin? || reply.user.id == User.current.id%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</span>
</p>
</div>
<div id='<%=id%>' class="respond-form">
</p>
</div>
<div id='<%=id%>' class="respond-form">
<% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name, :show_real_name => show_real_name} %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
<% end %>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div style="clear: both;"></div>
</div>
<% end %>

View File

@ -1,5 +1,4 @@
<% show_real_name ||= false%>
<%= form_tag(words_create_reply_path(:show_real_name=>show_real_name), :remote => true) do %>
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),

View File

@ -1,7 +1,7 @@
<% if @save_succ %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name, :show_real_name=>@show_real_name}
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);

View File

@ -570,6 +570,14 @@ zh:
label_role_new: 新建角色
label_role_and_permissions: 角色和权限
label_member: 成员
label_search_member_in_group: 班内搜索
label_search_member_in_course: 课内搜索
label_search_member_count: 共搜索到
label_member_people:
label_delete_group: 确定删除分班?
label_current_group: 当前分班
label_limit_groupname: 组别名不能超出20字符
label_limit_groupname_null: 组别名不能为空
label_member_new: 添加成员
label_member_plural: 成员
label_tracker: 跟踪标签
@ -1120,6 +1128,7 @@ zh:
text_workflow_edit: 选择角色和跟踪标签来编辑工作流程
text_are_you_sure: 您确定要删除吗?
text_are_you_sure_out: 你确定要退出该课程吗?
text_are_you_sure_out_group: 你确定要退出该分班吗?
text_journal_changed: "%{label} 从 %{old} 变更为 %{new}"
text_journal_set_to: "%{label} 被设置为 %{value}"
text_journal_deleted: "%{label} 已删除 (%{old})"
@ -1169,7 +1178,7 @@ zh:
text_wiki_page_nullify_children: 将子页面保留为根页面
text_wiki_page_destroy_children: 删除子页面及其所有下级页面
text_wiki_page_reassign_children: 将子页面的上级页面设置为
text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该项目了。你确定要继续吗?
text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗?
text_zoom_in: 放大
text_zoom_out: 缩小
text_applied_project: "用户 %{id} 申请加入项目 %{project}"
@ -1373,7 +1382,7 @@ zh:
label_activity_time: 发布时间
label_update_time: 更新时间
label_current_contributors: 位当前贡献者
label_commit_limit: 作业提交时间已过!
label_commit_limit: 截止了,可补交
label_commit_ar: 作业提交截止时间快到了!
lable_has_commit_homework: 您已提交过作业
#modify by men
@ -1723,6 +1732,7 @@ zh:
label_user_create_project: 创建了
label_user_create_project_homework: 创建了作业
#added by bai
label_submit: 提交
label_identity: 身份
label_teacher: 教师
label_teacher_homework: 教师姓名
@ -1898,9 +1908,11 @@ zh:
other: 成员
label_bids_task_list: 作业列表
label_join_course: 加入课程
label_join_course: 加入
label_exit_course: 退出
label_exit_group: 退出当前分班
label_new_join: 加入
label_new_join_group: 加入当前分班
label_new_course_password: 课程密码
label_new_course_school: 开课学校
label_new_course_description: 课程描述

View File

@ -643,10 +643,17 @@ RedmineApp::Application.routes.draw do
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
post 'finishcourse'
post 'restartcourse'
match "searchmembers", :controller => 'courses', :action => 'searchmembers', :via => [:post,:get]
match "searchgroupmembers", :via => [:post, :get]
match "updategroupname", :via => [:post, :get]
match "addgroups", :via => [:post, :get]
match 'deletegroup', :via => [:delete]
post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group'
delete 'join_in/join_group', :to => 'courses#unjoin_group'
end
collection do
match 'join_private_courses', :via => [:get, :post]
end
match '/member', :to => 'courses#member', :as => 'member', :via => :get
@ -739,6 +746,8 @@ RedmineApp::Application.routes.draw do
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
post 'join_in/join_group', :to => 'courses#join_group', :as => 'join_group'
delete 'join_in/join_group', :to => 'courses#unjoin_group'
post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
match 'calls/:id/show_participator', :to => 'bids#show_participator' # bai
@ -747,6 +756,7 @@ RedmineApp::Application.routes.draw do
delete 'attachment/:id', :to => 'attachments#delete_homework'
match 'new_join', :to => 'courses#new_join', :as => 'try_join'
match 'new_join_group', :to => 'courses#new_join_group', :as => 'try_join_group'
match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]

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