搜索课程

This commit is contained in:
yuanke 2016-10-09 11:01:52 +08:00
parent eb3a463166
commit cd34388909
2 changed files with 8 additions and 6 deletions

View File

@ -2,10 +2,10 @@
<% syllabuses.each do |syllabus|%> <% syllabuses.each do |syllabus|%>
<ul class="searchContent w968"> <ul class="searchContent w968">
<li class="f16 mb5 fontGrey3"><a href="javascript:void(0);" class="fontGrey3 fl"><span class="c_red"><%= syllabus.title %></span>课程</a><div class="mt5 fl"><img src="images/search_icon_03.png" width="8" height="16" class="fl" /><span class="searchTag">课程</span></div><div class="cl"></div></li> <li class="f16 mb5 fontGrey3"><a href="javascript:void(0);" class="fontGrey3 fl"><span class="c_red"><%= syllabus.title %></span>课程</a><div class="mt5 fl"><img src="images/search_icon_03.png" width="8" height="16" class="fl" /><span class="searchTag">课程</span></div><div class="cl"></div></li>
<li class="f12 fontGrey2"><span class="mr30">创建者:<%=syllabus.user.login+"("+syllabus.user.show_name+")"%></span><span class="mr30">教师团队:<%=syllabus.syllabus_member.count%></span><span class="mr30">班级:<%=syllabus.courses.count%></span><span class="mr30">更新时间:<%=format(syllabus.updated_at)%></span><span class="mr30">单位:<%=syllabus.user.user_extensions.occupation.present? ? syllabus.user.user_extensions.occupation:'' %></span></li> <li class="f12 fontGrey2"><span class="mr30">创建者:<%=syllabus.user.login+"("+syllabus.user.show_name+")"%></span><span class="mr30">教师团队:<%=syllabus.syllabus_members.count%></span><span class="mr30">班级:<%=syllabus.courses.count%></span><span class="mr30">更新时间:<%=format_date(syllabus.updated_at)%></span><span class="mr30">单位:<%=syllabus.user.user_extensions.occupation.present? ? syllabus.user.user_extensions.occupation:'' %></span></li>
</ul> </ul>
<% end %> <% end %>
<div class="pageRoll"> <div class="pageRoll">
<%= paginate courses,:params => {:controller => 'welcome', :action => 'search',:search_type=>'course'}%> <%= paginate syllabuses,:params => {:controller => 'welcome', :action => 'search',:search_type=>'syllabus'}%>
</div> </div>
<% end %> <% end %>

View File

@ -3,13 +3,15 @@
$("#searchContent_1").html('<%= escape_javascript(render :partial => 'search_all_results',:locals => {:all_results=> @alls})%>'); $("#searchContent_1").html('<%= escape_javascript(render :partial => 'search_all_results',:locals => {:all_results=> @alls})%>');
<% when 'user'%> <% when 'user'%>
$("#searchContent_2").html('<%= escape_javascript(render :partial => 'search_user_results',:locals => {:users=>@users})%>'); $("#searchContent_2").html('<%= escape_javascript(render :partial => 'search_user_results',:locals => {:users=>@users})%>');
<% when 'syllabus'%>
$("#searchContent_3").html('<%= escape_javascript(render :partial => 'search_syllabus_results',:locals => {:syllabuses=>@syllabuses})%>');
<% when 'course'%> <% when 'course'%>
$("#searchContent_3").html('<%= escape_javascript(render :partial => 'search_course_results',:locals => {:courses=>@courses})%>'); $("#searchContent_4").html('<%= escape_javascript(render :partial => 'search_course_results',:locals => {:courses=>@courses})%>');
<% when 'project'%> <% when 'project'%>
$("#searchContent_5").html('<%= escape_javascript(render :partial => 'search_project_results',:locals => {:projects=>@projects})%>'); $("#searchContent_6").html('<%= escape_javascript(render :partial => 'search_project_results',:locals => {:projects=>@projects})%>');
<% when 'attachment'%> <% when 'attachment'%>
$("#searchContent_4").html('<%= escape_javascript(render :partial => 'search_attachment_results',:locals => {:attachments=>@attachments})%>'); $("#searchContent_5").html('<%= escape_javascript(render :partial => 'search_attachment_results',:locals => {:attachments=>@attachments})%>');
<% when 'memo'%> <% when 'memo'%>
$("#searchContent_6").html('<%= escape_javascript(render :partial => 'search_memo_results',:locals => {:memos=>@memos})%>'); $("#searchContent_7").html('<%= escape_javascript(render :partial => 'search_memo_results',:locals => {:memos=>@memos})%>');
<%else%> <%else%>
<%end %> <%end %>