Merge branch 'develop' into yuanke
Conflicts: public/stylesheets/new_user.css
This commit is contained in:
commit
a10830c90f
|
@ -51,6 +51,37 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#管理员界面精品课程列表
|
||||
def excellent_courses
|
||||
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面课程资源列表
|
||||
def course_resource_list
|
||||
@resource = Attachment.where(:container_type => 'Course')
|
||||
@resource = paginateHelper @resource,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面項目资源列表
|
||||
def project_resource_list
|
||||
@pro_resource = Attachment.where(:container_type => 'Project')
|
||||
@pro_resource = paginateHelper @pro_resource,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def users
|
||||
sort_init 'login', 'asc'
|
||||
sort_update %w(login firstname lastname mail admin created_on last_login_on)
|
||||
|
|
|
@ -240,6 +240,18 @@ class CoursesController < ApplicationController
|
|||
# req[:message] = l(:modal_valid_passing) if req[:message].blank?
|
||||
render :json => req
|
||||
end
|
||||
|
||||
def teacher_assign_group
|
||||
member = Member.where(:course_id => @course.id, :user_id => params[:user_id]).first
|
||||
member.course_group_id = params[:course_group_id].to_i
|
||||
member.save
|
||||
@course_groups = @course.course_groups
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_group
|
||||
@subPage_title = l :label_student_list
|
||||
group = CourseGroup.find(params[:object_id])
|
||||
|
@ -838,6 +850,8 @@ class CoursesController < ApplicationController
|
|||
# render_403
|
||||
# return
|
||||
# end
|
||||
# 统计访问量
|
||||
@course.update_attribute(:visits, @course.visits.to_i + 1)
|
||||
#更新创建课程消息状态
|
||||
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
|
||||
create_course_messages.update_all(:viewed => true)
|
||||
|
|
|
@ -107,32 +107,18 @@ class NewsController < ApplicationController
|
|||
|
||||
def show
|
||||
# 更新news对应的forge_messages的消息viewed字段
|
||||
ids = @news.comments.map { |comment| comment.id }.join(",") unless @news.comments.nil?
|
||||
if @project
|
||||
query_message_news = @news.forge_messages
|
||||
# 更新新闻
|
||||
query_message_news = ForgeMessage.where("forge_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
|
||||
# 更新新闻的时候一并更新回复
|
||||
ForgeMessage.where("forge_message_id in (#{ids}) and forge_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
|
||||
else
|
||||
query_message_news = @news.course_messages
|
||||
query_message_news = CourseMessage.where("course_message_id =? and user_id =? and viewed =?", @news.id, User.current.id, 0).first
|
||||
CourseMessage.where("course_message_id in (#{ids}) and course_message_type = 'Comment' and user_id = #{User.current.id}").update_all(:viewed => true) unless ids.blank?
|
||||
end
|
||||
query_message_news.each do |query|
|
||||
if User.current.id == query.user_id
|
||||
query.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
# 更新项目新闻的评阅的消息viewed字段
|
||||
current_message_comments = @news.comments
|
||||
current_message_comments.each do |current_message_comment|
|
||||
if @project
|
||||
query_message_comment = current_message_comment.forge_messages
|
||||
else
|
||||
query_message_comment = current_message_comment.course_messages
|
||||
end
|
||||
query_message_comment.each do |query|
|
||||
if User.current.id == query.user_id
|
||||
query.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
# end
|
||||
|
||||
query_message_news.update_attribute(:viewed, true) unless query_message_news.nil?
|
||||
# over
|
||||
cs = CoursesService.new
|
||||
result = cs.show_course_news params,User.current
|
||||
@news = result[:news]
|
||||
|
|
|
@ -69,6 +69,8 @@ class OrganizationsController < ApplicationController
|
|||
def show
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
# 统计访问量
|
||||
@organization.update_attribute(:visits, @organization.visits.to_i + 1)
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
|
|
|
@ -298,6 +298,8 @@ class ProjectsController < ApplicationController
|
|||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
end
|
||||
# 统计访问量
|
||||
@project.update_attribute(:visits, @project.visits.to_i + 1)
|
||||
=begin
|
||||
cond = @project.project_condition(Setting.display_subprojects_issues?)
|
||||
has = {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -376,13 +376,15 @@ class UsersController < ApplicationController
|
|||
|
||||
#用户作业列表
|
||||
def user_homeworks
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@user = User.current
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
if(params[:type].blank? || params[:type] == "1") #公共题库
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
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("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
|
@ -423,7 +425,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def choose_user_course
|
||||
homework = HomeworkCommon.find params[:homework].to_i
|
||||
homework = HomeworkCommon.find params[:send_id].to_i
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@course = @user.courses.where("is_delete = 0 and #{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)}
|
||||
|
@ -525,20 +527,22 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def user_homework_type
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
if(params[:type].blank? || params[:type] == "1") #公共题库
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
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("#{@order} #{@b_sort}")
|
||||
end
|
||||
if params[:property] && params[:property] == "1"
|
||||
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
|
||||
elsif params[:property] && params[:property] == "2"
|
||||
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
|
||||
elsif params[:property] && params[:property] == "3"
|
||||
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@property = params[:property]
|
||||
|
@ -564,6 +568,8 @@ class UsersController < ApplicationController
|
|||
|
||||
#用户主页过滤作业
|
||||
def user_search_homeworks
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
|
@ -573,16 +579,16 @@ class UsersController < ApplicationController
|
|||
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")
|
||||
@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("#{@order} #{@b_sort}")
|
||||
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("#{@order} #{@b_sort}")
|
||||
end
|
||||
if params[:property] && params[:property] == "1"
|
||||
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
|
||||
elsif params[:property] && params[:property] == "2"
|
||||
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
|
||||
elsif params[:property] && params[:property] == "3"
|
||||
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
|
||||
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 15
|
||||
|
@ -592,6 +598,8 @@ class UsersController < ApplicationController
|
|||
@offset ||= @hw_pages.offset
|
||||
@homeworks = paginateHelper @homeworks,15
|
||||
@is_import = params[:is_import]
|
||||
@property = params[:property]
|
||||
@search = search
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -1174,6 +1182,10 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
# 统计访问量
|
||||
unless User.current == @user
|
||||
@user.update_attribute(:visits, @user.visits.to_i + 1)
|
||||
end
|
||||
#更新用户申请成为课程老师或教辅消息的状态
|
||||
if params[:course_id] != nil
|
||||
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
|
||||
|
|
|
@ -71,6 +71,11 @@ module CoursesHelper
|
|||
project.members.count
|
||||
end
|
||||
|
||||
# 统计课程中作品的数量
|
||||
def student_works_num course
|
||||
StudentWork.find_by_sql("SELECT * FROM student_works WHERE homework_common_id IN (SELECT id FROM homework_commons WHERE course_id = '#{course.id}')").count
|
||||
end
|
||||
|
||||
# 返回教师数量,即roles表中定义的Manager
|
||||
def teacherCount project
|
||||
project ? project.members.count - studentCount(project).to_i : 0
|
||||
|
@ -601,6 +606,24 @@ module CoursesHelper
|
|||
Course.tagged_with(tag_name).order('updated_at desc')
|
||||
end
|
||||
|
||||
#分班下拉框
|
||||
def course_group_option course
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << "暂无"
|
||||
option1 << 0
|
||||
type << option1
|
||||
unless course.course_groups.nil?
|
||||
course.course_groups.each do |cg|
|
||||
option = []
|
||||
option << cg.name
|
||||
option << cg.id
|
||||
type << option
|
||||
end
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
#课程实践年份下拉框
|
||||
def course_time_option year
|
||||
type = []
|
||||
|
@ -762,7 +785,7 @@ module CoursesHelper
|
|||
return[] unless course
|
||||
result = []
|
||||
course.attachments.each do |attachment|
|
||||
if attachment.is_public? ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
|
||||
if (attachment.is_public? && attachment.is_publish == 1) ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,course)|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
|
||||
result << attachment
|
||||
end
|
||||
end
|
||||
|
|
|
@ -121,7 +121,8 @@ module FilesHelper
|
|||
def visable_attachemnts attachments
|
||||
result = []
|
||||
attachments.each do |attachment|
|
||||
if attachment.is_public? ||
|
||||
if (attachment.is_public? && attachment.container_type != "Course") ||
|
||||
(attachment.is_public? && attachment.container_type == "Course" && attachment.is_publish == 1)||
|
||||
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
|
||||
(attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))||
|
||||
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)||
|
||||
|
|
|
@ -2,8 +2,8 @@ class PraiseTread < ActiveRecord::Base
|
|||
attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread
|
||||
belongs_to :user
|
||||
belongs_to :praise_tread_object, polymorphic: true
|
||||
after_create :be_user_score
|
||||
after_destroy :down_user_score
|
||||
#after_create :be_user_score
|
||||
#after_destroy :down_user_score
|
||||
include UserScoreHelper
|
||||
def self.find_object_by_type_and_id(type,id)
|
||||
@obj = nil
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<h3><%=l(:label_course_resource_list)%></h3>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th style="width: 60px;">
|
||||
资源名称
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
资源大小
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源类型
|
||||
</th>
|
||||
<th style="width: 23px;">
|
||||
上传时间
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
下载次数
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
上传者
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
所属课程
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @resource.each do |resource| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: left;">
|
||||
<%= link_to truncate(resource.filename, :length => 18), download_named_attachment_path(resource.id, resource.filename ), :title => resource.filename,:class=>'resourcesBlack'%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= number_to_human_size(resource.filesize)%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
课程资源
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= format_date(resource.created_on)%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= resource.downloads %>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= link_to(User.find(resource.author_id).realname, user_path(User.find(resource.author_id)) ) %>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%=link_to truncate(Course.find(resource.container_id).name, :length => 10), course_path(Course.find(resource.container_id)), :title => Course.find(resource.container_id).name, :class => "hidden fl w170" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
|
@ -0,0 +1,75 @@
|
|||
<h3>
|
||||
<%=l(:label_excellent_courses_list)%>
|
||||
</h3>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 25px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
课程名
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
学生数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作业数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
作品数
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源数
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
帖子数
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
动态数
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= studentCount(course) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.homework_commons.count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= student_works_num(course) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= visable_attachemnts_incourse(course).count%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", course.boards.first.id, nil).count %>
|
||||
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.course_activities.count%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
|
@ -0,0 +1,64 @@
|
|||
<h3><%=l(:label_project_resource_list)%></h3>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th style="width: 60px;">
|
||||
资源名称
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
资源大小
|
||||
</th>
|
||||
<th style="width: 25px;">
|
||||
资源类型
|
||||
</th>
|
||||
<th style="width: 23px;">
|
||||
上传时间
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
下载次数
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
上传者
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
所属项目
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @pro_resource.each do |pro_resource| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: left;">
|
||||
<%= link_to truncate(pro_resource.filename, :length => 18), download_named_attachment_path(pro_resource.id, pro_resource.filename ), :title => pro_resource.filename,:class=>'resourcesBlack'%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= number_to_human_size(pro_resource.filesize)%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
项目资源
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= format_date(pro_resource.created_on)%>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= pro_resource.downloads %>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%= link_to(User.find(pro_resource.author_id).realname, user_path(User.find(pro_resource.author_id)) ) %>
|
||||
</td>
|
||||
<td style=" text-align: center;">
|
||||
<%=link_to truncate(Project.find(pro_resource.container_id).name, :length => 10), project_path(Project.find(pro_resource.container_id)), :title => Project.find(pro_resource.container_id).name, :class => "hidden fl w170" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
|
@ -24,7 +24,8 @@
|
|||
<ul class="st_box_top">
|
||||
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
|
||||
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
|
||||
<li class="ml358">
|
||||
<li style="padding-right: 55px; margin-left: 260px;"><a href="">分班</a></li>
|
||||
<li style="margin-left: 25px;">
|
||||
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
|
||||
<% if @score_sort_by == 'desc' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
|
@ -58,11 +59,31 @@
|
|||
<li><%= link_to("#{l(:label_bidding_user_studentcode)}:<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
|
||||
<% end%>
|
||||
</ul>
|
||||
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
|
||||
<% if @course.course_groups.nil? || @group %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, course_group_option(@course),
|
||||
{ :include_blank => false,:selected => member.course_group_id},
|
||||
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 105px;"}) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
|
||||
:action => 'show_member_score',
|
||||
:member_id => member.id,
|
||||
:remote => true},
|
||||
:class => 'ml258 c_red' %>
|
||||
:class => 'ml25 c_red' %>
|
||||
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
|
||||
</div>
|
||||
|
@ -79,3 +100,40 @@
|
|||
</p>
|
||||
<% end%>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
/*$(".select-class-option").mouseover(function(){
|
||||
$(this).children(".pic_edit2").css("display","inline-block");
|
||||
});
|
||||
$(".select-class-option").mouseout(function(){
|
||||
$(this).children(".pic_edit2").css("display","none");
|
||||
});*/
|
||||
$(".pic_edit2").click(function(){
|
||||
$(this).parent().hide();
|
||||
$(this).parent().next().show();
|
||||
});
|
||||
$(".class-edit").blur(function(){
|
||||
$(this).hide();
|
||||
$(this).prev().show();
|
||||
var editValue = $(this).children("option:selected").text();
|
||||
$(this).prev().children(":first").text(editValue);
|
||||
});
|
||||
function stopPropagation(e) {
|
||||
if (e.stopPropagation)
|
||||
e.stopPropagation();
|
||||
else
|
||||
e.cancelBubble = true;
|
||||
};
|
||||
$(document).bind('click',function(){
|
||||
$('.class-edit').css('display','none');
|
||||
$('.select-class-option').show();
|
||||
});
|
||||
$('.class-edit,.pic_edit2').bind('click',function(e){
|
||||
stopPropagation(e);
|
||||
});
|
||||
});
|
||||
function join_group_function(id){
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
|
|
@ -25,7 +25,7 @@
|
|||
<div class="mb5">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">附件描述:</label>
|
||||
<div class="fl">
|
||||
<input type="text" name="description" placeholder="文件描述" class="fl W120 ">
|
||||
<input type="text" name="description" placeholder="文件描述" class="InputBox fl W160">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
||||
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:id => "show_course_#{course.id}",:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% projects.each do |project|%>
|
||||
<li class="homepageLeftMenuCoursesLine pr">
|
||||
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
|
||||
<li>
|
||||
<ul class="subNavMenu boxShadow">
|
||||
|
|
|
@ -250,6 +250,7 @@
|
|||
</div><!--项目标签 end-->
|
||||
<!--课程推荐-->
|
||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
||||
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %></div>
|
||||
</div><!--LSide end-->
|
||||
|
||||
<div id="RSide" class="fl">
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
<div class="homepageLeftMenuContainer" id="sub_field_left_lists">
|
||||
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
|
||||
</div>
|
||||
<div class="fontGrey5 mt10 ml20">访问计数 <%= @organization.visits.to_i %></div>
|
||||
</div>
|
||||
<div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;">
|
||||
<%= render_flash_messages %>
|
||||
|
|
|
@ -158,9 +158,12 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--项目标签 end-->
|
||||
|
||||
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="RSide" class="fl">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
|
|
|
@ -226,6 +226,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %></div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
<%= yield %>
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
|
|
|
@ -2,8 +2,16 @@
|
|||
<li class="hworkList340 hworkH30 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
||||
<span class="c_dark f14 fb fl <%= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<span class="c_dark f14 fb fl mr50">姓名</span>
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
|
||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl" ,:remote => true%>
|
||||
<% if @show_all && @order == "lastname"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
<!--<span class="c_dark f14 fb fl">学号</span>-->
|
||||
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<% if @show_all && @order == "student_id"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<span class="c_dark f14 fb fl">关联项目</span>
|
||||
<% end %>
|
||||
|
|
|
@ -57,7 +57,14 @@
|
|||
<li >
|
||||
<span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<% if x["status"].to_i == 2 %>
|
||||
<span class="w150 c_red">超时!</span>
|
||||
<% else %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<% end %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width150"><pre><%=x["result"]%></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
|
@ -65,6 +72,8 @@
|
|||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<ul class="subject-list-banner">
|
||||
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
|
||||
<li class="subject-list-from fl">来源</li>
|
||||
<li class="subject-list-type fl">类别</li>
|
||||
<li class="subject-list-publisher fl">贡献者</li>
|
||||
<li class="subject-list-count fl">
|
||||
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl",:remote => true%>
|
||||
<% if @order == "quotes"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="fl subject-list-date">
|
||||
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "fl",:remote => true%>
|
||||
<% if @order == "created_at"%>
|
||||
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="homework_repository">
|
||||
<%=render :partial => 'homework_repository', :locals => {:homeworks => homeworks} %>
|
||||
</div>
|
|
@ -48,7 +48,7 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
|
||||
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
|
||||
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
|
||||
<% end %>
|
||||
|
|
|
@ -25,15 +25,24 @@
|
|||
<! for(var i =0; i <results.length; ++i){ !>
|
||||
<li ><span class="w60 T_C">测试<!=i+1!></span>
|
||||
<! if(results[i]["status"]!=0){ !>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<! if(results[i]["status"]==2){!>
|
||||
<span class="w150 c_red">超时!</span>
|
||||
<!}else{!>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<!}!>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><!=results[i]["time_used"]!>微秒</pre></span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
|
||||
<span class="W180"><pre><!=results[i]["result"]!></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
|
||||
<span class="W180"><pre><!=results[i]["output"]!></pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!}else{!>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><!=results[i]["time_used"]!>微秒</pre></span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!}!>
|
||||
|
@ -46,7 +55,6 @@
|
|||
<!-- 模板1结束 -->
|
||||
|
||||
<div class="ProgramHomework ml10">
|
||||
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName"><%= @is_test ? '模拟答题' : '提交作品' %></div>
|
||||
|
@ -126,15 +134,23 @@
|
|||
<% test.results.each_with_index do |x, i| %>
|
||||
<li ><span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<% if x["status"].to_i == 2 %>
|
||||
<span class="w150 c_red">超时!</span>
|
||||
<% else %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<% end %>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="W200"><pre><%=x["result"]%></pre></span>
|
||||
<span class="W180"><pre><%=x["result"]%></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="W200"><pre><%= x["output"] %></pre></span>
|
||||
<span class="W180"><pre><%= x["output"] %></pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -15,15 +15,23 @@
|
|||
<! for(var i =0; i <results.length; ++i){ !>
|
||||
<li ><span class="w60 T_C">测试<!=i+1!></span>
|
||||
<! if(results[i]["status"]!=0){ !>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<! if(results[i]["status"]==2){ !>
|
||||
<span class="w150 c_red">超时!</span>
|
||||
<!}else{!>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<!}!>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><!=results[i]["time_used"]!>微秒</pre></span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="W200"><pre><!=results[i]["result"]!></pre></span>
|
||||
<span class="W180"><pre><!=results[i]["result"]!></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="W200"><pre><!=results[i]["output"]!></pre></span>
|
||||
<span class="W180"><pre><!=results[i]["output"]!></pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!}else{!>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><!=results[i]["time_used"]!>微秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!}!>
|
||||
|
@ -93,15 +101,23 @@
|
|||
<% test.results.each_with_index do |x, i| %>
|
||||
<li ><span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<% if x["status"].to_i == 2 %>
|
||||
<span class="w150 c_red">超时!</span>
|
||||
<% else %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<% end %>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="W200"><pre><%=x["result"]%></pre></span>
|
||||
<span class="W180"><pre><%=x["result"]%></pre></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="W200"><pre><%=x["output"]%></pre></span>
|
||||
<span class="W180"><pre><%=x["output"]%></pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<span class="w50"> 耗时:</span>
|
||||
<span class="w80"><pre><%=x["time_used"]%>微秒</pre></span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -4,7 +4,7 @@ $("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :
|
|||
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
|
||||
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
|
||||
<% else %>
|
||||
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>');
|
||||
$("#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_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");
|
||||
|
|
|
@ -58,40 +58,26 @@
|
|||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="homework_search_input" class="mt10 fl">
|
||||
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
|
||||
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
|
||||
</div>
|
||||
<!--<form class="resourcesSearchloadBox mt10">
|
||||
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
|
||||
</form>-->
|
||||
<div class="cl"></div>
|
||||
<div class="w583 fl mr10 mt10">
|
||||
<ul class="subject-list-banner">
|
||||
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
|
||||
<li class="subject-list-from fl">来源</li>
|
||||
<li class="subject-list-type fl">类别</li>
|
||||
<li class="subject-list-publisher fl">贡献者</li>
|
||||
<li class="subject-list-count fl">引用数</li>
|
||||
<li class="fl subject-list-date">发布时间</li>
|
||||
</ul>
|
||||
<div id="homework_repository">
|
||||
<%=render :partial => 'homework_repository', :locals => {:homeworks => @homeworks} %>
|
||||
<div class="w583 fl mr10 mt10" id="homework_repository_list">
|
||||
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
|
||||
</div>
|
||||
<div id="homework_repository_detail">
|
||||
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px">
|
||||
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
|
||||
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
|
||||
</div>
|
||||
<span class="c_red fl mt15" id="choose_homework_notice"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="homework_repository_detail">
|
||||
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px">
|
||||
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
|
||||
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
|
||||
</div>
|
||||
<span class="c_red fl mt15" id="choose_homework_notice"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,3 +1,4 @@
|
|||
$("#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_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>');
|
||||
$("#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}) %>");
|
||||
|
|
|
@ -3,7 +3,7 @@ $("#homework_list_form_show").html('<%= escape_javascript(render :partial => 'us
|
|||
$("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
|
||||
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
|
||||
<% else %>
|
||||
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
|
||||
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>');
|
||||
$("#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}) %>");
|
||||
<% end %>
|
|
@ -21,6 +21,6 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
<div class="pageRoll">
|
||||
<%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%>
|
||||
<!%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1520,6 +1520,9 @@ en:
|
|||
label_submit_comments: Submit_comments
|
||||
label_course_empty_select: You have not selected course!
|
||||
label_enterprise_page_made: enterprise_page
|
||||
label_excellent_courses_list: excellent_courses
|
||||
label_course_resource_list: course_resource_list
|
||||
label_project_resource_list: project_resource_list
|
||||
|
||||
#api
|
||||
label_recently_updated_notification: Recently updated notification
|
||||
|
|
|
@ -483,6 +483,9 @@ zh:
|
|||
label_requirement: 需求
|
||||
label_new_course: 课程列表
|
||||
label_course_all: 课程列表
|
||||
label_excellent_courses_list: 精品课程列表
|
||||
label_course_resource_list: 课程资源列表
|
||||
label_project_resource_list: 項目资源列表
|
||||
label_teacher_all: 所有教师
|
||||
label_requirement_enterprise_list: 众包列表
|
||||
label_new_homework: 作业
|
||||
|
|
|
@ -939,6 +939,9 @@ RedmineApp::Application.routes.draw do
|
|||
match 'admin', :to => 'admin#index', :via => :get
|
||||
match 'admin/projects', :via => :get
|
||||
get 'admin/courses'
|
||||
get 'admin/excellent_courses'
|
||||
get 'admin/course_resource_list'
|
||||
get 'admin/project_resource_list'
|
||||
match 'admin/users', :via => :get
|
||||
match 'admin/messages', :via => :get
|
||||
match 'admin/first_page_made', as: :first_page_made
|
||||
|
@ -1005,6 +1008,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'course_outline'
|
||||
post 'search_course_outline'
|
||||
post 'set_course_outline'
|
||||
post 'teacher_assign_group'
|
||||
get 'syllabus'
|
||||
get 'search_public_orgs_not_in_course'
|
||||
get "homework_search"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddVisitsToUser < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddVisitsToProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddVisitsToCourse < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddVisitsToOrganization < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :organizations, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
13
db/schema.rb
13
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160310033019) do
|
||||
ActiveRecord::Schema.define(:version => 20160225031230) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -432,11 +432,9 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
|
|||
t.integer "resource_num"
|
||||
t.integer "journal_num"
|
||||
t.integer "journal_reply_num"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "total_score"
|
||||
t.integer "homework_journal_num", :default => 0
|
||||
t.integer "news_num", :default => 0
|
||||
end
|
||||
|
||||
create_table "course_groups", :force => true do |t|
|
||||
|
@ -2015,6 +2013,11 @@ ActiveRecord::Schema.define(:version => 20160310033019) do
|
|||
|
||||
add_index "wikis", ["project_id"], :name => "wikis_project_id"
|
||||
|
||||
create_table "wlcs", :force => true do |t|
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "workflows", :force => true do |t|
|
||||
t.integer "tracker_id", :default => 0, :null => false
|
||||
t.integer "old_status_id", :default => 0, :null => false
|
||||
|
|
|
@ -14,7 +14,7 @@ module RailsKindeditor
|
|||
output = ActiveSupport::SafeBuffer.new
|
||||
output << text_area_tag(name, content, input_html)
|
||||
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
|
||||
:autoHeightMode=>false,
|
||||
:autoHeightMode=>true,#yuanke 所有调用该方法创建的KE都自动增高
|
||||
afterCreate: eval_str(at_id, at_type),
|
||||
emotionsBasePath: 'http://' + Setting.host_name
|
||||
)))
|
||||
|
@ -29,7 +29,7 @@ module RailsKindeditor
|
|||
output_buffer = ActiveSupport::SafeBuffer.new
|
||||
output_buffer << build_text_area_tag(name, method, self, options, input_html)
|
||||
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
|
||||
:autoHeightMode=>false,
|
||||
:autoHeightMode=>true,#yuanke 所有调用该方法创建的KE都自动增高
|
||||
afterCreate: eval_str(at_id, at_type),
|
||||
emotionsBasePath: 'http://' + Setting.host_name
|
||||
)))
|
||||
|
|
|
@ -391,6 +391,9 @@ Redmine::MenuManager.map :admin_menu do |menu|
|
|||
menu.push :messages_list, {:controller => 'admin', :action => 'messages_list'}, :caption => :label_message_plural
|
||||
menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list
|
||||
menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list
|
||||
menu.push :excellent_courses, {:controller => 'admin', :action => 'excellent_courses'}, :caption => :label_excellent_courses_list
|
||||
menu.push :course_resource_list, {:controller => 'admin', :action => 'course_resource_list'}, :caption => :label_course_resource_list
|
||||
menu.push :project_resource_list, {:controller => 'admin', :action => 'project_resource_list'}, :caption => :label_project_resource_list
|
||||
menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework
|
||||
|
||||
end
|
||||
|
|
|
@ -174,7 +174,7 @@ function(a,c){var d=J(c,["prop","delete"])<0?b.plugin.getSelectedCell:b.plugin.g
|
|||
function(a,d){c[d]&&b.afterCreate(function(){Ka(this.edit.doc,c[d],function(){b.cmd.selection();b.clickToolbar(d)})});b.clickToolbar(d,function(){b.focus().exec(d,null)})});b.afterCreate(function(){function c(){f.range.moveToBookmark(j);f.select();X&&(a("div."+l,i).each(function(){a(this).after("<br />").remove(!0)}),a("span.Apple-style-span",i).remove(!0),a("span.Apple-tab-span",i).remove(!0),a("span[style]",i).each(function(){a(this).css("white-space")=="nowrap"&&a(this).remove(!0)}),a("meta",i).remove());
|
||||
var d=i[0].innerHTML;i.remove();d!==""&&(X&&(d=d.replace(/(<br>)\1/ig,"$1")),b.pasteType===2&&(d=d.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(d)?d=nb(d,b.filterMode?b.htmlTags:a.options.htmlTags):(d=U(d,b.filterMode?b.htmlTags:null),d=b.beforeSetHtml(d))),b.pasteType===1&&(d=d.replace(/ /ig," "),d=d.replace(/\n\s*\n/g,"\n"),d=d.replace(/<br[^>]*>/ig,"\n"),d=d.replace(/<\/p><p[^>]*>/ig,"\n"),d=d.replace(/<[^>]+>/g,""),d=d.replace(/ {2}/g," "),
|
||||
b.newlineTag=="p"?/\n/.test(d)&&(d=d.replace(/^/,"<p>").replace(/$/,"<br /></p>").replace(/\n/g,"<br /></p><p>")):d=d.replace(/\n/g,"<br />$&")),b.insertHtml(d,!0))}var d=b.edit.doc,f,j,i,l="__kindeditor_paste__",m=!1;a(d.body).bind("paste",function(p){if(b.pasteType===0)p.stop();else if(!m){m=!0;a("div."+l,d).remove();f=b.cmd.selection();j=f.range.createBookmark();i=a('<div class="'+l+'"></div>',d).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:a(j.start).pos().y+
|
||||
"px","white-space":"nowrap"});a(d.body).append(i);if(o){var s=f.range.get(!0);s.moveToElementText(i[0]);s.select();s.execCommand("paste");p.preventDefault()}else f.range.selectNodeContents(i[0]),f.select();setTimeout(function(){c();m=!1},0)}})});b.beforeGetHtml(function(a){o&&A<=8&&(a=a.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b){return unescape(b)}),a=a.replace(/(<input)((?:\s+[^>]*)?>)/ig,function(a,b,c){if(!/\s+type="[^"]+"/i.test(a))return b+' type="text"'+
|
||||
"px","white-space":"nowrap"});a(d.body).append(i);if(o||Yb){var s=f.range.get(!0);s.moveToElementText(i[0]);s.select();s.execCommand("paste");p.preventDefault()}else f.range.selectNodeContents(i[0]),f.select();setTimeout(function(){c();m=!1},0)}})});b.beforeGetHtml(function(a){o&&A<=8&&(a=a.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b){return unescape(b)}),a=a.replace(/(<input)((?:\s+[^>]*)?>)/ig,function(a,b,c){if(!/\s+type="[^"]+"/i.test(a))return b+' type="text"'+
|
||||
c;return a}));return a.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig,function(a,b,c,d){return b+fa(c).replace(/\s+/g," ")+d}).replace(/<img[^>]*class="?ke-(flash|rm|media)"?[^>]*>/ig,function(a){var a=I(a),b=ba(a.style||""),c=pb(a["data-ke-tag"]),d=l(b.width,""),b=l(b.height,"");/px/i.test(d)&&(d=t(d));/px/i.test(b)&&(b=t(b));c.width=l(a.width,d);c.height=l(a.height,b);return Ma(c)}).replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig,function(a){a=I(a);return'<a name="'+unescape(a["data-ke-name"])+
|
||||
'"></a>'}).replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b,c){return"<script"+unescape(b)+">"+unescape(c)+"<\/script>"}).replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b,c){return"<noscript"+unescape(b)+">"+unescape(c)+"</noscript>"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,function(a,b,c){a=a.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(a,b,d){return b+fa(c)+d});return a=a.replace(/\s+data-ke-src="[^"]*"/i,
|
||||
"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(a,b,c){return b+c})});b.beforeSetHtml(function(a){o&&A<=8&&(a=a.replace(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig,function(a){var b=I(a);if(ba(b.style||"").display=="none")return'<div class="ke-display-none" data-ke-input-tag="'+escape(a)+'"></div>';return a}));return a.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(a){a=I(a);a.src=l(a.src,"");a.width=l(a.width,0);a.height=l(a.height,0);return qb(b.themesPath+
|
||||
|
|
|
@ -251,7 +251,7 @@ K.options = {
|
|||
langType : 'zh_CN',
|
||||
urlType : '',
|
||||
newlineTag : 'p',
|
||||
resizeType : 2,
|
||||
resizeType : 1,
|
||||
syncType : 'form',
|
||||
pasteType : 2,
|
||||
dialogAlignType : 'page',
|
||||
|
@ -4938,7 +4938,7 @@ KEditor.prototype = {
|
|||
afterSetHtml : function(fn) {
|
||||
return this.handler('afterSetHtml', fn);
|
||||
},
|
||||
create : function() {
|
||||
create : function() {K
|
||||
var self = this, fullscreenMode = self.fullscreenMode;
|
||||
if (self.isCreated) {
|
||||
return self;
|
||||
|
@ -5076,8 +5076,11 @@ KEditor.prototype = {
|
|||
self.afterSetHtml();
|
||||
},
|
||||
afterCreate : function() {
|
||||
self.edit = edit = this;
|
||||
self.loadPlugin('autoheight');
|
||||
self.edit = edit = this;
|
||||
self.cmd = edit.cmd;
|
||||
//edit.iframe[0].scroll = 'no';
|
||||
//edit.doc.body.style.overflowY = 'hidden';
|
||||
self._docMousedownFn = function(e) {
|
||||
if (self.menu) {
|
||||
self.hideMenu();
|
||||
|
@ -6015,6 +6018,7 @@ _plugin('core', function(K) {
|
|||
'white-space' : 'nowrap'
|
||||
});
|
||||
K(doc.body).append(div);
|
||||
|
||||
if (_IE) {
|
||||
var rng = cmd.range.get(true);
|
||||
rng.moveToElementText(div[0]);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
KindEditor.plugin('autoheight', function(K) {
|
||||
var self = this;
|
||||
|
||||
//self.autoHeightMode = true;
|
||||
if (!self.autoHeightMode) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@ a.c_green{ color:#28be6c;}
|
|||
.fontGrey {color:#cecece;}
|
||||
.fontGrey2 {color:#888888;}
|
||||
.fontGrey3 {color:#484848;}
|
||||
.fontGrey5 {color:#a1a1a1;}
|
||||
.fontBlue {color:#3498db;}
|
||||
a.underline {text-decoration:underline;}
|
||||
a.fontBlue {color:#297fb8;}
|
||||
|
@ -1482,3 +1483,7 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
|
|||
|
||||
/*视频播放默认图标*/
|
||||
.mediaIco{margin: 30px 0 30px 20px;width: 200px;}
|
||||
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
|
||||
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
|
||||
a:hover.st_img { border:1px solid #1c9ec7; }
|
|
@ -230,6 +230,7 @@ a.c_green{ color:#28be6c;}
|
|||
.fontGrey2 {color:#888888;}
|
||||
.fontGrey3 {color:#484848;}
|
||||
.fontGrey4{color:#999999;}
|
||||
.fontGrey5 {color:#a1a1a1;}
|
||||
.fontBlue {color:#3498db;}
|
||||
.fontBlue2 {color:#269ac9 !important;}
|
||||
a.underline {text-decoration:underline;}
|
||||
|
|
Loading…
Reference in New Issue