Merge branch 'szzh' into develop

This commit is contained in:
huang 2015-08-21 16:18:48 +08:00
commit 11176574dc
36 changed files with 3881 additions and 43 deletions

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -14,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class UsersController < ApplicationController
layout :setting_layout
@ -41,13 +43,15 @@ class UsersController < ApplicationController
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages]
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,
:user_resource,:user_resource_create,:user_resource_delete,:rename_resource,:search_user_course,:add_exist_file_to_course,
:search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
@ -889,6 +893,272 @@ class UsersController < ApplicationController
end
end
# 上传用户资源
def user_resource_create
@user = User.find(params[:id])
#@user.save_attachments(params[:attachments],User.current)
# Container_type为Principal
Attachment.attach_filesex(@user, params[:attachments], params[:attachment_type])
if(params[:type].nil? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #Ta的资源库的话应该是他上传的公开资源 加上 他加入的所有我可见课程里的公开资源
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 " +
"and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) " +
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') ").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course')"+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "3" #项目资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project'").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' ").order("created_on desc")
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
end
end
@type = params[:type] || 1
@limit = 10
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
respond_to do |format|
format.js
end
end
# 删除用户资源,分为批量删除 和 单个删除,只能删除自己上传的资源
def user_resource_delete
if params[:resource_id].present?
Attachment.where("author_id = #{User.current.id}").delete(params[:resource_id])
elsif params[:checkbox1].present?
params[:checkbox1].each do |id|
Attachment.where("author_id = #{User.current.id}").delete(id)
end
end
if(params[:type].nil? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #Ta的资源库的话应该是他上传的公开资源 加上 他加入的所有我可见课程里的公开资源
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 " +
"and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) " +
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') ").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course')"+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "3" #项目资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project'").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' ").order("created_on desc")
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
end
end
@type = params[:type]
@limit = 10
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
respond_to do |format|
format.js
end
end
#根据id或者名称搜索教师或者助教为当前用户的课程
def search_user_course
@user = User.current
if !params[:search].nil?
@course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like '%#{params[:search.to_s]}%'")
.select { |course| @user.allowed_to?(:as_teacher,course)}
else
@course = @user.courses
.select { |course| @user.allowed_to?(:as_teacher,course)}
end
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids]
respond_to do |format|
format.js
end
end
# 根据id或者名称搜索当前用户所在的项目
def search_user_project
@user = User.current
if !params[:search].nil?
@projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like '%#{params[:search.to_s]}%'")
else
@projects = @user.projects
end
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
respond_to do |format|
format.js
end
end
# 将资源发送到对应的课程,分为发送单个,或者批量发送
def add_exist_file_to_course
if params[:send_id].present?
send_id = params[:send_id]
ori = Attachment.find_by_id(send_id)
course_ids = params[:course_ids]
unless course_ids.nil?
course_ids.each do |id|
next if ori.blank?
attach_copied_obj = ori.copy
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.container = Course.find(id)
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 4
end
attach_copied_obj.save
@save_message = attach_copied_obj.errors.full_messages
end
end
elsif params[:send_ids].present?
send_ids = params[:send_ids].split(" ")
send_ids.each do |send_id|
ori = Attachment.find_by_id(send_id)
course_ids = params[:course_ids]
unless course_ids.nil?
course_ids.each do |id|
next if ori.blank?
attach_copied_obj = ori.copy
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.container = Course.find(id)
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 4
end
attach_copied_obj.save
@save_message = attach_copied_obj.errors.full_messages
end
end
end
end
respond_to do |format|
format.js
end
end
# 添加资源到对应的项目
def add_exist_file_to_project
if params[:send_id].present?
send_id = params[:send_id]
project_ids = params[:projects_ids]
ori = Attachment.find_by_id(send_id)
unless project_ids.nil?
project_ids.each do |project_id|
next if ori.blank?
attach_copied_obj = ori.copy
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.container = Project.find(project_id)
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 1
end
attach_copied_obj.save
end
end
elsif params[:send_ids].present?
send_ids = params[:send_ids].split(" ")
send_ids.each do |send_id|
project_ids = params[:projects_ids]
ori = Attachment.find_by_id(send_id)
unless project_ids.nil?
project_ids.each do |project_id|
next if ori.blank?
attach_copied_obj = ori.copy
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
attach_copied_obj.container = Project.find(project_id)
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
if attach_copied_obj.attachtype == nil
attach_copied_obj.attachtype = 1
end
attach_copied_obj.save
end
end
end
else
end
respond_to do |format|
format.js
end
end
# 资源预览
def resource_preview
preview_id = params[:resource_id]
@file = Attachment.find(preview_id)
@preview_able = false;
if %w(pdf pptx doc docx xls xlsx).any?{|x| @file.filename.downcase.end_with?(x)}
@preview_able = true;
end
respond_to do |format|
format.js
end
end
# 重命名资源
def rename_resource
@attachment = Attachment.find(params[:res_id]) if params[:res_id].present?
if @attachment != nil
@attachment.filename = params[:res_name]
@flag = @attachment.save
end
# respond_to do |format|
# format.js
# end
if @flag
render :text=> download_named_attachment_path(@attachment.id, @attachment.filename)
else
render :text=>'fail'
end
end
def destroy
@user.destroy
respond_to do |format|
@ -1090,6 +1360,111 @@ class UsersController < ApplicationController
@user = User.find(params[:id])
end
# 资源库 分为全部 课程资源 项目资源 附件
def user_resource
#确定container_type
# @user = User.find(params[:id])
# 别人的资源库是没有权限去看的
if User.current.id.to_i != params[:id].to_i
render_403
return
end
if(params[:type].nil? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #Ta的资源库的话应该是他上传的公开资源 加上 他加入的所有我可见课程里的公开资源
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 " +
"and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) " +
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') ").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("(author_id = #{params[:id]} and is_public = 1 and container_type = 'Course')"+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')}))").order("created_on desc")
end
elsif params[:type] == "3" #项目资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project'").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' ").order("created_on desc")
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
end
end
@type = params[:type]
@limit = 10
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
respond_to do |format|
format.js
format.html {render :layout => 'base_users_new'}
end
end
# 根据资源关键字进行搜索
def resource_search
search = params[:search].to_s.strip.downcase
if(params[:type].nil? || params[:type] == "1") #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
@attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
" or (container_type = 'Course' and container_id in (#{user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type in" +
" ('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon'))"+
" or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')})) )" +
" and (filename like '%#{search}%') ").order("created_on desc")
end
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Course' and (filename like '%#{search}%')").order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.join(',')})) )"+
" and (filename like '%#{search}%') ").order("created_on desc")
end
elsif params[:type] == "3" #项目资源
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like '%#{search}%') ").order("created_on desc")
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
else
@attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
end
end
@type = params[:type]
@limit = 10
@is_remote = true
@obj_count = @attachments.count
@obj_pages = Paginator.new @obj_count, @limit, params['page'] || 1
@offset ||= @obj_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@attachments = paginateHelper @attachments,10
respond_to do |format|
format.js
end
end
private
def find_user
@ -1103,7 +1478,7 @@ class UsersController < ApplicationController
render_404
end
def setting_layout(default_base='base_users')
def setting_layout(default_base='base_users_new')
User.current.admin? ? default_base : default_base
end
@ -1153,4 +1528,7 @@ class UsersController < ApplicationController
impl.save
end
end
end

View File

@ -1852,7 +1852,8 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
elsif attachment.container.class.to_s == "User"
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
course = attachment.container.courses.first
candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1)

View File

@ -29,6 +29,29 @@ module UsersHelper
["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", '3']], selected.to_s)
end
def get_resource_type type
case type
when 'Course'
'课程资源'
when 'Project'
'项目资源'
when 'Issue'
'缺陷附件'
when 'Message'
'讨论区附件'
when 'Document'
'文档附件'
when 'News'
'通知附件'
when 'HomewCommon'
'作业附件'
when 'StudentWorkScore'
'批改附件'
when 'Principal'
'用户资源'
end
end
def user_mail_notification_options(user)
user.valid_notification_options.collect {|o| [l(o.last), o.first]}
end

View File

@ -157,7 +157,8 @@ class User < Principal
nil
}
acts_as_attachable :view_permission => :view_files,
:delete_permission => :manage_files
acts_as_customizable
############################added by william
acts_as_taggable
@ -272,6 +273,12 @@ class User < Principal
self.user_extensions ||= UserExtensions.new
end
# User现在可以作为一个Container_type,而Attachment的Container方法会有一个Container.try(:project),
# 所以这里定义一个空方法,保证不报错
def project
end
def user_score_attr
self.user_score ||= UserScore.new
end

View File

@ -146,6 +146,12 @@
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>@user.id,:type=>1)%>" class=" f14 c_blue02">
我的资源库
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=Attachment.where("(author_id = #{@user.id} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) or (container_type = 'Course' and container_id in (#{@user.courses.map{|c| c.id}.join(',')}))").count%>)</span>
</a>
</div>
<% else%>
<div class="subNav">
@ -160,6 +166,12 @@
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.visible.count%>)</span>
</a>
</div>
<div class="subNav">
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>@user.id,:type=>1)%>" class=" f14 c_blue02">
TA的资源库
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=Attachment.where("(author_id = #{@user.id} and is_public = 1 and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) or (container_type = 'Course' and is_public = 1 and container_id in (#{@user.courses.visible.map{|c| c.id}.join(',')}))").count%>)</span>
</a>
</div>
<% end %>
<div class="subNav ">
<%= link_to "留言",feedback_path(@user),:class => "f14 c_blue02"%>

View File

@ -0,0 +1,30 @@
<!--<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" style="<%#= ie8? ? 'display:none' : ''%>" type="button" ><%#= l(:label_browse) %></button>-->
<a href="javascript:void(0);" class="uploadIcon f14" name="button" onclick="_file.click()" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">
<span class="chooseFile">选择文件</span></a>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => ie8? ? '':'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '': 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
<!--<span id="upload_file_count">-->
<!--<%#= l(:label_no_file_uploaded)%>-->
<!--</span>-->
<!--(<%#= l(:label_max_size) %>:-->
<%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
<!--)-->

View File

@ -0,0 +1,7 @@
<%= form_tag( url_for(:controller => 'users',:action => 'resource_search',:id=>user.id),
:remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %>
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchResource" />
<%= hidden_field_tag(:type,type) %>
<%= 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>-->
<% end %>

View File

@ -0,0 +1,50 @@
<div class="resourceSharePopup">
<div>
<div class="sendText fl">将资源发送至</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
<option value="1">课程</option>
<option value="2" selected>项目</option>
</select>
</div>
</div>
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>
<div class="fl">
<%= form_tag search_user_project_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" name="search" placeholder="输入项目ID或者名称搜索" class="searchResourcePopup" />
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
</div>
<%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<% if !projects.empty? %>
<% projects.each do |project| %>
<ul class="courseSend fl">
<li class="fl">
<input name="projects_ids[]" type="checkbox" value="<%= project.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName fl"><%= truncate( project.name,:length=>18)%></li>
</ul>
<% end %>
</div>
<div>
<div class="courseSendSubmit">
<!--<a href="javascript:void(0);" class="sendSourceText">确定</a>-->
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
</div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="closeModal();">取消</a></div>
</div>
<div class="cl"></div>
<% end %>
</div>

View File

@ -0,0 +1,50 @@
<div class="resourceSharePopup">
<div>
<div class="sendText fl">将资源发送至</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
<option value="1">课程</option>
<option value="2">项目</option>
</select>
</div>
</div>
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>
<div class="fl">
<%= form_tag search_user_course_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" />
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %>
</div>
<%= form_tag add_exist_file_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<% if !courses.empty? %>
<% courses.each do |course| %>
<ul class="courseSend fl">
<li class="fl">
<input name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName fl"><%= truncate(course.name,:length=>18)%></li>
</ul>
<% end %>
</div>
<div>
<div class="courseSendSubmit">
<!--<a href="javascript:void(0);" class="sendSourceText">确定</a>-->
<%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
</div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="closeModal();">取消</a></div>
</div>
<div class="cl"></div>
<% end %>
</div>

View File

@ -0,0 +1,43 @@
<script>
$(document).ready(function(){
var popupHeight = $(".resourceUploadPopup").outerHeight(true);
$(".resourceUploadPopup").css("marginTop",-popupHeight/2);
$(".resourcePopupClose").click(function(){
$(".resourceUploadPopup").css("display","none");
});
});
</script>
<div class="resourceUploadPopup"><span class="uploadText">上传资源 </span>
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
<div class="uploadBoxContainer">
<div class="uploadBox"><a href="javascript:void(0);" class="uploadIcon f14"><span class="chooseFile">选择文件</span></a></div>
<div class="uploadResourceIntr">
<div class="uploadResourceName">(未选择文件)</div>
<div class="uploadResourceIntr2">您可以上传小于<span class="c_red">50MB</span>的文件</div>
</div>
</div>
<div>
<select class="uploadType">
<option value="">资源类型</option>
<option value="课件资源">课件资源</option>
<option value=“"项目资源">项目资源</option>
<option value="附件">附件</option>
<option value="无">无</option>
</select>
</div>
<div>
<input type="text" name="" placeholder="关键词" class="uploadKeyword" />
</div>
<div>
<div class="courseSendSubmit"><a href="javascript:void(0);" class="sendSourceText">确定</a></div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
</div>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,22 @@
<% if attachments.nil? || attachments.empty? %>
<% else %>
<% attachments.each do |attach| %>
<ul class="resourcesList">
<li class="resourcesListCheckbox fl">
<input name="checkbox1[]" type="checkbox" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
</li>
<li class="resourcesListName fl">
<!--<a href="javascript:void(0);" class="resourcesBlack"><%#=truncate(attach.filename,:length=>18)%></a>-->
<%= link_to truncate(attach.filename,:length=>18), download_named_attachment_path(attach.id, attach.filename),
:title => attach.filename,:class=>'resourcesBlack'%>
</li>
<li class="resourcesListSize fl"><%= number_to_human_size(attach.filesize) %></li>
<li class="resourcesListType fl"><%= get_resource_type(attach.container_type)%></li>
<li class="resourcesListUploader fl"><%=User.find(attach.author_id).realname %></li>
<li style="display: none"><%= attach.author_id %></li>
<li class="resourcesListTime fl"><%= format_date(attach.created_on) %></li>
<li style="display: none"><%= attach.id %></li>
</ul>
<% end %>
<% end %>

View File

@ -0,0 +1,53 @@
<div class="resourceUploadPopup"><span class="uploadDialogText">上传资源 </span>
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>
<div class="uploadBoxContainer">
<%= form_tag(user_resource_create_user_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
<div>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<script>alert('<% container%>')</script>
<% container.attachments.each_with_index do |attachment, i| %>
<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}][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>
<%= 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?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
</span>
</div>
<div class="uploadBox">
<input type="hidden" name="attachment_type" value="1">
<%= render :partial => 'attachment_list' %>
<div class="cl"></div>
<!--<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>-->
</div>
<div class="uploadResourceIntr">
<div class="uploadResourceName"><span id="upload_file_count">(未选择文件)</span></div>
<div class="uploadResourceIntr2">您可以上传小于<span class="c_red">50MB</span>的文件</div>
</div>
</div>
<div class="cl"></div>
<div style="margin-top: 10px" >
<div class="courseSendSubmit">
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:class=>'sendSourceText' %>
</div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="closeModal();">取消</a></div>
</div>
<% end %>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,2 @@
alert('发送成功')
closeModal();

View File

@ -0,0 +1,2 @@
alert('发送成功');
closeModal();

View File

@ -0,0 +1 @@
alert(1)

View File

@ -0,0 +1,5 @@
<% if @preview_able %>
top.location.href = '<%=download_named_attachment_path(@file.id, @file.filename, preview: true) %>'
<% else %>
window.alert('该资源不可预览')
<% end %>

View File

@ -0,0 +1,2 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

View File

@ -0,0 +1,11 @@
//var screenWidth = $(window).width();
//var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
//var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
//var objLeft = (screenWidth - 2)/2.5 ; //2 可以根据需要修改
//var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
var popupHeight = $(".resourceSharePopup").outerHeight(true);
$(".resourceSharePopup").css("marginTop",-popupHeight/2);
$("#upload_box").css('left','').css('top','');
$("#upload_box").html('<%= escape_javascript( render :partial => "resource_share_popup" ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
$("#upload_box").css('display','block');

View File

@ -0,0 +1,11 @@
//var screenWidth = $(window).width();
//var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
//var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
//var objLeft = (screenWidth - 2)/2.5 ; //2 可以根据需要修改
//var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
var popupHeight = $(".resourceSharePopup").outerHeight(true);
$(".resourceSharePopup").css("marginTop",-popupHeight/2);
$("#upload_box").css('left','').css('top','');
$("#upload_box").html('<%= escape_javascript( render :partial => "resource_share_for_project_popup" ,:locals => {:projects=>@projects,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
$("#upload_box").css('display','block');

View File

@ -0,0 +1,452 @@
<%= javascript_include_tag 'bootstrap'%>
<%= stylesheet_link_tag 'project' %>
<%= stylesheet_link_tag 'leftside' %>
<%= javascript_include_tag 'attachments'%>
<!--<script type="text/css">-->
<!--html,body{ overflow-y:scroll;}-->
<!--html,body{ overflow:scroll; min-height:101%;}-->
<!--html{ overflow:-moz-scrollbars-vertical;}-->
<!--</script>-->
<script>
function remote_get_resources(user_id,type){
}
function remote_search(){
$("#resource_search_form").submit();
}
function show_upload(){
var screenWidth = $(window).width();
var screenHeight = $(window).height(); //当前浏览器窗口的 宽高
var scrolltop = $(document).scrollTop();//获取当前窗口距离页面顶部高度
var objLeft = (screenWidth - 2)/2.5 ; //2 可以根据需要修改
var objTop = (screenHeight - 100)/2 + scrolltop; //100可以根据需要修改
var popupHeight = $(".resourceUploadPopup").outerHeight(true);
$(".resourceUploadPopup").css("marginTop",-popupHeight/2);
$("#upload_box").css('left',objLeft).css('top',objTop);
$("#upload_box").html('<%= escape_javascript( render :partial => 'upload_resource' ,:locals => {:user=>@user})%>');
$("#upload_box").css('display','block');
}
function closeModal()
{
$("#upload_box").css("display","none");
}
function check_files(){
return $("#attachments_fields").children().length == 0;
}
function submit_files(){
$("#upload_form").submit();
}
</script>
<div class="resources">
<div class="homepageRightBanner">
<div class="NewsBannerName">资源库</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li>
<%= link_to '全部' ,user_resource_user_path(:id=>@user.id,:type=>1),:remote=>true,:method => 'get',:class=>'resourcesTypeAll resourcesGrey' %>
</li>
<li>
<%= link_to '课程资源' ,user_resource_user_path(:id=>@user.id,:type=>2),:remote=>true,:method => 'get',:class=>'homepagePostTypeAssignment postTypeGrey' %>
</li>
<li>
<%= link_to '项目资源' ,user_resource_user_path(:id=>@user.id,:type=>3),:remote=>true,:method => 'get',:class=>'homepagePostTypeQuiz postTypeGrey' %>
</li>
<li>
<%= link_to '附件' ,user_resource_user_path(:id=>@user.id,:type=>4),:remote=>true,:method => 'get',:class=>'resourcesTypeAtt resourcesGrey' %>
</li>
</ul>
</li>
</ul>
</div>
<div class="resourcesSearchBanner">
<div class="resourcesUploadBox">
<a href="javascript:void(0);" onclick="show_upload();" class="uploadBoxIcon">上传资源</a></div>
<div id="search_div">
<%= render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} %>
</div>
</div>
<div class="resourcesListBanner">
<ul class="resourcesListTab">
<li class="resourcesListCheckbox fl"> </li>
<li class="resourcesListName fl">资源名称</li>
<li class="resourcesListSize fl">大小</li>
<li class="resourcesListType fl">类别</li>
<li class="resourcesListUploader fl">上传者</li>
<li class="resourcesListTime fl">上传时间</li>
</ul>
</div>
<form id="resources_list_form">
<div id="resources_list" class="resourcesList">
<%= render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments} %>
</div>
<div class="resourcesListOption">
<div class="resourcesCheckAll">
<input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" />
</div>
<a href="javascript:void(0);" class="replyGrey mr15" onclick="all_select();">全选</a>
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a>
<div class="resourcesSelectSend">
<div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div>
<div class="resourcesSelectSendButton" onclick="batch_send();">
<a href="javascript:void(0);" class="sendButtonBlue db" >发送</a>
</div>
</div>
</div>
</form>
</div>
<div>
<ul class="wlist" id="pages">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="cl"></div>
<div id="upload_box" style="display: none">
<%= render :partial => 'upload_resource' ,:locals => {:user=>@user}%>
</div>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" id="contextMenu">
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)preview();" onfocus="this.blur()">预览</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)rename();" onfocus="this.blur()">重命名</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)show_send();" onfocus="this.blur()" >发送</a></li>
<li><a tabindex="-1" href="#" onclick="if(<%= User.current.logged?%>)delete_file();" onfocus="this.blur()">删除</a></li>
</ul>
<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 发送到项目 2
var lastSendType; //保存上次发送的发送类型
$(".resourcesList").mousedown(function(e) {
//如果是右键的话
if (3 == e.which) {
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", '#00ffff');
//将当前元素赋给 上一个对象 保存起来。
last_line = line;
}
});
$(".resourcesList").click(function(e) {
//在列表上的任何单击事件都要恢复原来的样子
//隐藏右键菜单
$("#contextMenu").hide();
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();
}
}
//将当前行改变为白色
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(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 === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(@user)%>' + '?send_id=' + id
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(@user)%>' + '?send_id=' + id
});
}
}
function batch_send(){
if($("#resources_list_form").serialize() == ""){
alert('暂时不支持多页选择,您当前页没有选择任何资源');
return ;
}
if (lastSendType === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(@user)%>' + '?'+ $("#resources_list_form").serialize()
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(@user)%>' + '?' + $("#resources_list_form").serialize()
});
}
}
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('<%= form_tag(url_for(:controller => 'users',:action => 'rename_resource',:method => 'post',:remote=>true,:id=>@user.id),:id=>"res_name_form" ) do%>' +
'<input name="res_name" id="res_name" ' +
'style="height: 2em;line-height: 2em;overflow: hidden;" onblur="restore();" ' +
'value="'+res_name+
'"/> <input type="hidden" id ="res_id" name="res_id" value="'+id+'"/>'+
'<% end %>');
$("#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)){
$.post(
'<%=rename_resource_user_path(@user) %>',
"res_name="+$('#res_name').val()+"&res_id="+$("#res_id").val(),
function (data){
if(data != 'fail'){//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
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置空
}
},
'text'
);
}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(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('您无法删除此资源!')
}
}
//id 发送的id
//发送的id数组
function chooseSendType(res_id,res_ids){
sendType = $(".resourcesSendType").val();
if (sendType === lastSendType) {
return;
} else if (lastSendType != null) { //不是第一次点击的时候
if(res_ids == "") {//如果是单个发送
if (sendType === '1') {
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(@user)%>' + '?send_id=' + id
});
} else {
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(@user)%>' + '?send_id=' + id
});
}
}else{//如果是多个发送
if (sendType === '1'){
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(@user)%>' + '?'+ $("#resources_list_form").serialize()
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(@user)%>' + '?' + $("#resources_list_form").serialize()
});
}
}
}
lastSendType = sendType;
}
</script>

View File

@ -0,0 +1,3 @@
$("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>');
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

View File

@ -0,0 +1,4 @@
closeModal();
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');

View File

@ -0,0 +1,2 @@
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
$("#pages").html('<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');

View File

@ -345,6 +345,16 @@ RedmineApp::Application.routes.draw do
match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post]
match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
get "user_resource"
get "resource_search"
post "user_resource_create"
post "user_resource_delete"
get "search_user_course"
post "add_exist_file_to_course"
post "add_exist_file_to_project"
get 'resource_preview'
post 'rename_resource'
get 'search_user_project'
# end
end
end
@ -352,6 +362,8 @@ RedmineApp::Application.routes.draw do
match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get
match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get
#end
match 'my/account', :via => [:get, :post]
match 'my/account/destroy', :to => 'my#destroy', :via => [:get, :post]
@ -850,6 +862,7 @@ RedmineApp::Application.routes.draw do
match 'system_log/clear'
##ended by lizanle
resources :git_callback do
collection do
post 'post_update'

View File

@ -776,6 +776,16 @@ ActiveRecord::Schema.define(:version => 20150820004659) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_details_copy", :force => true do |t|
t.integer "journal_id", :default => 0, :null => false
t.string "property", :limit => 30, :default => "", :null => false
t.string "prop_key", :limit => 30, :default => "", :null => false
t.text "old_value"
t.text "value"
end
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id"
t.integer "user_id"

2363
public/javascripts/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

19
public/javascripts/jquery-1.3.2.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,64 @@
/* =================================================
//
// jQuery Fixed Plugins 1.3.1
// author :
// Url:
// Data : 2012-03-30
//
// 参数 : float --> 悬浮方向[left or right]
// minStatue --> 最小状态只有show_btn
// skin --> 皮肤控制
// durationTime --> 完成时间
//事例 :
$("#scrollsidebar2").fix({
float : 'right', //default.left or right
minStatue : true, //default.false or true
skin : 'green', //default.gray or yellow 、blue 、green 、orange 、white
durationTime : 1000 //
});
//
// =================================================*/
;(function($){
$.fn.fix = function(options){
var defaults = {
float : 'left',
minStatue : false,
skin : 'blue',
durationTime : 1000
}
var options = $.extend(defaults, options);
this.each(function(){
//获取对象
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content'),
sideList = thisBox.find('.side_list')
;
var defaultTop = thisBox.offset().top; //对象的默认top
thisBox.css(options.float, 0);
if(options.minStatue){
$(".show_btn").css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 25);
}
//close事件
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
});
//show事件
show_btn.click(function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
});
}); //end this.each
};
})(jQuery);

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -468,5 +468,67 @@ img,embed{max-width: 100%;}
/*a.f_grey {color:#666666;}*/
/*a.f_grey:hover {color:#000000;}*/
/*.navHomepageNews {width:30px; display:block; float:right; margin-top:5px; position:relative;}*/
/*.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;z-index:99;}*/
/*资源库*/
.resources {width:730px; background-color:#ffffff; padding:10px;}
.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;}
.bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;}
.resourcesSelect {width:40px; height:40px; float:right; position:relative;}
.resourcesSelected {width:25px; height:20px;}
.resourcesIcon {margin-top:15px; display:block; position:relative; background:url(../images/resource_icon_list.png) 0px 0px no-repeat; width:25px; height:20px;}
.resourcesIcon:hover { background:url(../images/resource_icon_list.png) 0px -25px no-repeat;}
.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;}
a.resourcesGrey {font-size:12px; color:#888888;}
a.resourcesGrey:hover {font-size:12px; color:#15bccf;}
.resourcesBanner ul li:hover ul.resourcesType {display:block;}
ul li:hover ul {display:block;}
.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}
.uploadIcon {background:url(../images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:30px; height:30px; margin-left:-3px;}
a.uploadText {color:#ffffff; font-size:14px;}
.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:right; background-color:#ffffff;}
.searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;}
.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(../images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;}
.resourcesSearchBanner {height:34px; margin-bottom:10px;}
.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}
.resourcesListName {width:175px; height:40px; line-height:40px; text-align:center;}
.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;}
.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;}
.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;}
.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;}
.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;}
a.resourcesBlack {font-size:12px; color:#4c4c4c;}
a.resourcesBlack:hover {font-size:12px; color:#000000;}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 80px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 12px;
text-align: left;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.5;
color:#616060;
white-space: nowrap;
}
.dropdown-menu > li > a:hover{
color: #ffffff;
text-decoration: none;
background-color: #64bdd9;
outline:none;
}

View File

@ -444,44 +444,59 @@ div.ke-statusbar{height:1px; border-top:none;}
/*.copyright{ width:390px; margin:0 auto;height:20px;line-height:20px;}*/
/*a.f_grey {color:#666666;}*/
/*a.f_grey:hover {color:#000000;}*/
/*主类容左右分栏*/
#LSide{ width:240px; }
#RSide{ width:730px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;}
/*资源库*/
.resources {width:730px; background-color:#ffffff;}
.resources {width:728px; background-color:#ffffff; padding:10px; border:1px solid #dddddd;float: right}
/*.resources {width:730px; background-color:#ffffff; padding:10px;float: right}*/
.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;}
.bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;}
.resourcesSelect {width:40px; height:40px; float:right; position:relative;}
.resourcesSelected {width:25px; height:20px;}
.resourcesIcon {margin-top:15px; display:block; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat; width:25px; height:20px;}
.resourcesIcon:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;}
.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;}
.resourcesSelect {width:30px; height:34px; float:right; position:relative; margin-top:-6px;}
.resourcesSelected {width:25px; height:20px; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat;}
.resourcesSelected:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;}
.resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;}
/*.resourcesIcon {margin-top:15px; display:block; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat; width:25px; height:20px;}*/
/*.resourcesIcon:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;}*/
/*.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;}*/
a.resourcesGrey {font-size:12px; color:#888888;}
a.resourcesGrey:hover {font-size:12px; color:#15bccf;}
.resourcesBanner ul li:hover ul.resourcesType {display:block;}
ul li:hover ul {display:block;}
.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}
.resourcesUploadBox:hover {background-color:#0781b4;}
.uploadIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:30px; height:30px; margin-left:-3px;}
a.uploadText {color:#ffffff; font-size:14px;}
.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:right; background-color:#ffffff;}
.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;}
.searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;}
.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;}
.resourcesSearchBanner {height:34px; margin-bottom:10px;}
.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}
.resourcesListCheckbox {width:40px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}
.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;}
.resourcesListName {width:135px; height:40px; line-height:40px; text-align:left;}
.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;}
/*.resourcesSearchBanner {height:34px; margin-bottom:10px;}*/
.resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;}
/*.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}*/
.resourcesListTab {width:710px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a; margin-left:auto; margin-right:auto;}
/*.resourcesListName {width:175px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;}*/
.resourcesListName {width:160px; height:40px; line-height:40px; text-align:left;}
.resourcesListSize {width:105px; height:40px; line-height:40px; text-align:center;}
.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;}
.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;}
.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;}
.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;}
a.resourcesBlack {font-size:12px; color:#4c4c4c;}
.resourcesListUploader {width:180px; height:40px; line-height:40px; text-align:center;}
.resourcesListTime {width:95px; height:40px; line-height:40px; text-align:center;}
/*.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;}*/
a.resourcesBlack {font-size:12px; color:#4c4c4c;white-space: nowrap;text-align: left}
a.resourcesBlack:hover {font-size:12px; color:#000000;}
.resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}
.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;}
.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;}
.resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;}
.resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;}
.resourcesSelectSend {float:right;}
/*.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #15bccf; border-radius:5px; float:right;}*/
.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #15bccf; border-radius:5px; float:right;}
a.sendButtonBlue {color:#15bccf;}
a.sendButtonBlue:hover {color:#ffffff;}
.resourcesSelectSendButton:hover {background-color:#15bccf;}
.db {display:block;}
.dropdown-menu {
position: absolute;
top: 100%;
@ -517,11 +532,39 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
background-color: #64bdd9;
outline:none;
}
.homepageRightBanner {width:720px; height:34px; margin:0px auto; border-bottom:1px solid #e9e9e9;}
.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; background:url(images/homepage_icon.png) -18px -230px no-repeat; width:150px; float:left; padding-left:15px; margin-top:4px;}
a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;}
a.resourcesTypeAtt {background:url(images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;}
.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;}
.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}
.resourcesUploadBox:hover {background-color:#0781b4;}
/* 个人主页右边部分*/
.homepageSearchIcon {width:30px; height:32px; background:url(images/nav_icon.png) -8px 3px no-repeat; float:left;}
a.homepagePostTypeQuiz {background:url(images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
a.homepagePostTypeAssignment {background:url(images/homepage_icon.png) -93px -318px no-repeat; padding-left:23px;}
a.replyGrey {color:#888888; display:inline-block;}
a.replyGrey:hover {color:#4b4b4b;}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
.uploadDialogText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:140px; display:inline-block;}
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative}
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#64bdd9; border-radius:3px; float:left; margin-right:12px;}
a.uploadBoxIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;}
a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px;}
.chooseFile {color:#ffffff; display:block; margin-left:32px;}
.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}
.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}
.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}
.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}
.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}
/*发送资源弹窗*/
/*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/
/*.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}*/
.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}
.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:140px; display:inline-block;}
.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:100px; display:inline-block;}
.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}
.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
@ -533,19 +576,112 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
.courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#64bdd9; margin-right:25px; float:left;}
.courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left}
a.sendSourceText {font-size:14px; color:#ffffff;}
input.sendSourceText {font-size:14px;color:#ffffff;background-color:#64bdd9;}
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;}
/*主类容左右分栏*/
#LSide{ width:240px; }
#RSide{ width:730px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;}
/*资源库*/
/*.resources {width:730px; background-color:#ffffff;}*/
/*.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;}*/
/*.bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;}*/
/*.resourcesSelect {width:40px; height:40px; float:right; position:relative;}*/
/*.resourcesSelected {width:25px; height:20px;}*/
/*.resourcesIcon {margin-top:15px; display:block; position:relative; background:url(images/resource_icon_list.png) 0px 0px no-repeat; width:25px; height:20px;}*/
/*.resourcesIcon:hover { background:url(images/resource_icon_list.png) 0px -25px no-repeat;}*/
/*.resourcesType {width:50px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-30px; font-size:12px; color:#888888; display:none;}*/
/*a.resourcesGrey {font-size:12px; color:#888888;}*/
/*a.resourcesGrey:hover {font-size:12px; color:#15bccf;}*/
/*.resourcesBanner ul li:hover ul.resourcesType {display:block;}*/
/*ul li:hover ul {display:block;}*/
/*.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}*/
/*.uploadIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:30px; height:30px; margin-left:-3px;}*/
/*a.uploadText {color:#ffffff; font-size:14px;}*/
/*.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:right; background-color:#ffffff;}*/
/*.searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;}*/
/*.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;}*/
/*.resourcesSearchBanner {height:34px; margin-bottom:10px;}*/
/*.resourcesListTab {width:730px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a;}*/
/*.resourcesListCheckbox {width:40px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}*/
/*.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;}*/
/*.resourcesListName {width:135px; height:40px; line-height:40px; text-align:left;}*/
/*.resourcesListSize {width:110px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListUploader {width:130px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesListTime {width:165px; height:40px; line-height:40px; text-align:center;}*/
/*.resourcesList {width:730px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px;}*/
/*a.resourcesBlack {font-size:12px; color:#4c4c4c;}*/
/*a.resourcesBlack:hover {font-size:12px; color:#000000;}*/
/*.dropdown-menu {*/
/*position: absolute;*/
/*top: 100%;*/
/*left: 0;*/
/*z-index: 1000;*/
/*display: none;*/
/*float: left;*/
/*min-width: 80px;*/
/*padding: 5px 0;*/
/*margin: 2px 0 0;*/
/*font-size: 12px;*/
/*text-align: left;*/
/*background-color: #fff;*/
/*-webkit-background-clip: padding-box;*/
/*background-clip: padding-box;*/
/*border: 1px solid #ccc;*/
/*border-radius: 4px;*/
/*-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);*/
/*box-shadow: 0 6px 12px rgba(0, 0, 0, .175);*/
/*}*/
/*.dropdown-menu > li > a {*/
/*display: block;*/
/*padding: 3px 20px;*/
/*clear: both;*/
/*font-weight: normal;*/
/*line-height: 1.5;*/
/*color:#616060;*/
/*white-space: nowrap;*/
/*}*/
/*.dropdown-menu > li > a:hover{*/
/*color: #ffffff;*/
/*text-decoration: none;*/
/*background-color: #64bdd9;*/
/*outline:none;*/
/*}*/
/*发送资源弹窗*/
/*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/
/*.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}*/
/*.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:140px; display:inline-block;}*/
/*.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}*/
/*.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}*/
/*.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}*/
/*.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;}*/
/*.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;}*/
/*.courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;}*/
/*.courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;}*/
/*.sendCourseName {font-size:12px; color:#5f6060;}*/
/*.courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#64bdd9; margin-right:25px; float:left;}*/
/*.courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left}*/
/*a.sendSourceText {font-size:14px; color:#ffffff;}*/
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
.uploadText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:140px; display:inline-block;}
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;}
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#64bdd9; border-radius:3px; float:left; margin-right:12px;}
a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px;}
.chooseFile {color:#ffffff; display:block; margin-left:32px;}
.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}
.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}
.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}
.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}
.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}
/*.resourceUploadPopup {width:400px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}*/
/*.uploadText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:140px; display:inline-block;}*/
/*.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;}*/
/*.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#64bdd9; border-radius:3px; float:left; margin-right:12px;}*/
/*a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px;}*/
/*.chooseFile {color:#ffffff; display:block; margin-left:32px;}*/
/*.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}*/
/*.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}*/
/*.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}*/
/*.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}*/
/*.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}*/
/*新个人主页框架css*/