Merge branch 'szzh' into develop
This commit is contained in:
commit
d655becf7b
|
@ -20,11 +20,10 @@ class CoursesController < ApplicationController
|
|||
menu_item l(:label_sort_by_influence), :only => :index
|
||||
|
||||
before_filter :can_show_course, :except => []
|
||||
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
|
||||
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
|
||||
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
|
||||
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
|
||||
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
|
||||
before_filter :logged_user_by_apptoken,:only => [:show,:feedback]
|
||||
before_filter :find_course, :except => [ :index, :search, :new,:join,:unjoin, :create, :new_join, :course,:join_private_courses]
|
||||
before_filter :authorize_course, :only => [:show, :settings, :update, :course]
|
||||
before_filter :authorize_course_global, :only => [:new,:create]
|
||||
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
|
||||
|
||||
before_filter :require_login, :only => [:join, :unjoin]
|
||||
|
@ -605,7 +604,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
def toggleCourse
|
||||
@course_prefs = Course.find_by_extra(@course.extra)
|
||||
unless (@course_prefs.teacher == User.current || User.current.admin?)
|
||||
unless (@course_prefs.student != User.current || User.current.admin?)
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
@ -809,6 +808,12 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#删除课程
|
||||
#删除课程只是将课程的is_delete状态改为false,is_delete为false状态的课程只有管理员可以看到
|
||||
def destroy
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
def allow_join course
|
||||
if course_endTime_timeout? course
|
||||
|
|
|
@ -18,31 +18,31 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@homework_type = "1"
|
||||
|
||||
@homework = HomeworkCommon.new
|
||||
@homework.safe_attributes = params[:homework_common]
|
||||
@homework.late_penalty = 0
|
||||
@homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
@homework.publish_time = Time.now.strftime('%Y-%m-%d')
|
||||
|
||||
if @homework_type == "1"
|
||||
#匿评作业相关属性
|
||||
@homework_detail_manual = HomeworkDetailManual.new
|
||||
@homework_detail_manual.ta_proportion = 0.6
|
||||
@homework_detail_manual.absence_penalty = 0
|
||||
@homework_detail_manual.evaluation_num = 3
|
||||
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
|
||||
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
@homework.homework_detail_manual = @homework_detail_manual
|
||||
elsif @homework_type == "2"
|
||||
#编程作业相关属性
|
||||
@homework_detail_programing = HomeworkDetailPrograming.new
|
||||
@homework.homework_detail_programing = @homework_detail_programing
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
# @homework_type = "1"
|
||||
#
|
||||
# @homework = HomeworkCommon.new
|
||||
# @homework.safe_attributes = params[:homework_common]
|
||||
# @homework.late_penalty = 0
|
||||
# @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
# @homework.publish_time = Time.now.strftime('%Y-%m-%d')
|
||||
#
|
||||
# if @homework_type == "1"
|
||||
# #匿评作业相关属性
|
||||
# @homework_detail_manual = HomeworkDetailManual.new
|
||||
# @homework_detail_manual.ta_proportion = 0.6
|
||||
# @homework_detail_manual.absence_penalty = 0
|
||||
# @homework_detail_manual.evaluation_num = 3
|
||||
# @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
|
||||
# @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
|
||||
# @homework.homework_detail_manual = @homework_detail_manual
|
||||
# elsif @homework_type == "2"
|
||||
# #编程作业相关属性
|
||||
# @homework_detail_programing = HomeworkDetailPrograming.new
|
||||
# @homework.homework_detail_programing = @homework_detail_programing
|
||||
# end
|
||||
# respond_to do |format|
|
||||
# format.html
|
||||
# end
|
||||
end
|
||||
|
||||
#新建作业下一步
|
||||
|
|
|
@ -468,22 +468,60 @@ class StudentWorkController < ApplicationController
|
|||
sheet1 = book.create_worksheet :name => "homework"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
||||
sheet1[count_row,2] = homework.user.login
|
||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
if @homework.homework_type == 0 #普通作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
||||
sheet1[count_row,2] = homework.user.login
|
||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
# sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,9] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 1 #匿评作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
||||
sheet1[count_row,2] = homework.user.login
|
||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 2 #编程作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
||||
sheet1[count_row,2] = homework.user.login
|
||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
|
|
|
@ -448,7 +448,7 @@ class UsersController < ApplicationController
|
|||
|
||||
def user_courses4show
|
||||
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
|
||||
query = query.where("m.user_id = ?",@user.id)
|
||||
query = query.where("m.user_id = ?",@user.id).order("#{Course.table_name}.id desc")
|
||||
if User.current == @user #看自己
|
||||
else
|
||||
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
|
||||
|
@ -456,13 +456,12 @@ class UsersController < ApplicationController
|
|||
query = query.where("r.role_id in(3,7,9)")
|
||||
end
|
||||
query = query.where(Course.table_name+".is_public = 1")
|
||||
# or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)
|
||||
end
|
||||
|
||||
if params[:lastid]!=nil && !params[:lastid].empty?
|
||||
query = query.where("( (#{Course.table_name}.updated_at=? and #{Course.table_name}.id < ?) or #{Course.table_name}.updated_at<?)",params[:lasttime],params[:lastid],params[:lasttime])
|
||||
query = query.where(" #{Course.table_name}.id < ?",params[:lastid],)
|
||||
end
|
||||
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(8).all
|
||||
@list = query.limit(8)
|
||||
|
||||
render :layout=>nil
|
||||
end
|
||||
|
|
|
@ -20,9 +20,9 @@ module PraiseTreadHelper
|
|||
# when 0
|
||||
# return @record.tread_num.nil? ? 0 : @record.tread_num
|
||||
# end
|
||||
return (@record.praise_num.to_i-@record.tread_num.to_i)
|
||||
return ((@record.praise_num.nil? ? 0 : @record.praise_num.to_i)-(@record.tread_num.nil? ? 0 : @record.tread_num.to_i))
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -328,73 +328,41 @@ module UsersHelper
|
|||
return [0,[]]
|
||||
end
|
||||
list = query.order("updated_on desc").limit(10).all
|
||||
return [count,list];
|
||||
return [count,list]
|
||||
end
|
||||
|
||||
def get_create_course_count(user)
|
||||
return Course.where("tea_id = ?",user.id).count()
|
||||
if user == User.current
|
||||
user.courses.count
|
||||
else
|
||||
user.courses.where("is_public = 1").count
|
||||
end
|
||||
end
|
||||
def get_join_course_count(user)
|
||||
return user.coursememberships.count() - get_create_course_count(user)
|
||||
user.coursememberships.count - get_create_course_count(user)
|
||||
end
|
||||
def get_homework_commons_count(user)
|
||||
return HomeworkCommon.where("user_id = ?",user.id).count()
|
||||
HomeworkCommon.where("user_id = ?",user.id).count
|
||||
end
|
||||
def get_projectandcourse_attachment_count(user)
|
||||
return Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count()
|
||||
Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count
|
||||
end
|
||||
def get_create_project_count(user)
|
||||
return Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count()
|
||||
Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count
|
||||
end
|
||||
def get_join_project_count(user)
|
||||
return user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
|
||||
user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
|
||||
end
|
||||
def get_create_issue_count(user)
|
||||
return Issue.where("author_id = ?",user.id).count()
|
||||
Issue.where("author_id = ?",user.id).count
|
||||
end
|
||||
def get_resolve_issue_count(user)
|
||||
return Issue.where("assigned_to_id = ? and status_id=3",user.id).count()
|
||||
Issue.where("assigned_to_id = ? and status_id=3",user.id).count
|
||||
end
|
||||
def get_anonymous_evaluation_count(user)
|
||||
return StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count()
|
||||
StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count
|
||||
end
|
||||
|
||||
|
||||
# def query_activities(query,type)
|
||||
# query_rec_count = 8
|
||||
# # query = query.where("act_type='JournalsForMessage'")
|
||||
# #query = query.where("act_type not in (?)", ['JournalsForMessage','Message','HomeworkCommon','News','Issue','Journal','Poll'])
|
||||
# list = query.order("id desc").limit(query_rec_count).all
|
||||
#
|
||||
# result = [];
|
||||
# for item in list
|
||||
# container = get_activity_container(item,type)
|
||||
# if( activity_is_show(item,container) )
|
||||
# result << { :item=>item,:e=>container }
|
||||
# end
|
||||
# end
|
||||
# return [lastid,result]
|
||||
# end
|
||||
# def get_activity_container activity,type
|
||||
# e = nil;
|
||||
# if type == 'Project'
|
||||
# if activity.act_type == 'Poll'
|
||||
# # 项目没有问卷
|
||||
# # e = Project.find_by_id(activity.act.polls_group_id)
|
||||
# else
|
||||
# e = activity.act.project if activity.act.respond_to?('project')
|
||||
# end
|
||||
# end
|
||||
# if type == 'Course'
|
||||
# if activity.act_type == 'Poll'
|
||||
# e = Course.find_by_id(activity.act.polls_group_id)
|
||||
# else
|
||||
# e = activity.act.course if activity.act.respond_to?('course')
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# return e;
|
||||
# end
|
||||
def query_activities(query)
|
||||
list = query.limit(8).all
|
||||
result = [];
|
||||
|
@ -406,31 +374,8 @@ module UsersHelper
|
|||
end
|
||||
def get_activity_container activity
|
||||
return activity.activity_container
|
||||
# if type == 'Project'
|
||||
# return activity.act.project if activity.act.respond_to?('project')
|
||||
# end
|
||||
# if type == 'Course'
|
||||
# if activity.act_type == 'Poll'
|
||||
# return Course.find_by_id(activity.act.polls_group_id)
|
||||
# end
|
||||
# return activity.act.course if activity.act.respond_to?('course')
|
||||
# end
|
||||
# return nil;
|
||||
end
|
||||
|
||||
# def activity_is_show(activity,e)
|
||||
# if(!e)
|
||||
# return false
|
||||
# end
|
||||
#
|
||||
# if activity.user_id == User.current.id
|
||||
# return true
|
||||
# end
|
||||
# if( e.visible? )
|
||||
# return true
|
||||
# end
|
||||
# return false
|
||||
# end
|
||||
def get_activity_act_showname_htmlclear(activity)
|
||||
str = get_activity_act_showname(activity)
|
||||
str = str.gsub(/<.*>/,'')
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
:member_id => member.id,
|
||||
:remote => true},
|
||||
:class => 'ml258 c_red' %>
|
||||
<span class="ml65 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,17 +1,27 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= error_messages_for 'homework_common' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_course_homework_new)%>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<div class="hwork_new" id="hwork_new">
|
||||
<%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
|
||||
<input type="hidden" name="course" value="<%= @course.id%>">
|
||||
<h3 class="c_blue f16 mb10">
|
||||
请选择将要发布的作业类型
|
||||
</h3>
|
||||
<input type="radio" class="mb10 fl" name="homework_common_type" value="1" id="homework_detail_manual_radio" checked/>
|
||||
<span class="ml5 fl">
|
||||
人工评分的作业(支持匿名互评、灵活设置评分比例)
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
|
||||
<span class="ml5 fl">
|
||||
自动评测的编程作业(支持C/C++程序的自动评分)
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
|
||||
下一步
|
||||
</a>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% if(User.current.logged? && User.current!=target)%>
|
||||
<%if(target.watched_by?(User.current))%>
|
||||
<a id="user_watch_id" href="<%= watch_path(:object_type=>
|
||||
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
|
||||
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消关注</a>
|
||||
<% else %>
|
||||
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
|
||||
<% end %>
|
||||
|
|
|
@ -19,77 +19,8 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
||||
<!--
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>个人中心(st)</title>
|
||||
<link href="css/public.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/users.css" rel="stylesheet" type="text/css" />
|
||||
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
|
||||
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/sidebar.js"></script>
|
||||
|
||||
<script type="text/javascript" src="js/jquery.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
|
||||
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//头部导航
|
||||
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
||||
function buildsubmenus(){
|
||||
for (var i=0; i<menuids.length; i++){
|
||||
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
|
||||
for (var t=0; t<ultags.length; t++){
|
||||
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
|
||||
ultags[t].parentNode.onmouseover=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="block"
|
||||
}
|
||||
ultags[t].parentNode.onmouseout=function(){
|
||||
this.getElementsByTagName("ul")[0].style.display="none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", buildsubmenus, false)
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", buildsubmenus)
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">//侧导航
|
||||
$(function(){
|
||||
$(".subNav").click(function(){
|
||||
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
|
||||
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
|
||||
|
||||
// 修改数字控制速度, slideUp(500)控制卷起速度
|
||||
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function show_window () {
|
||||
$('#light').css('display','block');
|
||||
$('#fade').css('display','block');
|
||||
}
|
||||
|
||||
function close_window(){
|
||||
$('#light').css('display','none');
|
||||
$('#fade').css('display','none');
|
||||
}
|
||||
//弹框l
|
||||
</script> -->
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
@ -103,12 +34,6 @@ $(".subNav").click(function(){
|
|||
<%=link_to l(:field_homepage), home_path %> > <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> > <%=link_to @user.name, user_path(@user) %>
|
||||
</p>
|
||||
</div>
|
||||
<!--<div class="search fl">-->
|
||||
<!--<form class="search">-->
|
||||
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
|
||||
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
|
||||
<!--</form>-->
|
||||
<!--</div>-->
|
||||
</div><!--TopBar end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -150,7 +75,9 @@ $(".subNav").click(function(){
|
|||
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
|
||||
<li><%= l(:label_company_name) %> :</li>
|
||||
<% elsif !@user.firstname.empty? || !@user.lastname.empty? %>
|
||||
<li>真实姓名 :</li>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
<li>真实姓名 :</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
|
@ -173,7 +100,9 @@ $(".subNav").click(function(){
|
|||
</ul>
|
||||
<ul class="leftbox_ul_right c_dgrey">
|
||||
<li><%= format_date(@user.created_on) %></li>
|
||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
<li style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="<%= @user.show_name %>"><%= @user.show_name %></li>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<% if @user.user_extensions.identity == 0 %>
|
||||
<li><%= get_technical_title @user %></li>
|
||||
|
@ -200,22 +129,18 @@ $(".subNav").click(function(){
|
|||
<% if @center_flag %>
|
||||
<div class="subNavBox ">
|
||||
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
|
||||
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
|
||||
<!--<ul class="navContent " >-->
|
||||
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
|
||||
<!--</ul>-->
|
||||
<div class="subNav subNav_jiantou"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
|
||||
<!--<ul class="navContent " >-->
|
||||
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
|
||||
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
|
||||
<!--</ul>-->
|
||||
<div class="subNav subNav_jiantou">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
我的课程
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="subNav subNav_jiantou">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
我的项目
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
|
||||
</div><!--侧导航 end-->
|
||||
<% end %>
|
||||
|
@ -256,16 +181,18 @@ $(".subNav").click(function(){
|
|||
<%= render :partial => 'layouts/user_watch_list', :locals => {:user => @user} %>
|
||||
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
|
||||
<% visitor_count,visitor_list = get_visitor_users(@user) %>
|
||||
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
|
||||
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<% for visitor in visitor_list %>
|
||||
<%= link_to image_tag(url_to_avatar(visitor.user), :style => "width:38px;height:38px;"), user_path(visitor.user), :class => "pic_members", :title => "#{visitor.user.name}" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% if(User.current.admin?) %>
|
||||
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
|
||||
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<% for visitor in visitor_list %>
|
||||
<%= link_to image_tag(url_to_avatar(visitor.user), :style => "width:38px;height:38px;"), user_path(visitor.user), :class => "pic_members", :title => "#{visitor.user.name}" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div><!--LSide end-->
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
<% if @message.project %>
|
||||
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||
<% elsif @message.course %>
|
||||
<%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||
<% end %>
|
||||
<%=h @message.board.course.name %> - <%=h @message.board.name %>:
|
||||
<%= link_to(h(@message.subject), @message_url + "?topic_id=#{@message.id}&&parent_id=#{@message.parent_id ? @message.parent_id : @message.id}",:style=>'color:#1b55a7; font-weight:bold;') %>
|
||||
<% end %>
|
||||
</span><%= l(:mail_issue_title_active)%></p>
|
||||
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<div class="lz">
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
|
||||
</span>
|
||||
<div class="lz-left">
|
||||
<div>
|
||||
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
|
||||
|
|
|
@ -23,35 +23,45 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li ><span class="tit_fb ">测试结果:</span>
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<!--<%#@work.student_work_test.each do |test|%>-->
|
||||
<!--<tr class="<%#= cycle("", "b_grey") %>">-->
|
||||
<!--<td class="td_tit">-->
|
||||
<!--<%#= test.homework_test.input%>-->
|
||||
<!--</td>-->
|
||||
<!--<td class="td_tit">-->
|
||||
<!--<%#= test.homework_test.output%>-->
|
||||
<!--</td>-->
|
||||
<!--<td class="td_50 c_red"><%#= test.status_to_s%></td>-->
|
||||
<!--<td class="td_50 "><%#= test.test_score%></td>-->
|
||||
<!--</tr>-->
|
||||
<!--<%# end%>-->
|
||||
|
||||
<tr class=" b_lblue fb c_w">
|
||||
<td class="td_tit ">输入</td>
|
||||
<td class="td_tit border_l ">输出</td>
|
||||
<td class="td_50 border_l ">测试结果</td>
|
||||
</tr>
|
||||
<%@homework.homework_tests.each do |test|%>
|
||||
<tr class="<%= cycle("", "b_grey") %>">
|
||||
<td class="td_tit">
|
||||
<td class="td_tit hidden">
|
||||
<%= test.input%>
|
||||
</td>
|
||||
<td class="td_tit">
|
||||
<td class="td_tit border_l hidden">
|
||||
<%= test.output%>
|
||||
</td>
|
||||
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
|
||||
<td class="td_50 c_red"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
|
||||
<td class="td_50 c_red border_l"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
|
||||
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
|
||||
</tr>
|
||||
<% end%>
|
||||
<% student_work_test = @work.student_work_test.first%>
|
||||
<% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
|
||||
<tr class="border_t" >
|
||||
<td colspan="3" class="td_end" >
|
||||
<%= student_work_test.error_msg%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li ><span class="tit_fb ">测试结果:</span>
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="message_box mb10">
|
||||
<div nhname='new_message' style="display:none;">
|
||||
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
|
||||
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea' name="new_form[user_message]"></textarea>
|
||||
<p nhname='contentmsg'></p>
|
||||
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
||||
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
|
||||
|
@ -119,10 +119,9 @@
|
|||
$(function(){
|
||||
|
||||
function init_editor(params){
|
||||
params.textarea.removeAttr('placeholder');
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||
items:['emoticons'],
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
|
||||
items:['emoticons'],
|
||||
afterChange:function(){//按键事件
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
},
|
||||
|
|
|
@ -1835,6 +1835,7 @@ zh:
|
|||
excel_t_score: 教师评分
|
||||
excel_ta_score: 教辅评分
|
||||
excel_n_score: 匿名评分
|
||||
excel_s_score: 系统评分
|
||||
excel_f_score: 成绩
|
||||
excel_commit_time: 提交时间
|
||||
excel_homework_score: 作业积分
|
||||
|
|
|
@ -685,12 +685,18 @@ input#score{ width:40px;}
|
|||
.ui-slider .ui-slider-handle:hover,.ui-slider .ui-slider-handle:focus{background:#64bdd9;}
|
||||
.ui-slider .ui-slider-handle:active{background-image:none;}
|
||||
.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
|
||||
|
||||
/* 编程作品 */
|
||||
.border_ce{ border:1px solid #e4e4e4; }
|
||||
.border_ce tr td{ height:26px; }
|
||||
.td_tit{width:155px; text-align:center;}
|
||||
.td_50{width:50px; text-align:center;}
|
||||
a.work_list_tit{width:610px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.td_tit{width:170px; text-align:center;}
|
||||
.td_50{width:60px; text-align:center;}
|
||||
a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; font-weight:bold; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.work_list_pro{ width:670px;}
|
||||
.border_l{border-left:1px solid #e4e4e4;}
|
||||
.border_t{ border-top:1px solid #e4e4e4;}
|
||||
.td_end{border-top:1px solid #e4e4e4; height:auto; padding:5px; }
|
||||
.c_w{ color:#fff;}
|
||||
|
||||
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.evaluation{position: relative;}
|
||||
|
@ -708,3 +714,5 @@ a:hover.about_me{ color:#0781b4;}
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; h
|
|||
.pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_delete{ display:block; background:url(../images/leftside.png) -1px -157px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
|
||||
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
|
||||
a:hover.pr_info_name{ color:#3ca5c6;}
|
||||
.pr_info_score{ font-size:14px; color:#3e4040; }
|
||||
|
|
|
@ -73,6 +73,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.ml320{ margin-left:320px;}
|
||||
.mr5{ margin-right:5px;}
|
||||
.mr10{ margin-right:10px;}
|
||||
.mr15 {margin-right: 15px;}
|
||||
.mr20{ margin-right:20px;}
|
||||
.mr30{ margin-right:30px;}
|
||||
.mr40{ margin-right:40px;}
|
||||
|
|
|
@ -97,7 +97,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;}
|
|||
/* 个人主页*/
|
||||
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a:hover.gz_btn{ color:#ff5722;}
|
||||
a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:33px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;}
|
||||
a:hover.qx_btn{color:#64bdd9;}
|
||||
a.c_lgrey{ color:#CCC;}
|
||||
a:hover.c_lgrey{ color:#3ca5c6;}
|
||||
|
|
Loading…
Reference in New Issue