parent
34ac56e0a0
commit
1c3bff0007
|
@ -1367,7 +1367,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
|
||||
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')) "+
|
||||
|
@ -1856,7 +1856,7 @@ class UsersController < ApplicationController
|
|||
# 根据资源关键字进行搜索
|
||||
def resource_search
|
||||
search = params[:search].to_s.strip.downcase
|
||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1") #全部
|
||||
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
|
||||
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')) "+
|
||||
|
|
|
@ -1,7 +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) %>
|
||||
<%= hidden_field_tag(:type,type.nil? ? 1 : 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 %>
|
|
@ -5,7 +5,7 @@
|
|||
<!--</p>-->
|
||||
<% else %>
|
||||
<% attachments.each do |attach| %>
|
||||
<ul class="resourcesList" onmouseover="$(this).children().css('background-color', '#e1e1e1')" onmouseout="$(this).children().css('background-color', 'white')">
|
||||
<ul class="resourcesList" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
|
||||
<li class="resourcesListCheckbox fl">
|
||||
<input name="checkbox1[]" type="checkbox" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
</li>
|
||||
|
|
|
@ -480,54 +480,5 @@
|
|||
|
||||
lastSendType = sendType;
|
||||
}
|
||||
// var iWidth = document.documentElement.clientWidth;
|
||||
// var iHeight = document.documentElement.clientHeight;
|
||||
// var moveX = 0;
|
||||
// var moveY = 0;
|
||||
// var moveTop = 0;
|
||||
// var moveLeft = 0;
|
||||
// var moveable = false;
|
||||
// var docMouseMoveEvent = document.onmousemove;
|
||||
// var docMouseUpEvent = document.onmouseup;
|
||||
// $("#upload_box").mousedown(function() {
|
||||
// var evt = getEvent();
|
||||
// moveable = true;
|
||||
// moveX = evt.clientX;
|
||||
// moveY = evt.clientY;
|
||||
//
|
||||
// moveTop = parseInt($("#upload_box").css('top'));
|
||||
// moveLeft = parseInt($("#upload_box").css('left'));
|
||||
//
|
||||
// $(document).mousemove( function() {
|
||||
// if (moveable) {
|
||||
// var evt = getEvent();
|
||||
// var x = moveLeft + evt.clientX - moveX;
|
||||
// var y = moveTop + evt.clientY - moveY;
|
||||
// if ( x > 0 &&( x + 322 < iWidth) && y > 0 && (y + 257 < iHeight) ) {
|
||||
// $("#upload_box").css('left', x + "px");
|
||||
// $("#upload_box").css('top', y + "px");
|
||||
// console.log( moveX)
|
||||
// console.log( moveY)
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// $(document).mouseup (function () {
|
||||
// if (moveable) {
|
||||
// document.onmousemove = docMouseMoveEvent;
|
||||
// document.onmouseup = docMouseUpEvent;
|
||||
// moveable = false;
|
||||
// moveX = 0;
|
||||
// moveY = 0;
|
||||
// moveTop = 0;
|
||||
// moveLeft = 0;
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// // 获得事件Event对象,用于兼容IE和FireFox
|
||||
// function getEvent() {
|
||||
// return window.event || arguments.callee.caller.arguments[0];
|
||||
// }
|
||||
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue