diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 31a23d9ed..cd2bd1327 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -69,23 +69,23 @@
- <%= form_tag( search_course_files_path(@project), method: 'get',:class => "re_search",:remote=>true) do %> - <%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %> - <%= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite" %> + <%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search f_l",:remote=>true) do %> + <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%> + <%= submit_tag "项目内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()", :style =>"width:72px;" %> + <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% if (@project.publish_resource==1 && User.current.member_of?(@project) ) %> diff --git a/config/routes.rb b/config/routes.rb index 99455743d..571f78045 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -652,7 +652,7 @@ RedmineApp::Application.routes.draw do resources :files, :only => [:index, :new, :create] do collection do match "getattachtype", :via => [:get, :post] - match "search",:via => [:post,:get] + match "search_project",:via => [:post,:get] match "searchone4reload",:via => [:post,:get] match "search_tag_attachment", :via => [:post,:get] end diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 67fecaa3f..0f4ef57fe 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -611,3 +611,30 @@ function submit_topic_project() function reset_topic(){ } + +//查找TAG资源 +var clickFunction = null; //单击事件函数 +var isdb = false; //是否双击 +function search_tag_attachment(url,tag_name,q,course_id,sort) +{ + //alert("111"); + //clearTimeout(clickFunction); + clickFunction = setTimeout(function() { + search_func() + }, 500); + function search_func(){ + if(isdb!= false ) return; + $.get( + url, + { + tag_name: tag_name, + q: q, + course_id:course_id + }, + function (data) { + + } + ); + } + +} diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 2e8133172..8d4432832 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1239,13 +1239,6 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; div.disable_link {background-color: #c1c1c1 !important;} .reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} -/*新课程资源库*/ -.reCon{ margin:5px; width:710px;} -.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} -.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} -.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} -.blueBtn:hover {background-color:#298fbd;} - /*问题状态图片*/ .issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;} .duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index e898db13e..54e521c59 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -956,4 +956,11 @@ span.at {color:#269ac9;} .sectionContent li:hover {background-color:#cccccc;} .sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;} .orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;} -.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;} \ No newline at end of file +.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;} + +/*新课程、项目资源库*/ +.reCon{ margin:5px; width:710px;} +.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} +.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;} +.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;} +.blueBtn:hover {background-color:#298fbd;}