题库的搜索调整

This commit is contained in:
cxt 2016-08-03 14:06:47 +08:00
parent acc3ba121f
commit bae775ec34
5 changed files with 35 additions and 32 deletions

View File

@ -1,3 +1,7 @@
<% if homeworks.empty? %>
<div class="icons_tishi"><img src="../images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
<% homeworks.each do |homework| %>
<ul class="sy_classlist">
<span class="hw_icons_cir fl mt5 mr5"></span>
@ -51,3 +55,4 @@
<div class="cl"></div>
</ul>
<% end %>
<% end %>

View File

@ -1,16 +1,6 @@
<span class="sy_cgrey ">排序:</span>
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "publish_time" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "quotes" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<div id="homework_repository_sort">
<%= render :partial => 'users/homework_repository_sort', :locals => {:type => type,:is_import => is_import,:property => property,:order => @order,:search => search} %>
</div>
<div class="hw_search_box fr mr10">
<input class="hw_search-input" name="search" value='<%=search %>' placeholder="输入作业、老师姓名的关键词进行搜索" type="text" >

View File

@ -0,0 +1,13 @@
<span class="sy_cgrey ">排序:</span>
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "publish_time" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "publish_time", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "sy_cgrey fl",:remote => true%>
<% if order == "quotes" %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "#{@r_sort == 'asc' ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
<% else %>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort), :class => "sortdownbtn sort_no mt15 fl", :remote => true %>
<% end %>

View File

@ -48,12 +48,8 @@
</div>
<div class="cl"></div>
<div id="hw_tab_con_1">
<% if @homeworks.empty? %>
<div class="icons_tishi"><img src="../images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">暂无可显示的内容~</p>
<% else %>
<div class="sy_category" id="homework_search_input">
<%=render :partial=>'homework_repository_search', :locals=>{:type => '1',:is_import => 0,:property => nil,:order => @order, :b_sort => @b_sort, :search => ''} %>
<%=render :partial=>'homework_repository_search', :locals=>{:type => '1',:is_import => 0,:property => nil,:order => @order, :search => ''} %>
</div>
<div class="sy_classbox" style="min-height:800px;" id="homework_repository_list">
@ -66,6 +62,5 @@
</ul>
</div>
<div class="cl"></div>
<% end %>
</div>
</div>

View File

@ -5,5 +5,5 @@ $("#homework_detail_information").html("<%=escape_javascript(render :partial =>
<% else %>
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
$("#homework_search_input").html('<%= escape_javascript(render :partial => 'users/homework_repository_search', :locals => {:type => @type,:is_import => @is_import,:property => @property,:order => @order, :b_sort => @b_sort, :search => @search})%>');
$("#homework_repository_sort").html('<%= escape_javascript(render :partial => 'users/homework_repository_sort', :locals => {:type => @type,:is_import => @is_import,:property => @property,:order => @order, :search => @search})%>');
<% end %>