Merge branch 'develop' into hjq_new_course
Conflicts: app/models/course_contributor_score.rb app/views/organizations/_org_course_homework.html.erb app/views/users/_homework_search_input.html.erb app/views/users/_show_user_homeworks.html.erb app/views/users/_user_homework_detail.html.erb app/views/users/_user_homework_form.html.erb app/views/users/user_homework_type.js.erb app/views/users/user_homeworks.html.erb app/views/users/user_homeworks.js.erb
This commit is contained in:
commit
6ceb4f4549
|
@ -32,18 +32,20 @@ class AdminController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def projects
|
def projects
|
||||||
|
=begin
|
||||||
@status = params[:status] || 1
|
@status = params[:status] || 1
|
||||||
|
|
||||||
scope = Project.status(@status).order('id asc')
|
scope = Project.status(@status)
|
||||||
scope = scope.like(params[:name]) if params[:name].present?
|
scope = scope.like(params[:name]) if params[:name].present?
|
||||||
@projects = scope.where(project_type: Project::ProjectType_project).all
|
@projects = scope.where(project_type: Project::ProjectType_project).reorder("created_on desc").all
|
||||||
|
=end
|
||||||
|
@projects = Project.like(@name).order('created_on desc')
|
||||||
render :action => "projects", :layout => false if request.xhr?
|
render :action => "projects", :layout => false if request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
def courses
|
def courses
|
||||||
@name = params[:name]
|
@name = params[:name]
|
||||||
@courses = Course.like(@name)
|
@courses = Course.like(@name).order('created_at desc')
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
end
|
end
|
||||||
|
|
|
@ -422,11 +422,12 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def choose_user_course
|
def choose_user_course
|
||||||
|
homework = HomeworkCommon.find params[:homework].to_i
|
||||||
if !params[:search].nil?
|
if !params[:search].nil?
|
||||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||||
@course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
|
@course = @user.courses.where("#{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||||
else
|
else
|
||||||
@course = @user.courses.select { |course| @user.allowed_to?(:as_teacher,course)}
|
@course = @user.courses.where("#{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||||
end
|
end
|
||||||
@search = params[:search]
|
@search = params[:search]
|
||||||
#这里仅仅是传递需要发送的资源id
|
#这里仅仅是传递需要发送的资源id
|
||||||
|
@ -531,7 +532,15 @@ class UsersController < ApplicationController
|
||||||
elsif params[:type] == "2" #我的题库
|
elsif params[:type] == "2" #我的题库
|
||||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc")
|
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||||
end
|
end
|
||||||
|
if params[:property] && params[:property] == "1"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
|
||||||
|
elsif params[:property] && params[:property] == "2"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
|
||||||
|
elsif params[:property] && params[:property] == "3"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
|
||||||
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
|
@property = params[:property]
|
||||||
@limit = 15
|
@limit = 15
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
@hw_count = @homeworks.count
|
@hw_count = @homeworks.count
|
||||||
|
@ -559,10 +568,21 @@ class UsersController < ApplicationController
|
||||||
if(params[:type].blank? || params[:type] == "1") #全部
|
if(params[:type].blank? || params[:type] == "1") #全部
|
||||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc")
|
all_homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'")
|
||||||
|
all_user_ids = all_homeworks.map{|hw| hw.user_id}
|
||||||
|
user_str_ids = search_user_by_name all_user_ids, search
|
||||||
|
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
|
||||||
|
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("created_at desc")
|
||||||
elsif params[:type] == "2" #课程资源
|
elsif params[:type] == "2" #课程资源
|
||||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc")
|
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc")
|
||||||
end
|
end
|
||||||
|
if params[:property] && params[:property] == "1"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
|
||||||
|
elsif params[:property] && params[:property] == "2"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
|
||||||
|
elsif params[:property] && params[:property] == "3"
|
||||||
|
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
|
||||||
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 15
|
@limit = 15
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
|
@ -1518,9 +1538,20 @@ class UsersController < ApplicationController
|
||||||
#@user.save_attachments(params[:attachments],User.current)
|
#@user.save_attachments(params[:attachments],User.current)
|
||||||
# Container_type为Principal
|
# Container_type为Principal
|
||||||
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type])
|
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type])
|
||||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
|
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
if params[:status] == 2
|
||||||
|
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||||
|
elsif params[:status] == "4"
|
||||||
|
@attachments = get_attch_resources params[:id]
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
@attachments = get_principal_resources params[:id]
|
||||||
|
else
|
||||||
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
|
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||||
|
end
|
||||||
elsif params[:type] == "2" # 课程资源
|
elsif params[:type] == "2" # 课程资源
|
||||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||||
elsif params[:type] == "3" # 项目资源
|
elsif params[:type] == "3" # 项目资源
|
||||||
|
@ -1530,10 +1561,21 @@ class UsersController < ApplicationController
|
||||||
elsif params[:type] == "5" #用户资源
|
elsif params[:type] == "5" #用户资源
|
||||||
@attachments = get_principal_resources params[:id]
|
@attachments = get_principal_resources params[:id]
|
||||||
elsif params[:type] == "6" # 公共资源
|
elsif params[:type] == "6" # 公共资源
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
if params[:status] == "2"
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
@attachments = get_course_resources_public( user_course_ids)
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
@attachments = get_project_resources_public(user_project_ids)
|
||||||
|
elsif params[:status] == "4"
|
||||||
|
@attachments = get_attch_resources_public
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
@attachments = get_principal_resources_public
|
||||||
|
else
|
||||||
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
|
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@type = params[:type] || 1
|
@status = params[:status]
|
||||||
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
@atta_count = @attachments.count
|
@atta_count = @attachments.count
|
||||||
|
@ -1558,9 +1600,20 @@ class UsersController < ApplicationController
|
||||||
user_course_ids = User.current.courses.map { |c| c.id}
|
user_course_ids = User.current.courses.map { |c| c.id}
|
||||||
user_project_ids = User.current.projects.map {|p| p.id}
|
user_project_ids = User.current.projects.map {|p| p.id}
|
||||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
|
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
if params[:status] == 2
|
||||||
|
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||||
|
elsif params[:status] == "4"
|
||||||
|
@attachments = get_attch_resources params[:id]
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
@attachments = get_principal_resources params[:id]
|
||||||
|
else
|
||||||
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
|
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids)
|
||||||
|
end
|
||||||
elsif params[:type] == "2" # 课程资源
|
elsif params[:type] == "2" # 课程资源
|
||||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||||
elsif params[:type] == "3" # 项目资源
|
elsif params[:type] == "3" # 项目资源
|
||||||
|
@ -1570,9 +1623,20 @@ class UsersController < ApplicationController
|
||||||
elsif params[:type] == "5" #用户资源
|
elsif params[:type] == "5" #用户资源
|
||||||
@attachments = get_principal_resources params[:id]
|
@attachments = get_principal_resources params[:id]
|
||||||
elsif params[:type] == "6" # 公共资源
|
elsif params[:type] == "6" # 公共资源
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
if params[:status] == "2"
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
@attachments = get_course_resources_public( user_course_ids)
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
@attachments = get_project_resources_public(user_project_ids)
|
||||||
|
elsif params[:status] == "4"
|
||||||
|
@attachments = get_attch_resources_public
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
@attachments = get_principal_resources_public
|
||||||
|
else
|
||||||
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
|
@attachments = get_public_resources(user_course_ids, user_project_ids)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@status = params[:status]
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
|
@ -2320,7 +2384,7 @@ class UsersController < ApplicationController
|
||||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
||||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||||
if params[:status] == 2
|
if params[:status] == "2"
|
||||||
@attachments = get_course_resources(params[:id], user_course_ids)
|
@attachments = get_course_resources(params[:id], user_course_ids)
|
||||||
elsif params[:status] == "3"
|
elsif params[:status] == "3"
|
||||||
@attachments = get_project_resources(params[:id], user_project_ids)
|
@attachments = get_project_resources(params[:id], user_project_ids)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,8 +45,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% project_tree(@projects) do |project, level| %>
|
<% @projects.each do |project| %>
|
||||||
<tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
<tr class="<%= cycle("odd", "even") %>">
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<%= project.id %>
|
<%= project.id %>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="homepageRight mt0 ml10">
|
<div class="homepageRight mt0 ml10">
|
||||||
<div class="homepageRightBanner">
|
<div class="homepageRightBanner">
|
||||||
<div class="NewsBannerName">
|
<div class="NewsBannerName">
|
||||||
课程讨论区
|
课程问答区
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
<% if show_nav?(@course.boards.first ? @course.boards.first.topics.count : 0) %>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f12 c_blue02 ml10 fn" %>
|
||||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") if User.current.member_of_course?(@course) && @course.boards.first %>
|
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if show_nav?(course_feedback_count) %>
|
<% if show_nav?(course_feedback_count) %>
|
||||||
|
|
|
@ -1,138 +1,138 @@
|
||||||
<%#= render :partial => 'users/user_resource_info' %>
|
<%#= render :partial => 'users/user_resource_info' %>
|
||||||
<div class="f16 fb fontBlue mb10">选用资源库中的资源</div>
|
<div class="f16 fb fontBlue mb10">选用资源库中的资源</div>
|
||||||
<div class="subjectList fl mr10"> <a href="javascript:void(0);" class="subjectChoose chooseActive fl">公共资源</a> <a href="javascript:void(0);" class="subjectChoose fl">我的资源</a>
|
<div class="subjectList fl mr10"> <a href="javascript:void(0);" class="subjectChoose chooseActive fl">公共资源</a> <a href="javascript:void(0);" class="subjectChoose fl">我的资源</a>
|
||||||
<input type="text" name="serach" placeholder="输入关键词进行搜索" class="subjectSearch fr" />
|
<input type="text" name="serach" placeholder="输入关键词进行搜索" class="subjectSearch fr" />
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div style="height:441px; min-height:441px; max-height:441px;">
|
<div style="height:441px; min-height:441px; max-height:441px;">
|
||||||
<ul class="subjectBanner mt10">
|
<ul class="subjectBanner mt10">
|
||||||
<li class="subjectName fl hidden"><span style="padding-left:15px;">资源名称</span></li>
|
<li class="subjectName fl hidden"><span style="padding-left:15px;">资源名称</span></li>
|
||||||
<li class="subjectType fl">类别</li>
|
<li class="subjectType fl">类别</li>
|
||||||
<li class="subjectCount fl">大小</li>
|
<li class="subjectCount fl">大小</li>
|
||||||
<li class="subjectPublisher fl">上传者</li>
|
<li class="subjectPublisher fl">上传者</li>
|
||||||
<li class="fl subjectDate">上传时间</li>
|
<li class="fl subjectDate">上传时间</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">项目资源</li>
|
<li class="subjectType fl">项目资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">附件</li>
|
<li class="subjectType fl">附件</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="subjectRow">
|
<ul class="subjectRow">
|
||||||
<li class="subjectName fl hidden">
|
<li class="subjectName fl hidden">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
|
||||||
<span>123456.jpg</span></label>
|
<span>123456.jpg</span></label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subjectType fl">课程资源</li>
|
<li class="subjectType fl">课程资源</li>
|
||||||
<li class="subjectCount fl">123.0KB</li>
|
<li class="subjectCount fl">123.0KB</li>
|
||||||
<li class="subjectPublisher fl">尹刚</li>
|
<li class="subjectPublisher fl">尹刚</li>
|
||||||
<li class="fl subjectDate">2016-01-21</li>
|
<li class="fl subjectDate">2016-01-21</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">选用</a></div>
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">选用</a></div>
|
||||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
|
||||||
<div class="pageRoll mt0">
|
<div class="pageRoll mt0">
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">上一页</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">上一页</a></div>
|
||||||
<div class="pageCell pageCellActive"><a href="javascript:void(0);" class="c_white">1</a></div>
|
<div class="pageCell pageCellActive"><a href="javascript:void(0);" class="c_white">1</a></div>
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">2</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">2</a></div>
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">3</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">3</a></div>
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">...</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">...</a></div>
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">14</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">14</a></div>
|
||||||
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">下一页</a></div>
|
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">下一页</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<% homework_num = @course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
|
<% homework_num = @course.homework_commons.where("publish_time <= '#{Date.today}'").count %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>
|
<title>
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
|
||||||
<%= link_to "(#{@course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
<%= link_to "(#{@course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0})", course_boards_path(@course), :class => "subnav_num c_orange" %>
|
||||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") if User.current.member_of_course?(@course) && @course.boards.first %>
|
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}") %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% unless show_nav?(course_feedback_count) %>
|
<% unless show_nav?(course_feedback_count) %>
|
||||||
|
@ -142,32 +142,55 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% unless contributor_course_scor(@course.id).count == 0 %>
|
<% unless contributor_course_scor(@course.id).count == 0 %>
|
||||||
<ul class="rankList">
|
<ul class="rankList">
|
||||||
<h4>课程活跃度</h4>
|
<h4>课程活跃度<a style="float: right; color: #7f7f7f; font-size: 12px;" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))">积分规则</a></h4>
|
||||||
|
<div style="display: none" class="numIntro">
|
||||||
|
<div style="padding-left: 35px; font-size: 14px;color: #3b3b3b">积分规则</div>
|
||||||
|
资源得分:资源数 x 5 </br>
|
||||||
|
发帖得分:发帖数 x 2 </br>
|
||||||
|
回帖得分:回复数 x 1 </br>
|
||||||
|
课程留言得分:留言数 x 1 </br>
|
||||||
|
作业留言得分:留言数 x 1 </br>
|
||||||
|
通知得分:通知数 x 1 </br>
|
||||||
|
总得分为以上得分之和
|
||||||
|
</div>
|
||||||
|
|
||||||
<% contributor_course_scor(@course.id).each do |contributor_score| %>
|
<% contributor_course_scor(@course.id).each do |contributor_score| %>
|
||||||
<% unless contributor_score.total_score ==0 %>
|
<% unless contributor_score.total_score ==0 %>
|
||||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %></a>
|
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %></a>
|
||||||
<p><a href="javascript:void:(0);"><%=link_to contributor_score.user.show_name, user_path(contributor_score.user), :title => contributor_score.user.show_name %></a></p>
|
<p><a href="javascript:void:(0);"><%=link_to contributor_score.user.show_name, user_path(contributor_score.user), :title => contributor_score.user.show_name %></a></p>
|
||||||
<p><span class="c_green" style="cursor:pointer">
|
<p><span class="c_green" style="cursor:pointer">
|
||||||
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green"><%= contributor_score.total_score.to_i %></a></span></p>
|
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green">
|
||||||
|
<%=total_score = contributor_score.resource_num.to_i * 5 + contributor_score.message_num.to_i * 2 +
|
||||||
|
contributor_score.message_reply_num.to_i * 1 + contributor_score.journal_num.to_i * 1 +
|
||||||
|
+ contributor_score.homework_journal_num * 1 + contributor_score.news_reply_num.to_i * 1 %></a></span></p>
|
||||||
<div style="display: none" class="numIntro">
|
<div style="display: none" class="numIntro">
|
||||||
<% unless contributor_score.resource_num == 0 %>
|
<!--<div style="display: none" class="message_title_red system_message_style">-->
|
||||||
课程资源:<%= contributor_score.resource_num %><br />
|
<!--<p><strong>评论对象:</strong><%#= ma.course_message.commented.title %></p>-->
|
||||||
<% end %>
|
<!--<%# unless ma.course_message.comments.nil? %>-->
|
||||||
<% unless contributor_score.message_num == 0 %>
|
<!--<div class="fl"><strong>评论内容:</strong></div>-->
|
||||||
课程讨论:<%= contributor_score.message_num %><br />
|
<!--<div class="ml60"><%#= ma.course_message.comments.html_safe %></div>-->
|
||||||
<% end %>
|
<!--<%# end %>-->
|
||||||
<% unless contributor_score.message_reply_num == 0 %>
|
<!--</div>-->
|
||||||
评论回复:<%= contributor_score.message_reply_num %><br />
|
<div style="padding-left: 65px; font-size: 14px;color: #3b3b3b">积分计算</div>
|
||||||
<% end %>
|
<%# unless contributor_score.resource_num.to_i == 0 %>
|
||||||
<% unless contributor_score.journal_num == 0 %>
|
课程资源:资源数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br>
|
||||||
课程留言:<%= contributor_score.journal_num %><br />
|
<%# end %>
|
||||||
<% end %>
|
<%# unless contributor_score.message_num.to_i == 0 %>
|
||||||
<% unless contributor_score.homework_journal_num == 0 %>
|
课程讨论:发帖数 x 2 = <%= contributor_score.message_num.to_i %> x 2 = <%= contributor_score.message_num.to_i * 2 %></br>
|
||||||
作业留言:<%= contributor_score.homework_journal_num %><br />
|
<%# end %>
|
||||||
<% end %>
|
<%# unless contributor_score.message_reply_num.to_i == 0 %>
|
||||||
<% unless contributor_score.news_reply_num == 0 %>
|
评论回复:回复数 x 1 = <%= contributor_score.message_reply_num.to_i %> x 1 = <%= contributor_score.message_reply_num.to_i %></br>
|
||||||
课程通知:<%= contributor_score.news_reply_num %><br />
|
<%# end %>
|
||||||
<% end %>
|
<%# unless contributor_score.journal_num.to_i == 0 %>
|
||||||
|
课程留言:留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
|
||||||
|
<%# end %>
|
||||||
|
<%# unless contributor_score.homework_journal_num.to_i == 0 %>
|
||||||
|
作业留言:留言数 x 1 = <%= contributor_score.homework_journal_num.to_i %> x 1 = <%= contributor_score.homework_journal_num.to_i %></br>
|
||||||
|
<%# end %>
|
||||||
|
<%# unless contributor_score.news_reply_num.to_i == 0 %>
|
||||||
|
课程通知:通知数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
|
||||||
|
<%# end %>
|
||||||
|
总得分:<%=total_score %>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -179,12 +202,12 @@
|
||||||
<% hero_homework_scores = hero_homework_score(@course, "desc") %>
|
<% hero_homework_scores = hero_homework_score(@course, "desc") %>
|
||||||
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
||||||
<ul class="rankList">
|
<ul class="rankList">
|
||||||
<h4>课程英雄榜</h4>
|
<h4><span>课程英雄榜</span><a style="float: right; color: #7f7f7f; font-size: 12px;" title="英雄榜的得分是每个同学作业的得分总和">积分规则</a></h4>
|
||||||
<% hero_homework_scores.each do |student_score| %>
|
<% hero_homework_scores.each do |student_score| %>
|
||||||
<% if student_score.score.to_i != 0 %>
|
<% if student_score.score.to_i != 0 %>
|
||||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
|
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
|
||||||
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
|
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
|
||||||
<p><span class="c_red" style="cursor:pointer" title="作业总分:<%= format("%.1f",student_score.score<0 ? 0 : student_score.score) %>"><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
|
<p><span class="c_red" style="cursor:pointer" title="英雄榜的得分是每个同学作业的得分总和"><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -303,6 +326,16 @@
|
||||||
obj.parent().parent().next("div").hide();
|
obj.parent().parent().next("div").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function message_titile_show2(obj,e)
|
||||||
|
{
|
||||||
|
obj.parent().next("div").show();
|
||||||
|
obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
|
||||||
|
}
|
||||||
|
function message_titile_hide2(obj)
|
||||||
|
{
|
||||||
|
obj.parent().next("div").hide();
|
||||||
|
}
|
||||||
|
|
||||||
$("#expand_tools_expand").click(function(){
|
$("#expand_tools_expand").click(function(){
|
||||||
$("#navContentCourse").toggle();
|
$("#navContentCourse").toggle();
|
||||||
});
|
});
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.student_works.count != 0 %>
|
<% if activity.student_works.count != 0 %>
|
||||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -139,30 +139,36 @@
|
||||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
|
||||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
|
||||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
|
||||||
</a>
|
|
||||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
|
||||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
|
||||||
</div>
|
|
||||||
<% if i == 4 %>
|
|
||||||
<% break %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% if student_works.count > 5 %>
|
|
||||||
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if activity.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||||
|
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
||||||
|
</a>
|
||||||
|
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||||
|
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||||
|
</div>
|
||||||
|
<% if i == 4 %>
|
||||||
|
<% break %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if student_works.count > 5 %>
|
||||||
|
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||||
|
@ -239,7 +245,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink",
|
||||||
|
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品",:remote => true)%>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
||||||
|
|
|
@ -1,159 +1,159 @@
|
||||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word mt-4">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden m_w530 fl">
|
<div class="homepagePostTitle hidden m_w530 fl">
|
||||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% if activity.sticky == 1%>
|
<% if activity.sticky == 1%>
|
||||||
<span class="sticky_btn_cir ml10">置顶</span>
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if activity.locked%>
|
<% if activity.locked%>
|
||||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate fl">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate fl ml15">
|
<div class="homepagePostDate fl ml15">
|
||||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
<% content = activity.content%>
|
<% content = activity.content%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% content = activity.parent.content%>
|
<% content = activity.parent.content%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="mt10" style="font-weight:normal;">
|
<div class="mt10" style="font-weight:normal;">
|
||||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count=0 %>
|
<% count=0 %>
|
||||||
<% if activity.parent %>
|
<% if activity.parent %>
|
||||||
<% count=activity.parent.children.count%>
|
<% count=activity.parent.children.count%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<% if activity.author == User.current %>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
<%if count > 3 %>
|
<%if count > 3 %>
|
||||||
<div class="homepagePostReplyBannerMore">
|
<div class="homepagePostReplyBannerMore">
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
展开更多
|
展开更多
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% activity= activity.parent ? activity.parent : activity%>
|
<% activity= activity.parent ? activity.parent : activity%>
|
||||||
<% replies_all_i = 0 %>
|
<% replies_all_i = 0 %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<ul>
|
<ul>
|
||||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||||
<div class="homepagePostReplyPortrait">
|
<div class="homepagePostReplyPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher mt-4">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<% if reply.author == User.current %>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe %>
|
<%= reply.content.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||||
<div class="homepagePostReplyInputContainer mb10">
|
<div class="homepagePostReplyInputContainer mb10">
|
||||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||||
<input type="hidden" name="quote[quote]" value="">
|
<input type="hidden" name="quote[quote]" value="">
|
||||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
||||||
<% if is_project_manager?(User.current, @project) %>
|
<% if is_project_manager?(User.current, @project) %>
|
||||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
||||||
<%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %>
|
<%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="member_content">
|
<div class="member_content">
|
||||||
<%= error_messages_for 'member' %>
|
<%= error_messages_for 'member' %>
|
||||||
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,126 +1,126 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
<%if @select_tab %>
|
<%if @select_tab %>
|
||||||
<% if @select_tab == "modules" %>
|
<% if @select_tab == "modules" %>
|
||||||
project_setting(2);
|
project_setting(2);
|
||||||
<% elsif @select_tab == "members" %>
|
<% elsif @select_tab == "members" %>
|
||||||
project_setting(3);
|
project_setting(3);
|
||||||
<% elsif @select_tab == "versions" %>
|
<% elsif @select_tab == "versions" %>
|
||||||
project_setting(4);
|
project_setting(4);
|
||||||
$("#pro_st_edit_ban").toggle();
|
$("#pro_st_edit_ban").toggle();
|
||||||
<% elsif @select_tab == "repositories" %>
|
<% elsif @select_tab == "repositories" %>
|
||||||
project_setting(6);
|
project_setting(6);
|
||||||
$("#pro_st_edit_ku").toggle();
|
$("#pro_st_edit_ku").toggle();
|
||||||
<% else %>
|
<% else %>
|
||||||
project_setting(5);
|
project_setting(5);
|
||||||
<% end%>
|
<% end%>
|
||||||
<% end%>
|
<% end%>
|
||||||
$("div[nhname='pro_setting']").show();
|
$("div[nhname='pro_setting']").show();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2">配置</h2>
|
<h2 class="project_h2">配置</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--通过admin界面配置,不同角色显示不同的模块-->
|
<!--通过admin界面配置,不同角色显示不同的模块-->
|
||||||
<div class=" pro_setting" nhname="pro_setting" style="display:none;">
|
<div class=" pro_setting" nhname="pro_setting" style="display:none;">
|
||||||
<div id="pro_st_tb_" class="pro_st_tb_">
|
<div id="pro_st_tb_" class="pro_st_tb_">
|
||||||
<ul>
|
<ul>
|
||||||
<% show_memu = show_project_memu User.current%>
|
<% show_memu = show_project_memu User.current%>
|
||||||
<% if User.current.allowed_to?(:edit_project, @project) %>
|
<% if User.current.allowed_to?(:edit_project, @project) %>
|
||||||
<li id="pro_st_tb_1" class="<%= show_memu == 'edit_project' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(1);">信息</li>
|
<li id="pro_st_tb_1" class="<%= show_memu == 'edit_project' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(1);">信息</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.allowed_to?(:select_project_modules, @project) %>
|
<% if User.current.allowed_to?(:select_project_modules, @project) %>
|
||||||
<li id="pro_st_tb_2" class="<%= show_memu == 'select_project_modules' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(2);">模块</li>
|
<li id="pro_st_tb_2" class="<%= show_memu == 'select_project_modules' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(2);">模块</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.allowed_to?(:manage_members, @project) %>
|
<% if User.current.allowed_to?(:manage_members, @project) %>
|
||||||
<li id="pro_st_tb_3" class="<%= show_memu == 'manage_members' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(3);">成员</li>
|
<li id="pro_st_tb_3" class="<%= show_memu == 'manage_members' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(3);">成员</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li>
|
<li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li>
|
||||||
<% if User.current.allowed_to?(:manage_versions, @project) %>
|
<% if User.current.allowed_to?(:manage_versions, @project) %>
|
||||||
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li>
|
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>-->
|
<!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>-->
|
||||||
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
||||||
<li id="pro_st_tb_6" class="<%= show_memu == 'manage_repository' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(6);">版本库</li>
|
<li id="pro_st_tb_6" class="<%= show_memu == 'manage_repository' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(6);">版本库</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--<li id="pro_st_tb_7" class="pro_st_normaltab" onclick="project_setting(7);">活动(时间跟踪)</li>-->
|
<!--<li id="pro_st_tb_7" class="pro_st_normaltab" onclick="project_setting(7);">活动(时间跟踪)</li>-->
|
||||||
<!--<li id="pro_st_tb_8" class="pro_st_normaltab" onclick="project_setting(8);">代码评审</li>-->
|
<!--<li id="pro_st_tb_8" class="pro_st_normaltab" onclick="project_setting(8);">代码评审</li>-->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div><!--tb_ end-->
|
</div><!--tb_ end-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<div class="pro_st_ctt">
|
<div class="pro_st_ctt">
|
||||||
<div class="<%= show_memu == 'edit_project' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_01">
|
<div class="<%= show_memu == 'edit_project' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_01">
|
||||||
<%= render :partial=>"projects/settings/new_edit" if User.current.allowed_to?(:edit_project, @project)%>
|
<%= render :partial=>"projects/settings/new_edit" if User.current.allowed_to?(:edit_project, @project)%>
|
||||||
</div><!--tbc_01 end-->
|
</div><!--tbc_01 end-->
|
||||||
|
|
||||||
<div class="<%= show_memu == 'select_project_modules' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_02">
|
<div class="<%= show_memu == 'select_project_modules' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_02">
|
||||||
<%= render :partial=>"projects/settings/new_modules" if User.current.allowed_to?(:select_project_modules, @project)%>
|
<%= render :partial=>"projects/settings/new_modules" if User.current.allowed_to?(:select_project_modules, @project)%>
|
||||||
</div><!--tbc_02 end-->
|
</div><!--tbc_02 end-->
|
||||||
|
|
||||||
<div class="<%= show_memu == 'manage_members' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_03">
|
<div class="<%= show_memu == 'manage_members' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_03">
|
||||||
<%= render :partial=>"projects/settings/new_members" if User.current.allowed_to?(:manage_members, @project)%>
|
<%= render :partial=>"projects/settings/new_members" if User.current.allowed_to?(:manage_members, @project)%>
|
||||||
</div><!--tbc_03 end-->
|
</div><!--tbc_03 end-->
|
||||||
|
|
||||||
|
|
||||||
<div class="<%= show_memu == 'manage_versions' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_04">
|
<div class="<%= show_memu == 'manage_versions' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_04">
|
||||||
<%= render :partial=>"projects/settings/new_versions" if User.current.allowed_to?(:manage_versions, @project)%>
|
<%= render :partial=>"projects/settings/new_versions" if User.current.allowed_to?(:manage_versions, @project)%>
|
||||||
</div><!--tbc_04 end-->
|
</div><!--tbc_04 end-->
|
||||||
|
|
||||||
<!--<div class="pro_st_undis" id="pro_st_tbc_05">-->
|
<!--<div class="pro_st_undis" id="pro_st_tbc_05">-->
|
||||||
<!--<%#= render :partial=>"projects/settings/new_issue_categories" %>-->
|
<!--<%#= render :partial=>"projects/settings/new_issue_categories" %>-->
|
||||||
<!--</div><!–tbc_05 end–>-->
|
<!--</div><!–tbc_05 end–>-->
|
||||||
<div class="<%= show_memu == 'join_org' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_05">
|
<div class="<%= show_memu == 'join_org' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_05">
|
||||||
<%= render :partial=>"projects/settings/join_org" %>
|
<%= render :partial=>"projects/settings/join_org" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="<%= show_memu == 'manage_repository' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_06">
|
<div class="<%= show_memu == 'manage_repository' ? 'pro_st_dis' : 'pro_st_undis'%>" id="pro_st_tbc_06">
|
||||||
<%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%>
|
<%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%>
|
||||||
</div><!--tbc_06 end-->
|
</div><!--tbc_06 end-->
|
||||||
|
|
||||||
<!--<div class="pro_st_undis" id="pro_st_tbc_07">-->
|
<!--<div class="pro_st_undis" id="pro_st_tbc_07">-->
|
||||||
<!--<%#= render :partial=>"projects/settings/new_activities" %>-->
|
<!--<%#= render :partial=>"projects/settings/new_activities" %>-->
|
||||||
<!--</div><!–tbc_07 end–>-->
|
<!--</div><!–tbc_07 end–>-->
|
||||||
|
|
||||||
<!--代码评审先不做-->
|
<!--代码评审先不做-->
|
||||||
<!--<div class="pro_st_undis" id="pro_st_tbc_08">-->
|
<!--<div class="pro_st_undis" id="pro_st_tbc_08">-->
|
||||||
<!--<div class="box f14">-->
|
<!--<div class="box f14">-->
|
||||||
<!--<ul>-->
|
<!--<ul>-->
|
||||||
<!--<li><label for="setting_tracker_in_review_dialog">允许创建代码审查时选择跟踪者?<span class="required"> </span></label></li>-->
|
<!--<li><label for="setting_tracker_in_review_dialog">允许创建代码审查时选择跟踪者?<span class="required"> </span></label></li>-->
|
||||||
<!--<li><b>设置代码评审的默认跟踪标签:</b></li>-->
|
<!--<li><b>设置代码评审的默认跟踪标签:</b></li>-->
|
||||||
<!--<li><label for="setting_tracker_id">跟踪<span class="c_red"> *</span></label>-->
|
<!--<li><label for="setting_tracker_id">跟踪<span class="c_red"> *</span></label>-->
|
||||||
<!--<select id="setting_tracker_id" name="setting[tracker_id]">-->
|
<!--<select id="setting_tracker_id" name="setting[tracker_id]">-->
|
||||||
<!--<option value="1" selected="selected">缺陷</option>-->
|
<!--<option value="1" selected="selected">缺陷</option>-->
|
||||||
<!--<option value="2">功能</option>-->
|
<!--<option value="2">功能</option>-->
|
||||||
<!--<option value="3">支持</option>-->
|
<!--<option value="3">支持</option>-->
|
||||||
<!--<option value="4">任务</option>-->
|
<!--<option value="4">任务</option>-->
|
||||||
<!--</select></li>-->
|
<!--</select></li>-->
|
||||||
<!--<li>-->
|
<!--<li>-->
|
||||||
<!--<label for="setting_hide_code_review_tab">隐藏代码评审页<span class="required"> </span></label>-->
|
<!--<label for="setting_hide_code_review_tab">隐藏代码评审页<span class="required"> </span></label>-->
|
||||||
<!--<input name="setting[hide_code_review_tab]" type="hidden" value="0"><input id="setting_hide_code_review_tab" name="setting[hide_code_review_tab]" type="checkbox" value="1">-->
|
<!--<input name="setting[hide_code_review_tab]" type="hidden" value="0"><input id="setting_hide_code_review_tab" name="setting[hide_code_review_tab]" type="checkbox" value="1">-->
|
||||||
<!--</li>-->
|
<!--</li>-->
|
||||||
<!--<li>-->
|
<!--<li>-->
|
||||||
<!--<label>若修订存在问题:</label>-->
|
<!--<label>若修订存在问题:</label>-->
|
||||||
<!--<input checked="checked" id="setting_auto_relation_1" name="setting[auto_relation]" type="radio" value="1">-->
|
<!--<input checked="checked" id="setting_auto_relation_1" name="setting[auto_relation]" type="radio" value="1">-->
|
||||||
<!--与之相关的评审问题-->
|
<!--与之相关的评审问题-->
|
||||||
|
|
||||||
<!--<input id="setting_auto_relation_2" name="setting[auto_relation]" type="radio" value="2">-->
|
<!--<input id="setting_auto_relation_2" name="setting[auto_relation]" type="radio" value="2">-->
|
||||||
<!--与之无关的评审问题-->
|
<!--与之无关的评审问题-->
|
||||||
|
|
||||||
<!--<input id="setting_auto_relation_0" name="setting[auto_relation]" type="radio" value="0">-->
|
<!--<input id="setting_auto_relation_0" name="setting[auto_relation]" type="radio" value="0">-->
|
||||||
<!--什么也不做-->
|
<!--什么也不做-->
|
||||||
<!--</li>-->
|
<!--</li>-->
|
||||||
<!--<li>-->
|
<!--<li>-->
|
||||||
<!--<label>自动分派</label>-->
|
<!--<label>自动分派</label>-->
|
||||||
<!--<input id="auto_assign_enabled" name="auto_assign[enabled]" onchange="setAutoAssignSettingFormEnable();" type="checkbox" value="true">激活-->
|
<!--<input id="auto_assign_enabled" name="auto_assign[enabled]" onchange="setAutoAssignSettingFormEnable();" type="checkbox" value="true">激活-->
|
||||||
<!--</li>-->
|
<!--</li>-->
|
||||||
<!--</ul>-->
|
<!--</ul>-->
|
||||||
<!--<a href="javascript:viod(0)" class="blue_btn">保存</a>-->
|
<!--<a href="javascript:viod(0)" class="blue_btn">保存</a>-->
|
||||||
<!--</div>-->
|
<!--</div>-->
|
||||||
<!--</div><!–tbc_08 end–>-->
|
<!--</div><!–tbc_08 end–>-->
|
||||||
|
|
||||||
</div><!--ctt end-->
|
</div><!--ctt end-->
|
||||||
</div><!--pro_setting end-->
|
</div><!--pro_setting end-->
|
||||||
|
|
|
@ -41,12 +41,12 @@
|
||||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
|
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" name="student_work[name]" id="student_work_name" placeholder="请简洁的概括作品的功能或特性" class="InputBox W700" maxlength="200" onkeyup="regexStudentWorkName();" value="<%= @work.name%>">
|
<input type="text" name="student_work[name]" id="student_work_name" placeholder="请输入作品名称" class="InputBox W700" maxlength="200" onkeyup="regexStudentWorkName();" value="<%= @work.name%>">
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<textarea name="student_work[description]" id="student_work_description" placeholder="请介绍你的作品" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea>
|
<textarea name="student_work[description]" id="student_work_description" placeholder="请输入作品描述" class="InputBox W700 H150" maxlength="6000" onkeyup="regexStudentWorkDescription();"><%= @work.description%></textarea>
|
||||||
<script>
|
<script>
|
||||||
var text = document.getElementById("student_work_description");
|
var text = document.getElementById("student_work_description");
|
||||||
autoTextarea(text);// 调用
|
autoTextarea(text);// 调用
|
||||||
|
|
|
@ -127,12 +127,12 @@
|
||||||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div>
|
<div>
|
||||||
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请简洁的概括作品的功能或特性", :onkeyup => "regexStudentWorkName();" %>
|
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称", :onkeyup => "regexStudentWorkName();" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请介绍你的作品", :onkeyup => "regexStudentWorkDescription();"%>
|
<%= f.text_area "description", :class => "InputBox W700 H150", :placeholder => "请输入作品描述", :onkeyup => "regexStudentWorkDescription();"%>
|
||||||
<script>
|
<script>
|
||||||
var text = document.getElementById("student_work_description");
|
var text = document.getElementById("student_work_description");
|
||||||
autoTextarea(text);// 调用
|
autoTextarea(text);// 调用
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.student_works.count != 0 %>
|
<% if activity.student_works.count != 0 %>
|
||||||
<% sw = activity.student_works.reorder("created_at desc").first %>
|
<% sw = activity.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -138,30 +138,36 @@
|
||||||
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
<% student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
|
||||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
|
||||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
|
||||||
</a>
|
|
||||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
|
||||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
|
||||||
</div>
|
|
||||||
<% if i == 4 %>
|
|
||||||
<% break %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% if student_works.count > 5 %>
|
|
||||||
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if activity.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => activity.id), :alt => "学生头像" %>
|
||||||
|
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => activity.id)%></p>
|
||||||
|
</a>
|
||||||
|
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||||
|
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||||
|
</div>
|
||||||
|
<% if i == 4 %>
|
||||||
|
<% break %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if student_works.count > 5 %>
|
||||||
|
<%= link_to "更多>>", student_work_index_path(:homework => activity.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %>
|
||||||
|
@ -238,7 +244,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
|
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink",
|
||||||
|
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
||||||
|
|
|
@ -1,194 +1,194 @@
|
||||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
|
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<% if activity.status == 1 %>
|
<% if activity.status == 1 %>
|
||||||
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
|
<%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word mt-4">
|
||||||
<% if activity.status == 1 %>
|
<% if activity.status == 1 %>
|
||||||
<span class="fontBlue2">确实团队</span>
|
<span class="fontBlue2">确实团队</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden m_w530 fl">
|
<div class="homepagePostTitle hidden m_w530 fl">
|
||||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% if activity.sticky == 1%>
|
<% if activity.sticky == 1%>
|
||||||
<span class="sticky_btn_cir ml10">置顶</span>
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% if activity.locked%>
|
<% if activity.locked%>
|
||||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate fl">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate fl ml15">
|
<div class="homepagePostDate fl ml15">
|
||||||
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
<% content = activity.content%>
|
<% content = activity.content%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% content = activity.parent.content%>
|
<% content = activity.parent.content%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||||
<% if activity.status == 1 %>
|
<% if activity.status == 1 %>
|
||||||
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.year %></span>
|
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.year %></span>
|
||||||
<span style="font-size:10.5000pt;">年</span>
|
<span style="font-size:10.5000pt;">年</span>
|
||||||
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.month %></span>
|
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.month %></span>
|
||||||
<span style="font-size:10.5000pt;">月</span>
|
<span style="font-size:10.5000pt;">月</span>
|
||||||
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.day %></span>
|
<span style="font-family:Calibri;font-size:10.5000pt;"><%= activity.created_on.day %></span>
|
||||||
<span style="font-size:10.5000pt;">日</span>
|
<span style="font-size:10.5000pt;">日</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="mt10" style="font-weight:normal;">
|
<div class="mt10" style="font-weight:normal;">
|
||||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
|
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<% if activity.author.id == User.current.id%>
|
<% if activity.author.id == User.current.id%>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_edit),
|
l(:button_edit),
|
||||||
edit_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
edit_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
||||||
:class => 'postOptionLink'
|
:class => 'postOptionLink'
|
||||||
) if activity.course_editable_by?(User.current) %>
|
) if activity.course_editable_by?(User.current) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
delete_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
delete_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
||||||
:method => :post,
|
:method => :post,
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:class => 'postOptionLink'
|
:class => 'postOptionLink'
|
||||||
) if activity.course_destroyable_by?(User.current) %>
|
) if activity.course_destroyable_by?(User.current) %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
|
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% count=0 %>
|
<% count=0 %>
|
||||||
<% if activity.parent %>
|
<% if activity.parent %>
|
||||||
<% count=activity.parent.children.count%>
|
<% count=activity.parent.children.count%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="homepagePostReplyBanner">
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<% if activity.author == User.current %>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
<%if count > 3 %>
|
<%if count > 3 %>
|
||||||
<div class="homepagePostReplyBannerMore">
|
<div class="homepagePostReplyBannerMore">
|
||||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
展开更多
|
展开更多
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% activity= activity.parent ? activity.parent : activity%>
|
<% activity= activity.parent ? activity.parent : activity%>
|
||||||
<% replies_all_i = 0 %>
|
<% replies_all_i = 0 %>
|
||||||
<% if count > 0 %>
|
<% if count > 0 %>
|
||||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
<ul>
|
<ul>
|
||||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||||
<div class="homepagePostReplyPortrait">
|
<div class="homepagePostReplyPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher mt-4">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<% if reply.author == User.current %>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
<%= reply.content.html_safe %>
|
<%= reply.content.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||||
<div class="homepagePostReplyInputContainer mb10">
|
<div class="homepagePostReplyInputContainer mb10">
|
||||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%>
|
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%>
|
||||||
<input type="hidden" name="quote[quote]" value="">
|
<input type="hidden" name="quote[quote]" value="">
|
||||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div id="popbox02">
|
||||||
|
<div class="ni_con">
|
||||||
|
<p style="display: block;font-size: 14px;margin-left: 30px;margin-top: 20px;">
|
||||||
|
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
|
||||||
|
</p>
|
||||||
|
<div class="ni_btn">
|
||||||
|
<a href="javascript:void(0)" class="tijiao c_white ml45" onclick="hideModal();">
|
||||||
|
确 定
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<input type="text" name="search" placeholder="输入作业、老师姓名的关键词进行搜索" class="subject-pop-search fr" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
var lastSearchCondition = '';
|
||||||
|
var count = 0;
|
||||||
|
function search_hws(e){
|
||||||
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastSearchCondition = $(e.target).val().trim();
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'users', :action => 'user_search_homeworks') %>'+'?name='+ e.target.value+'&type=<%=type %>&is_import=<%=is_import %>&property=<%=property %>',
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function throttle(method,context,e){
|
||||||
|
clearTimeout(method.tId);
|
||||||
|
method.tId=setTimeout(function(){
|
||||||
|
method.call(context,e);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询项目
|
||||||
|
$("input[name='search']").on('input', function (e) {
|
||||||
|
throttle(search_hws,window,e);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -1,4 +1,4 @@
|
||||||
<input type="text" name="search" placeholder="输入关键词进行搜索" class="subject-pop-search fr" />
|
<input type="text" name="search" placeholder="输入作业、老师姓名的关键词进行搜索" class="subject-pop-search fr" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchCondition = '';
|
var lastSearchCondition = '';
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<%= form_tag( url_for(:controller => 'users', :action => 'resource_search', :id => user.id),
|
<%= form_tag( url_for(:controller => 'users', :action => 'resource_search', :id => user.id),
|
||||||
:remote => true , :method => 'get', :class => 'resourcesSearchloadBox mt10', :id => 'resource_search_form') do %>
|
:remote => true , :method => 'get', :class => 'resourcesSearchloadBox mt10', :id => 'resource_search_form') do %>
|
||||||
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchResource" />
|
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchResource" />
|
||||||
<%= hidden_field_tag(:type,type.nil? ? 1 : type) %>
|
<%= hidden_field_tag(:type,type.nil? ? 1 : type) %>
|
||||||
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none' %>
|
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none' %>
|
||||||
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,27 +1,374 @@
|
||||||
<% if attachments.nil? || attachments.empty? %>
|
<% if attachments.nil? || attachments.empty? %>
|
||||||
<!--<p class="nodata">-->
|
<!--<p class="nodata">-->
|
||||||
<!--<%#= l(:label_no_data) %>-->
|
<!--<%#= l(:label_no_data) %>-->
|
||||||
<!--</p>-->
|
<!--</p>-->
|
||||||
<% else %>
|
<% else %>
|
||||||
<% attachments.each do |attach| %>
|
<% attachments.each do |attach| %>
|
||||||
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
|
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
|
||||||
<li class="resource-list-checkbox fl">
|
<li class="resource-list-checkbox fl">
|
||||||
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||||
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
|
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
|
||||||
</li>
|
</li>
|
||||||
<li class="resource-list-name fl hidden">
|
<li class="resource-list-name fl hidden">
|
||||||
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack' %>
|
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack' %>
|
||||||
</li>
|
</li>
|
||||||
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
|
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
|
||||||
<li class="resource-list-quote fr"><%= attach.quotes.nil? ? 0 : attach.quotes %></li>
|
<li class="resource-list-quote fr"><%= attach.quotes.nil? ? 0 : attach.quotes %></li>
|
||||||
<li class="resource-list-download fr"><%= attach.downloads %></li>
|
<li class="resource-list-download fr"><%= attach.downloads %></li>
|
||||||
<li style="display: none"><%= attach.author_id %></li>
|
<li style="display: none"><%= attach.author_id %></li>
|
||||||
<li class="resource-list-size fr"><%= number_to_human_size(attach.filesize) %></li>
|
<li class="resource-list-size fr"><%= number_to_human_size(attach.filesize) %></li>
|
||||||
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
|
||||||
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
|
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
|
||||||
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
|
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
|
||||||
<li style="display: none"><%= attach.id %></li>
|
<li style="display: none"><%= attach.id %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var pageX = 0;
|
||||||
|
var pageY = 0;
|
||||||
|
//当前选中的行
|
||||||
|
var line;
|
||||||
|
//已经选中的行,和当前选中的行的区别是:右键选中为line,换一行右键后,line变为last_line,line变为换行后的line
|
||||||
|
var last_line;
|
||||||
|
//资源名称
|
||||||
|
var res_name;
|
||||||
|
//资源名称的链接
|
||||||
|
var res_link;
|
||||||
|
var id; //资源id
|
||||||
|
var sendType = '1'; //发送到课程 1 发送到项目 2
|
||||||
|
var lastSendType; //保存上次发送的发送类型
|
||||||
|
$("#resources_list").mousedown(function(e) {
|
||||||
|
//如果是右键的话
|
||||||
|
if (3 == e.which) {
|
||||||
|
if( $("#res_name").length != 0 || $("#ajax-indicator").is(":hidden") == false){ //其他ajax在执行的时候阻止操作
|
||||||
|
e.preventDefault();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
document.oncontextmenu = function() {return false;}
|
||||||
|
pageX = e.clientX;
|
||||||
|
pageY = e.clientY;
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
$("#contextMenu").attr("style","display: block; position: fixed; top:"
|
||||||
|
+ pageY
|
||||||
|
+ "px; left:"
|
||||||
|
+ pageX
|
||||||
|
+ "px; width: 80px;");
|
||||||
|
$("#contextMenu").show();
|
||||||
|
//当前光标所在的对象
|
||||||
|
|
||||||
|
var ele = document.elementFromPoint(pageX,pageY);
|
||||||
|
//转换为jquery对象
|
||||||
|
line = $(ele).parent();
|
||||||
|
//如果上一条存在被选中,那么将上一条的背景色改为白色
|
||||||
|
if(last_line != null){
|
||||||
|
last_line.children().css("background-color", 'white');
|
||||||
|
restore();
|
||||||
|
last_line == null;
|
||||||
|
}
|
||||||
|
//如果当前的tag是li,那么还要li的父级元素
|
||||||
|
if(line.get(0).tagName === 'LI'){
|
||||||
|
line = line.parent();
|
||||||
|
}
|
||||||
|
//将当前的元素的所有子元素的背景色改为蓝色
|
||||||
|
line.children().css("background-color", '#e1e1e1');
|
||||||
|
//将当前元素赋给 上一个对象 保存起来。
|
||||||
|
last_line = line;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//元素包含关系计算
|
||||||
|
var contains = function(root, el) {
|
||||||
|
if (root.compareDocumentPosition)
|
||||||
|
return root === el || !!(root.compareDocumentPosition(el) & 16);
|
||||||
|
if (root.contains && el.nodeType === 1){
|
||||||
|
return root.contains(el) && root !== el;
|
||||||
|
}
|
||||||
|
while ((el = el.parentNode))
|
||||||
|
if (el === root) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$(document.body).click(function(e) {
|
||||||
|
//在列表上的任何单击事件都要恢复原来的样子
|
||||||
|
//隐藏右键菜单
|
||||||
|
//e.preventDefault();
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
if( $("#ajax-indicator").is(":hidden") == false && $("#res_name").length != 0 ){ //其他ajax在执行的时候或者res_name仍然存在阻止操作
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
document.oncontextmenu = function() {return true;}
|
||||||
|
//如果当前行为空,那么要将当前行的拿到
|
||||||
|
var ele;
|
||||||
|
if(line == null){
|
||||||
|
ele = document.elementFromPoint(e.clientX, e.clientY);
|
||||||
|
line = $(ele).parent();
|
||||||
|
//如果是在li上点击事件,那么要获得父组件
|
||||||
|
if(line.get(0).tagName === 'LI'){
|
||||||
|
line = line.parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//如果当前对象在表格里,将当前行改变为白色,这里主要是防止点击页面的其他链接的时候,那个链接背景色变白了
|
||||||
|
if( contains($("#resources_list").get(0),line.get(0))){
|
||||||
|
line.children().css("background-color", 'white');
|
||||||
|
}
|
||||||
|
|
||||||
|
//当前行恢复编辑状态到链接状态
|
||||||
|
if(ele && ele.nodeName != 'INPUT') {
|
||||||
|
restore();
|
||||||
|
}
|
||||||
|
line = null;
|
||||||
|
});
|
||||||
|
//只要有一个选中了就是true
|
||||||
|
function checkboxSelected(){
|
||||||
|
selected = false;
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
if($(this).attr('checked') == true){
|
||||||
|
selected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
//只有全选才是true
|
||||||
|
function checkboxAllSelected(){
|
||||||
|
allSelected = true;
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
if($(this).attr('checked') == undefined){
|
||||||
|
allSelected = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return allSelected;
|
||||||
|
}
|
||||||
|
//只有全部不选才是true
|
||||||
|
function checkboxAllDeselected(){
|
||||||
|
allDeselected = true;
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
if($(this).attr('checked') == 'checked'){
|
||||||
|
allDeselected = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return allDeselected;
|
||||||
|
}
|
||||||
|
//查看所有的checkbox状态,并且按情况更改$("#checkboxAll")的状态
|
||||||
|
function checkAllBox(checkbox){
|
||||||
|
//只有选中当前checkbox且这个时候所有的checkbox都被选中了,$("#checkboxAll")才是被选中状态,其余都是非选中状态
|
||||||
|
if(checkbox.attr('checked') == 'checked' && checkboxAllSelected()){
|
||||||
|
$("#checkboxAll").attr('checked',true);
|
||||||
|
}else{
|
||||||
|
$("#checkboxAll").attr('checked',false);
|
||||||
|
}
|
||||||
|
$("#res_count").html(getCheckBoxSeletedCount());
|
||||||
|
|
||||||
|
}
|
||||||
|
//获取当前checkbox选中的数目
|
||||||
|
function getCheckBoxSeletedCount(){
|
||||||
|
var i = 0;
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
if($(this).attr('checked') == 'checked'){
|
||||||
|
i ++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
//全选反选
|
||||||
|
function all_select(){
|
||||||
|
|
||||||
|
if($("#checkboxAll").attr('checked')){
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
$(this).attr('checked',true);
|
||||||
|
});
|
||||||
|
$("#res_count").html(getCheckBoxSeletedCount());
|
||||||
|
}else{
|
||||||
|
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
||||||
|
$(this).attr('checked',false);
|
||||||
|
});
|
||||||
|
$("#res_count").html(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_upload(){
|
||||||
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'upload_resource' ,:locals => {:user=>User.current.id,:type=>@type,:status=>@status})%>');
|
||||||
|
showModal('ajax-modal', '452px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","50%").css("left","50%").css("position","absolute");
|
||||||
|
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||||
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||||
|
}
|
||||||
|
//批量删除
|
||||||
|
function batch_delete(){
|
||||||
|
var data = $("#resources_list_form").serialize();
|
||||||
|
if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){
|
||||||
|
alert("您只能删除没有历史记录的资源,请重新选择后再删除。");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
|
||||||
|
alert("您只能删除自己上传的资源,请重新选择后再删除。");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data != "" && confirm('确认要删除这些资源吗?')) {
|
||||||
|
$.post(
|
||||||
|
'<%= user_resource_delete_user_path(User.current.id,:type=>@type,:status=>@status)%>',
|
||||||
|
$("#resources_list_form").serialize(),//只会对选中的控件进行序列化提交
|
||||||
|
function (data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function show_send_(){
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
document.oncontextmenu = function() {return true;}
|
||||||
|
line.children().css("background-color",'white');
|
||||||
|
id = line.children().last().html();
|
||||||
|
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||||
|
$.ajax({
|
||||||
|
type: 'get',
|
||||||
|
url: '<%= search_user_project_user_path(User.current.id)%>' + '?send_id=' + id,
|
||||||
|
data:{send_type:'file'}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
type: 'get',
|
||||||
|
url: '<%= search_user_course_user_path(User.current.id)%>' + '?send_id=' + id,
|
||||||
|
data:{send_type:'file'}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function batch_send(){
|
||||||
|
if($("#resources_list_form").serialize() == ""){
|
||||||
|
alert('暂时不支持多页选择,您当前页没有选择任何资源');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||||
|
$.ajax({
|
||||||
|
type: 'get',
|
||||||
|
url: '<%= search_user_project_user_path(User.current.id)%>' + '?' + $("#resources_list_form").serialize(),
|
||||||
|
data:{send_type:'file'}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
type: 'get',
|
||||||
|
url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize(),
|
||||||
|
data:{send_type:'file'}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function preview(){
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
document.oncontextmenu = function() {return true;}
|
||||||
|
line.children().css("background-color",'white');
|
||||||
|
id = line.children().last().html();
|
||||||
|
$.ajax({
|
||||||
|
type:'get',
|
||||||
|
url:'<%= resource_preview_user_path(User.current.id)%>'+"?resource_id="+id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function rename(){
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
document.oncontextmenu = function() {return true;}
|
||||||
|
line.children().css("background-color",'white');
|
||||||
|
id = line.children().last().html();
|
||||||
|
user_id = line.children().eq(5).html();
|
||||||
|
if(user_id === '<%= User.current.id %>') {
|
||||||
|
res_name = line.children().eq(1).children().attr('title');
|
||||||
|
res_link = line.children().eq(1).html();
|
||||||
|
line.children().eq(1).html(
|
||||||
|
'<input name="res_name" id="res_name" ' +
|
||||||
|
'style="height: 2em;line-height: 2em;overflow: hidden;" onblur="restore();" ' +
|
||||||
|
' onkeypress="if(event.keyCode==13){event.preventDefault();this.blur();}" ' +
|
||||||
|
'value="'+res_name+
|
||||||
|
'"/> <input type="hidden" id ="res_id" name="res_id" value="'+id+'"/>');
|
||||||
|
$("#res_name").focus();
|
||||||
|
$("html,body").animate({scrollTop:$("#res_name").offset().top},1000)
|
||||||
|
}else{
|
||||||
|
alert('您无法修改此资源!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String.prototype.trim = function() {
|
||||||
|
var str = this,
|
||||||
|
str = str.replace(/^\s\s*/, ''),
|
||||||
|
ws = /\s/,
|
||||||
|
i = str.length;
|
||||||
|
while (ws.test(str.charAt(--i)));
|
||||||
|
return str.slice(0, i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//恢复编辑状态到链接状态
|
||||||
|
//如果当前是编辑状态,任何的不在输入框里的单击右键事件都需要将编辑状态变回链接状态
|
||||||
|
//如果是编辑状态,且做了修改,那么久要进行修改,并且将修改值经过处理替换到页面显示
|
||||||
|
function restore(){
|
||||||
|
//上一行不为空 且链接不为空
|
||||||
|
if( last_line != null && res_link != null && res_link != '') {
|
||||||
|
name = $("#res_name").lenght != 0 && $("#res_name").val() != undefined ? $("#res_name").val().trim() : undefined ;
|
||||||
|
if (name == undefined || name === 'undefined' ){ //只要res_name没有值,那么就不是编辑状态
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( name && name != res_name.trim()){
|
||||||
|
|
||||||
|
if(confirm('确定修改为 '+name)){
|
||||||
|
$.ajax({
|
||||||
|
url: '<%=rename_resource_user_path(User.current.id) %>'+ "?res_name="+$('#res_name').val() + "&res_id=" + $("#res_id").val(),
|
||||||
|
type:'get',
|
||||||
|
success:function (data)
|
||||||
|
{
|
||||||
|
if (data != 'fail' && name != undefined && name != 'undefined') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
|
||||||
|
last_line.children().eq(1).html(res_link);
|
||||||
|
last_line.children().eq(1).children().attr('title', name);
|
||||||
|
last_line.children().eq(1).children().attr('href', data);
|
||||||
|
last_line.children().eq(1).children().html(name.length > 17 ? name.substring(0, 17) + '...' : name);
|
||||||
|
} else {
|
||||||
|
last_line.children().eq(1).html(res_link);
|
||||||
|
res_link = null; //如果修改失败,恢复之后将res_link置空
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}else{
|
||||||
|
last_line.children().eq(1).html(res_link);
|
||||||
|
res_link = null; //如果没有做修改,恢复之后将res_link置空
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
last_line.children().eq(1).html(res_link);
|
||||||
|
res_link = null;//如果没有做修改,恢复之后将res_link置空
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_file() {
|
||||||
|
$("#contextMenu").hide();
|
||||||
|
document.oncontextmenu = function () {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
line.children().css("background-color", 'white');
|
||||||
|
id = line.children().last().html();
|
||||||
|
user_id = line.children().eq(5).html();
|
||||||
|
if(line.children().first().children().data('hasHistory') == 'Y'){
|
||||||
|
alert('该资源存在历史版本,不能删除');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(user_id === '<%= User.current.id%>') {
|
||||||
|
if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) {
|
||||||
|
$.ajax({
|
||||||
|
type: 'post',
|
||||||
|
url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
alert('您无法删除此资源!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<span title="<%= homework.name%>"><%= homework.name%></span>
|
<span title="<%= homework.name%>"><%= homework.name%></span>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li class="subject-pop-from fl hidden">攻城狮</li>
|
<li class="subject-pop-from fl hidden"><span title="<%=homework.course.name %>(<%=current_time_and_term(homework.course) %>)"><%=homework.course.name %>(<%=current_time_and_term_short(homework.course) %>)</span></li>
|
||||||
<li class="subject-pop-type fl">
|
<li class="subject-pop-type fl">
|
||||||
<% case homework.homework_type %>
|
<% case homework.homework_type %>
|
||||||
<% when 1 %>
|
<% when 1 %>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<div class="w985"> <a href="javascript:void(0);" class="popup-close" onclick="hideModal()"></a>
|
<div class="w985"> <a href="javascript:void(0);" class="popup-close" onclick="hideModal()"></a>
|
||||||
<div class="f16 fb fontBlue mb10">选用题库中的题目</div>
|
<div class="f16 fb fontBlue mb10">选用题库中的题目</div>
|
||||||
<div class="subject-list fl mr10">
|
<div class="subject-list fl mr10">
|
||||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 1) %>" id="public_homeworks_choose" class="subjectChoose chooseActive fl" data-remote="true">公共题库</a>
|
<a href="<%= user_homework_type_user_path(@user,:is_import => 1) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active fl" data-remote="true">公共题库</a>
|
||||||
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 1) %>" id="user_homeworks_choose" class="subjectChoose fl" data-remote="true">我的题库</a>
|
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 1) %>" id="user_homeworks_choose" class="resource-tab fl" data-remote="true">我的题库</a>
|
||||||
<div id="homework_search_input">
|
<div id="homework_search_input">
|
||||||
<%=render :partial=>'homework_search_input', :locals=>{:type => @type,:is_import => 1} %>
|
<%=render :partial=>'homework_search_input', :locals=>{:type => @type,:is_import => 1} %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,11 +43,11 @@
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#public_homeworks_choose").click(function(){
|
$("#public_homeworks_choose").click(function(){
|
||||||
$(this).toggleClass("choose-active");
|
$(this).toggleClass("resource-tab-active");
|
||||||
$("#user_homeworks_choose").toggleClass("choose-active");
|
$("#user_homeworks_choose").toggleClass("resource-tab-active");
|
||||||
});
|
});
|
||||||
$("#user_homeworks_choose").click(function(){
|
$("#user_homeworks_choose").click(function(){
|
||||||
$(this).toggleClass("choose-active");
|
$(this).toggleClass("resource-tab-active");
|
||||||
$("#public_homeworks_choose").toggleClass("choose-active");
|
$("#public_homeworks_choose").toggleClass("resource-tab-active");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
<!--<div class="resourceUploadPopup">-->
|
<!--<div class="resourceUploadPopup">-->
|
||||||
<span class="uploadDialogText">上传资源 </span>
|
<span class="uploadDialogText">上传资源 </span>
|
||||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||||
<div class="uploadBoxContainer">
|
<div class="uploadBoxContainer">
|
||||||
<%= form_tag(user_resource_create_user_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
<%= form_tag(user_resource_create_user_path(:type=>type,:status=>status), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||||
<div>
|
<div>
|
||||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
<% if defined?(container) && container && container.saved_attachments %>
|
<% if defined?(container) && container && container.saved_attachments %>
|
||||||
<script>alert('<% container%>')</script>
|
<script>alert('<% container%>')</script>
|
||||||
<% container.attachments.each_with_index do |attachment, i| %>
|
<% container.attachments.each_with_index do |attachment, i| %>
|
||||||
<span id="attachments_p<%= i %>" class="attachment">
|
<span id="attachments_p<%= i %>" class="attachment">
|
||||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'remove-upload')%>
|
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'remove-upload')%>
|
||||||
<%= if attachment.id.nil?
|
<%= if attachment.id.nil?
|
||||||
#待补充代码
|
#待补充代码
|
||||||
else
|
else
|
||||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uploadBox">
|
<div class="uploadBox">
|
||||||
|
|
||||||
<input type="hidden" name="attachment_type" value="1">
|
<input type="hidden" name="attachment_type" value="1">
|
||||||
<%= render :partial => 'attachment_list' %>
|
<%= render :partial => 'attachment_list' %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="uploadResourceIntr">
|
<div class="uploadResourceIntr">
|
||||||
<div class="uploadResourceName"><span id="upload_file_count">(未选择文件)</span></div>
|
<div class="uploadResourceName"><span id="upload_file_count">(未选择文件)</span></div>
|
||||||
<div class="uploadResourceIntr2">您可以上传小于<span class="c_red">50MB</span>的文件</div>
|
<div class="uploadResourceIntr2"><!--您可以上传小于<span class="c_red">50MB</span>的文件--></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div style="margin-top: 10px" >
|
<div style="margin-top: 10px" >
|
||||||
<div class="courseSendSubmit">
|
<div class="courseSendSubmit">
|
||||||
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
||||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||||
</div>
|
</div>
|
||||||
<div class="courseSendCancel"><a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a></div>
|
<div class="courseSendCancel"><a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<!--</div>-->
|
<!--</div>-->
|
|
@ -131,7 +131,7 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if homework_common.student_works.count != 0 %>
|
<% if homework_common.student_works.count != 0 %>
|
||||||
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
<% sw = homework_common.student_works.reorder("created_at desc").first %>
|
||||||
<div class="mt10 homepagePostDeadline">
|
<div class="mt10 homepagePostDeadline mb10">
|
||||||
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
# <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -142,30 +142,36 @@
|
||||||
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
<%# student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id}").reorder("created_at desc") %>
|
||||||
<% unless student_work_scores.empty? %>
|
<% unless student_work_scores.empty? %>
|
||||||
<% last_score = student_work_scores.first %>
|
<% last_score = student_work_scores.first %>
|
||||||
<div class="mt10">
|
<div>
|
||||||
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
<p class="mb10 fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||||
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
<%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||||
</p>
|
</p>
|
||||||
<% ids = '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
|
||||||
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
|
||||||
<% student_works.each_with_index do |sw, i| %>
|
|
||||||
<div class="fl mr10 w100" style="text-align:center;">
|
|
||||||
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => homework_common.id), :alt => "学生头像" %>
|
|
||||||
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => homework_common.id)%></p>
|
|
||||||
</a>
|
|
||||||
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
|
||||||
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
|
||||||
</div>
|
|
||||||
<% if i == 4 %>
|
|
||||||
<% break %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% if student_works.count > 5%>
|
|
||||||
<%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div>
|
||||||
|
<% if homework_common.homework_type != 2 %>
|
||||||
|
<% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
|
||||||
|
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where("student_works.id in #{ids}").order("score desc") %>
|
||||||
|
<% else %>
|
||||||
|
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||||
|
<% end %>
|
||||||
|
<% student_works.each_with_index do |sw, i| %>
|
||||||
|
<div class="fl mr10 w100" style="text-align:center;">
|
||||||
|
<a href="javascript:void(0);" class="linkBlue"><%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_path(:homework => homework_common.id), :alt => "学生头像" %>
|
||||||
|
<p class="w100 hidden"><%= link_to sw.user.show_name, student_work_index_path(:homework => homework_common.id)%></p>
|
||||||
|
</a>
|
||||||
|
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
|
||||||
|
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score<0 ? 0 : score) %>分</span></p>
|
||||||
|
</div>
|
||||||
|
<% if i == 4 %>
|
||||||
|
<% break %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if student_works.count > 5%>
|
||||||
|
<%= link_to "更多>>", student_work_index_path(:homework => homework_common.id),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %>
|
||||||
|
@ -244,7 +250,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
<% if homework_common.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink", :remote => true)%>
|
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(homework_common,:is_in_course => is_in_course),:class => "postOptionLink",
|
||||||
|
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (homework_common.anonymous_comment == 1 && homework_common.is_open == 0) || (homework_common.anonymous_comment == 0 && comment_status == 3 && homework_common.is_open == 0) %>
|
<% if (homework_common.anonymous_comment == 1 && homework_common.is_open == 0) || (homework_common.anonymous_comment == 0 && comment_status == 3 && homework_common.is_open == 0) %>
|
||||||
|
|
|
@ -185,7 +185,7 @@
|
||||||
<div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>">
|
<div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>">
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<% if edit_mode %>
|
<% if edit_mode %>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='homework_textarea' name="homework_common[description]"><%=homework.description.html_safe %></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='homework_textarea' name="homework_common[description]"><%=homework.description %></textarea>
|
||||||
<%#= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON, at_id: homework.id, at_type: homework.class.to_s %>
|
<%#= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON, at_id: homework.id, at_type: homework.class.to_s %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<% if @flag == true%>
|
<% if @flag == true%>
|
||||||
alert("发送成功")
|
alert("发送成功")
|
||||||
<% end %>
|
<% end %>
|
|
@ -1 +1,9 @@
|
||||||
$("#subject_count_homework_<%=@homework.id %>").html(<%= @homework.quotes %>);
|
$("#subject_count_homework_<%=@homework.id %>").html(<%= @homework.quotes %>);
|
||||||
|
$("#ajax-modal").html("<%=escape_javascript(render :partial => 'homework_post_notice') %>");
|
||||||
|
showModal('ajax-modal', '500px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
|
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().css("top","50%").css("left","50%");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox").addClass("resourceUploadPopup");
|
||||||
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
@ -7,5 +7,9 @@ $("#homework_search_input").html("<%=escape_javascript(render :partial=>'homewor
|
||||||
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
||||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||||
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
|
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");
|
||||||
|
$("#homework_type_all").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>');
|
||||||
|
$("#homework_type_nor").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>');
|
||||||
|
$("#homework_type_pro").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>');
|
||||||
|
$("#homework_type_gro").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>');
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -20,10 +20,11 @@
|
||||||
if(check.length == 0) {
|
if(check.length == 0) {
|
||||||
$("#choose_homework_notice").text("请先选择一个作业");
|
$("#choose_homework_notice").text("请先选择一个作业");
|
||||||
} else {
|
} else {
|
||||||
|
var hw_id = $('input[name="checkMenu"]:checked').val();
|
||||||
$("#choose_homework_notice").text("");
|
$("#choose_homework_notice").text("");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'get',
|
type: 'get',
|
||||||
url: '/users/' + user_id + '/choose_user_course',
|
url: '/users/' + user_id + '/choose_user_course?homework='+hw_id,
|
||||||
data:{send_id:$('input[name="checkMenu"]:checked').val()}
|
data:{send_id:$('input[name="checkMenu"]:checked').val()}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -45,10 +46,10 @@
|
||||||
<ul class="resourcesSelect">
|
<ul class="resourcesSelect">
|
||||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||||
<ul class="resourcesType">
|
<ul class="resourcesType">
|
||||||
<li> <a href="/users/8523/user_resource?type=1" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
|
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>" id="homework_type_all" class="resourcesTypeAll resourcesGrey" data-method="get" data-remote="true">全部</a> </li>
|
||||||
<li> <a href="/users/8523/user_resource?type=2" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
|
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>" id="homework_type_nor" class="homepagePostTypeAssignment postTypeGrey" data-method="get" data-remote="true">普通作业</a> </li>
|
||||||
<li> <a href="/users/8523/user_resource?type=3" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
|
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 2) %>" id="homework_type_pro" class="program-btn postTypeGrey" data-method="get" data-remote="true" style="white-space:nowrap;">编程作业</a> </li>
|
||||||
<li> <a href="/users/8523/user_resource?type=5" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
|
<li> <a href="<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 3) %>" id="homework_type_gro" class="group-btn resourcesGrey" data-method="get" data-remote="true">分组作业</a> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -57,7 +58,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div id="homework_search_input" class="mt10 fl">
|
<div id="homework_search_input" class="mt10 fl">
|
||||||
<%=render :partial=>'homework_search_input', :locals=>{:type => @type,:is_import => 0} %>
|
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
|
||||||
</div>
|
</div>
|
||||||
<!--<form class="resourcesSearchloadBox mt10">
|
<!--<form class="resourcesSearchloadBox mt10">
|
||||||
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
|
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
||||||
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||||
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
|
||||||
/*$("#user_show_more_homework").replaceWith("<%#= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page,:is_in_course => 0} )%>");*/
|
|
||||||
|
|
||||||
|
|
|
@ -21,16 +21,6 @@
|
||||||
$("#resource_search_form").submit();
|
$("#resource_search_form").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_upload(){
|
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'upload_resource' ,:locals => {:user=>@user})%>');
|
|
||||||
showModal('ajax-modal', '452px');
|
|
||||||
$('#ajax-modal').siblings().remove();
|
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
|
||||||
$('#ajax-modal').parent().css("top","50%").css("left","50%").css("position","absolute");
|
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
||||||
}
|
|
||||||
|
|
||||||
function show_public_resource(){
|
function show_public_resource(){
|
||||||
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 6}) %>');
|
$("#resource_remote").html('<%= escape_javascript( render :partial => 'user_resource_info' ,:locals => { :tpye => 6}) %>');
|
||||||
}
|
}
|
||||||
|
@ -115,340 +105,5 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var pageX = 0;
|
|
||||||
var pageY = 0;
|
|
||||||
//当前选中的行
|
|
||||||
var line;
|
|
||||||
//已经选中的行,和当前选中的行的区别是:右键选中为line,换一行右键后,line变为last_line,line变为换行后的line
|
|
||||||
var last_line;
|
|
||||||
//资源名称
|
|
||||||
var res_name;
|
|
||||||
//资源名称的链接
|
|
||||||
var res_link;
|
|
||||||
var id; //资源id
|
|
||||||
var sendType = '1'; //发送到课程 1 发送到项目 2
|
|
||||||
var lastSendType; //保存上次发送的发送类型
|
|
||||||
$("#resources_list").mousedown(function(e) {
|
|
||||||
//如果是右键的话
|
|
||||||
if (3 == e.which) {
|
|
||||||
if( $("#res_name").length != 0 || $("#ajax-indicator").is(":hidden") == false){ //其他ajax在执行的时候阻止操作
|
|
||||||
e.preventDefault();
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
document.oncontextmenu = function() {return false;}
|
|
||||||
pageX = e.clientX;
|
|
||||||
pageY = e.clientY;
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
$("#contextMenu").attr("style","display: block; position: fixed; top:"
|
|
||||||
+ pageY
|
|
||||||
+ "px; left:"
|
|
||||||
+ pageX
|
|
||||||
+ "px; width: 80px;");
|
|
||||||
$("#contextMenu").show();
|
|
||||||
//当前光标所在的对象
|
|
||||||
|
|
||||||
var ele = document.elementFromPoint(pageX,pageY);
|
|
||||||
//转换为jquery对象
|
|
||||||
line = $(ele).parent();
|
|
||||||
//如果上一条存在被选中,那么将上一条的背景色改为白色
|
|
||||||
if(last_line != null){
|
|
||||||
last_line.children().css("background-color", 'white');
|
|
||||||
restore();
|
|
||||||
last_line == null;
|
|
||||||
}
|
|
||||||
//如果当前的tag是li,那么还要li的父级元素
|
|
||||||
if(line.get(0).tagName === 'LI'){
|
|
||||||
line = line.parent();
|
|
||||||
}
|
|
||||||
//将当前的元素的所有子元素的背景色改为蓝色
|
|
||||||
line.children().css("background-color", '#e1e1e1');
|
|
||||||
//将当前元素赋给 上一个对象 保存起来。
|
|
||||||
last_line = line;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//元素包含关系计算
|
|
||||||
var contains = function(root, el) {
|
|
||||||
if (root.compareDocumentPosition)
|
|
||||||
return root === el || !!(root.compareDocumentPosition(el) & 16);
|
|
||||||
if (root.contains && el.nodeType === 1){
|
|
||||||
return root.contains(el) && root !== el;
|
|
||||||
}
|
|
||||||
while ((el = el.parentNode))
|
|
||||||
if (el === root) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$(document.body).click(function(e) {
|
|
||||||
//在列表上的任何单击事件都要恢复原来的样子
|
|
||||||
//隐藏右键菜单
|
|
||||||
//e.preventDefault();
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
if( $("#ajax-indicator").is(":hidden") == false && $("#res_name").length != 0 ){ //其他ajax在执行的时候或者res_name仍然存在阻止操作
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
document.oncontextmenu = function() {return true;}
|
|
||||||
//如果当前行为空,那么要将当前行的拿到
|
|
||||||
var ele;
|
|
||||||
if(line == null){
|
|
||||||
ele = document.elementFromPoint(e.clientX, e.clientY);
|
|
||||||
line = $(ele).parent();
|
|
||||||
//如果是在li上点击事件,那么要获得父组件
|
|
||||||
if(line.get(0).tagName === 'LI'){
|
|
||||||
line = line.parent();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//如果当前对象在表格里,将当前行改变为白色,这里主要是防止点击页面的其他链接的时候,那个链接背景色变白了
|
|
||||||
if( contains($("#resources_list").get(0),line.get(0))){
|
|
||||||
line.children().css("background-color", 'white');
|
|
||||||
}
|
|
||||||
|
|
||||||
//当前行恢复编辑状态到链接状态
|
|
||||||
if(ele && ele.nodeName != 'INPUT') {
|
|
||||||
restore();
|
|
||||||
}
|
|
||||||
line = null;
|
|
||||||
});
|
|
||||||
//只要有一个选中了就是true
|
|
||||||
function checkboxSelected(){
|
|
||||||
selected = false;
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
if($(this).attr('checked') == true){
|
|
||||||
selected = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return selected;
|
|
||||||
}
|
|
||||||
//只有全选才是true
|
|
||||||
function checkboxAllSelected(){
|
|
||||||
allSelected = true;
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
if($(this).attr('checked') == undefined){
|
|
||||||
allSelected = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return allSelected;
|
|
||||||
}
|
|
||||||
//只有全部不选才是true
|
|
||||||
function checkboxAllDeselected(){
|
|
||||||
allDeselected = true;
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
if($(this).attr('checked') == 'checked'){
|
|
||||||
allDeselected = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return allDeselected;
|
|
||||||
}
|
|
||||||
//查看所有的checkbox状态,并且按情况更改$("#checkboxAll")的状态
|
|
||||||
function checkAllBox(checkbox){
|
|
||||||
//只有选中当前checkbox且这个时候所有的checkbox都被选中了,$("#checkboxAll")才是被选中状态,其余都是非选中状态
|
|
||||||
if(checkbox.attr('checked') == 'checked' && checkboxAllSelected()){
|
|
||||||
$("#checkboxAll").attr('checked',true);
|
|
||||||
}else{
|
|
||||||
$("#checkboxAll").attr('checked',false);
|
|
||||||
}
|
|
||||||
$("#res_count").html(getCheckBoxSeletedCount());
|
|
||||||
|
|
||||||
}
|
|
||||||
//获取当前checkbox选中的数目
|
|
||||||
function getCheckBoxSeletedCount(){
|
|
||||||
var i = 0;
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
if($(this).attr('checked') == 'checked'){
|
|
||||||
i ++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
//全选反选
|
|
||||||
function all_select(){
|
|
||||||
|
|
||||||
if($("#checkboxAll").attr('checked')){
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
$(this).attr('checked',true);
|
|
||||||
});
|
|
||||||
$("#res_count").html(getCheckBoxSeletedCount());
|
|
||||||
}else{
|
|
||||||
$("#resources_list").find("input[name='checkbox1[]']").each(function(){
|
|
||||||
$(this).attr('checked',false);
|
|
||||||
});
|
|
||||||
$("#res_count").html(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//批量删除
|
|
||||||
function batch_delete(){
|
|
||||||
var data = $("#resources_list_form").serialize();
|
|
||||||
if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){
|
|
||||||
alert("您只能删除没有历史记录的资源,请重新选择后再删除。");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
|
|
||||||
alert("您只能删除自己上传的资源,请重新选择后再删除。");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(data != "" && confirm('确认要删除这些资源吗?')) {
|
|
||||||
$.post(
|
|
||||||
'<%= user_resource_delete_user_path(@user)%>',
|
|
||||||
$("#resources_list_form").serialize(),//只会对选中的控件进行序列化提交
|
|
||||||
function (data) {
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function show_send_(){
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
document.oncontextmenu = function() {return true;}
|
|
||||||
line.children().css("background-color",'white');
|
|
||||||
id = line.children().last().html();
|
|
||||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
|
||||||
$.ajax({
|
|
||||||
type: 'get',
|
|
||||||
url: '<%= search_user_project_user_path(@user)%>' + '?send_id=' + id,
|
|
||||||
data:{send_type:'file'}
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
$.ajax({
|
|
||||||
type: 'get',
|
|
||||||
url: '<%= search_user_course_user_path(@user)%>' + '?send_id=' + id,
|
|
||||||
data:{send_type:'file'}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function batch_send(){
|
|
||||||
if($("#resources_list_form").serialize() == ""){
|
|
||||||
alert('暂时不支持多页选择,您当前页没有选择任何资源');
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
|
||||||
$.ajax({
|
|
||||||
type: 'get',
|
|
||||||
url: '<%= search_user_project_user_path(@user)%>' + '?' + $("#resources_list_form").serialize(),
|
|
||||||
data:{send_type:'file'}
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
$.ajax({
|
|
||||||
type: 'get',
|
|
||||||
url: '<%= search_user_course_user_path(@user)%>' + '?'+ $("#resources_list_form").serialize(),
|
|
||||||
data:{send_type:'file'}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function preview(){
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
document.oncontextmenu = function() {return true;}
|
|
||||||
line.children().css("background-color",'white');
|
|
||||||
id = line.children().last().html();
|
|
||||||
$.ajax({
|
|
||||||
type:'get',
|
|
||||||
url:'<%= resource_preview_user_path(@user)%>'+"?resource_id="+id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function rename(){
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
document.oncontextmenu = function() {return true;}
|
|
||||||
line.children().css("background-color",'white');
|
|
||||||
id = line.children().last().html();
|
|
||||||
user_id = line.children().eq(5).html();
|
|
||||||
if(user_id === '<%= User.current.id %>') {
|
|
||||||
res_name = line.children().eq(1).children().attr('title');
|
|
||||||
res_link = line.children().eq(1).html();
|
|
||||||
line.children().eq(1).html(
|
|
||||||
'<input name="res_name" id="res_name" ' +
|
|
||||||
'style="height: 2em;line-height: 2em;overflow: hidden;" onblur="restore();" ' +
|
|
||||||
' onkeypress="if(event.keyCode==13){event.preventDefault();this.blur();}" ' +
|
|
||||||
'value="'+res_name+
|
|
||||||
'"/> <input type="hidden" id ="res_id" name="res_id" value="'+id+'"/>');
|
|
||||||
$("#res_name").focus();
|
|
||||||
$("html,body").animate({scrollTop:$("#res_name").offset().top},1000)
|
|
||||||
}else{
|
|
||||||
alert('您无法修改此资源!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String.prototype.trim = function() {
|
|
||||||
var str = this,
|
|
||||||
str = str.replace(/^\s\s*/, ''),
|
|
||||||
ws = /\s/,
|
|
||||||
i = str.length;
|
|
||||||
while (ws.test(str.charAt(--i)));
|
|
||||||
return str.slice(0, i + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//恢复编辑状态到链接状态
|
|
||||||
//如果当前是编辑状态,任何的不在输入框里的单击右键事件都需要将编辑状态变回链接状态
|
|
||||||
//如果是编辑状态,且做了修改,那么久要进行修改,并且将修改值经过处理替换到页面显示
|
|
||||||
function restore(){
|
|
||||||
//上一行不为空 且链接不为空
|
|
||||||
if( last_line != null && res_link != null && res_link != '') {
|
|
||||||
name = $("#res_name").lenght != 0 && $("#res_name").val() != undefined ? $("#res_name").val().trim() : undefined ;
|
|
||||||
if (name == undefined || name === 'undefined' ){ //只要res_name没有值,那么就不是编辑状态
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if( name && name != res_name.trim()){
|
|
||||||
|
|
||||||
if(confirm('确定修改为 '+name)){
|
|
||||||
$.ajax({
|
|
||||||
url: '<%=rename_resource_user_path(@user) %>'+ "?res_name="+$('#res_name').val() + "&res_id=" + $("#res_id").val(),
|
|
||||||
type:'get',
|
|
||||||
success:function (data)
|
|
||||||
{
|
|
||||||
if (data != 'fail' && name != undefined && name != 'undefined') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
|
|
||||||
last_line.children().eq(1).html(res_link);
|
|
||||||
last_line.children().eq(1).children().attr('title', name);
|
|
||||||
last_line.children().eq(1).children().attr('href', data);
|
|
||||||
last_line.children().eq(1).children().html(name.length > 17 ? name.substring(0, 17) + '...' : name);
|
|
||||||
} else {
|
|
||||||
last_line.children().eq(1).html(res_link);
|
|
||||||
res_link = null; //如果修改失败,恢复之后将res_link置空
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}else{
|
|
||||||
last_line.children().eq(1).html(res_link);
|
|
||||||
res_link = null; //如果没有做修改,恢复之后将res_link置空
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
last_line.children().eq(1).html(res_link);
|
|
||||||
res_link = null;//如果没有做修改,恢复之后将res_link置空
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_file() {
|
|
||||||
$("#contextMenu").hide();
|
|
||||||
document.oncontextmenu = function () {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
line.children().css("background-color", 'white');
|
|
||||||
id = line.children().last().html();
|
|
||||||
user_id = line.children().eq(5).html();
|
|
||||||
if(line.children().first().children().data('hasHistory') == 'Y'){
|
|
||||||
alert('该资源存在历史版本,不能删除');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(user_id === '<%= User.current.id%>') {
|
|
||||||
if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) {
|
|
||||||
$.ajax({
|
|
||||||
type: 'post',
|
|
||||||
url: '<%= user_resource_delete_user_path(@user)%>' + '?resource_id=' + id + '&type=' + $('#type').val()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
alert('您无法删除此资源!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ zh:
|
||||||
label_course_new: 新建课程
|
label_course_new: 新建课程
|
||||||
label_course_name: 课程名称
|
label_course_name: 课程名称
|
||||||
|
|
||||||
label_homework: 课程作业
|
label_homework: 作业
|
||||||
label_course_news: 课程通知
|
label_course_news: 课程通知
|
||||||
label_course_mail_news_reply: 课程通知回复
|
label_course_mail_news_reply: 课程通知回复
|
||||||
label_main_teacher: 主讲教师
|
label_main_teacher: 主讲教师
|
||||||
|
|
|
@ -614,7 +614,7 @@ zh:
|
||||||
label_homework_info: 提交情况 #huang
|
label_homework_info: 提交情况 #huang
|
||||||
|
|
||||||
label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!'
|
label_course_news_description: '课程必须是高校正式开设的课程,或是围绕特定主题定期发布课程资料的公共开放课程;<br/>如果您想创建一个协作研究空间,请您前往“我的项目”页面创建项目,谢谢!'
|
||||||
label_course_board: 讨论区
|
label_course_board: 问答区
|
||||||
label_version: 版本
|
label_version: 版本
|
||||||
label_version_new: 新建版本
|
label_version_new: 新建版本
|
||||||
|
|
||||||
|
@ -1731,7 +1731,7 @@ zh:
|
||||||
label_newbie_faq: '新手指引 & 问答'
|
label_newbie_faq: '新手指引 & 问答'
|
||||||
label_hot_project: '热门项目'
|
label_hot_project: '热门项目'
|
||||||
label_borad_project: 项目讨论区
|
label_borad_project: 项目讨论区
|
||||||
label_borad_course: 课程讨论区
|
label_borad_course: 课程问答区
|
||||||
label_borad_org_subfield: 资源栏目讨论区
|
label_borad_org_subfield: 资源栏目讨论区
|
||||||
view_borad_course: 课程讨论
|
view_borad_course: 课程讨论
|
||||||
label_memo_create_succ: 发布成功
|
label_memo_create_succ: 发布成功
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class AddHomeworkJournalToCourseContributorScores < ActiveRecord::Migration
|
class AddHomeworkJournalToCourseContributorScores < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :course_contributor_scores, :homework_journal_num, :integer, :default => 0
|
add_column :course_contributor_scores, :homework_journal_num, :integer, :default => 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -99,8 +99,6 @@ ActiveRecord::Schema.define(:version => 20160304154643) do
|
||||||
t.integer "quotes"
|
t.integer "quotes"
|
||||||
t.integer "version"
|
t.integer "version"
|
||||||
t.integer "attachment_id"
|
t.integer "attachment_id"
|
||||||
t.integer "is_publish", :default => 1
|
|
||||||
t.date "publish_time"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "attachments", :force => true do |t|
|
create_table "attachments", :force => true do |t|
|
||||||
|
@ -1280,6 +1278,7 @@ ActiveRecord::Schema.define(:version => 20160304154643) do
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.integer "creator_id"
|
t.integer "creator_id"
|
||||||
t.integer "home_id"
|
t.integer "home_id"
|
||||||
|
t.string "domain"
|
||||||
t.boolean "is_public"
|
t.boolean "is_public"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
@ -1387,6 +1386,7 @@ ActiveRecord::Schema.define(:version => 20160304154643) do
|
||||||
t.integer "changeset_num", :default => 0
|
t.integer "changeset_num", :default => 0
|
||||||
t.integer "board_message_num", :default => 0
|
t.integer "board_message_num", :default => 0
|
||||||
t.integer "board_num", :default => 0
|
t.integer "board_num", :default => 0
|
||||||
|
t.integer "act_num", :default => 0
|
||||||
t.integer "attach_num", :default => 0
|
t.integer "attach_num", :default => 0
|
||||||
t.datetime "commit_time"
|
t.datetime "commit_time"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1125,3 +1125,7 @@ a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px s
|
||||||
.h34 {height:34px;}
|
.h34 {height:34px;}
|
||||||
.resource-tab {font-size:16px; color:#4d4d4d; width:70px; padding:5px 10px; display:inline-block; text-align:left; border-bottom:1px solid #ddd;}
|
.resource-tab {font-size:16px; color:#4d4d4d; width:70px; padding:5px 10px; display:inline-block; text-align:left; border-bottom:1px solid #ddd;}
|
||||||
a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px solid #269ac9;}
|
a.resource-tab-active {color:#fff; background-color:#269ac9; border-bottom:1px solid #269ac9;}
|
||||||
|
|
||||||
|
a.group-btn{ background: url(../images/course/hwork_icon.png) -2px -58px no-repeat !important; height:20px; display:block; padding-left:23px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
|
||||||
|
a.program-btn{background: url(../images/homepage_icon.png) -86px -393px no-repeat; width:30px; height:20px; display:block; padding-left:23px; color:#888888;}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue