发送搜索功能

This commit is contained in:
huang 2016-01-08 18:03:59 +08:00
parent dc90976497
commit 0ab500986a
6 changed files with 8 additions and 6 deletions

View File

@ -280,7 +280,7 @@ class FilesController < ApplicationController
render :layout => 'base_projects' render :layout => 'base_projects'
elsif params[:course_id] elsif params[:course_id]
@container_type = 1 @container_type = 1
@page = params[:page] ? params[:page].to_i + 2 : 0
if params[:sort] if params[:sort]
params[:sort].split(",").each do |sort_type| params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":") order_by = sort_type.split(":")

View File

@ -123,7 +123,7 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div id="course_list"> <div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments, :page=>1} %>
</div> </div>
</div> </div>
<% html_title(l(:label_attachment_plural)) -%> <% html_title(l(:label_attachment_plural)) -%>

View File

@ -82,9 +82,9 @@
<% if curse_attachments.count == 10%> <% if curse_attachments.count == 10%>
<% if params[:action] == 'search' %> <% if params[:action] == 'search' %>
<%=link_to "点击展开更多", search_course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <%=link_to "点击展开更多", search_course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%else%> <% else %>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages --> <!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=link_to "点击展开更多", course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <%=link_to "点击展开更多", course_files_path(:course_id => course.id, :page => @page), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%end%> <%end%>
<% end%> <% end%>

View File

@ -23,7 +23,7 @@
observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids%>') observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
</script> </script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>--> <!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %> <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %> <% end %>
</div> </div>
<%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %> <%= form_tag add_exist_file_to_project_user_path(user),:remote=>true,:id=>'projects_list_form' %>

View File

@ -23,7 +23,7 @@
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>') observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
</script> </script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>--> <!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %> <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
<% end %> <% end %>
</div> </div>
<%= form_tag add_exist_file_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %> <%= form_tag add_exist_file_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %>

View File

@ -427,6 +427,8 @@ a:hover.search_btn{ background: #0fa9bb;}
.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} .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/homepage_icon.png) 5px -394px no-repeat; display:inline-block; float:left; cursor: pointer;} .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) 5px -394px no-repeat; display:inline-block; float:left; cursor: pointer;}
.searchIconPopup:hover {background:url(../images/homepage_icon.png) 5px -420px no-repeat;} .searchIconPopup:hover {background:url(../images/homepage_icon.png) 5px -420px no-repeat;}
.searchIcon2{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -273px no-repeat; display:inline-block; float:left; cursor: pointer;}
.searchIcon2:hover {background:url(../images/homepage_icon2.png) -180px -314px no-repeat;}
.courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;} .courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;}
.courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;}
.sendCourseName {font-size:12px; color:#5f6060;display:inline-block} .sendCourseName {font-size:12px; color:#5f6060;display:inline-block}