课程通知查询不使用ajax局部刷新

This commit is contained in:
sw 2015-07-24 11:50:50 +08:00
parent f4360e66dd
commit 0e56a79622
2 changed files with 4 additions and 5 deletions

View File

@ -71,8 +71,7 @@ class NewsController < ApplicationController
scope = @course ? @course.news.course_visible : News.course_visible
@news_count = scope.count
#@news_pages = Paginator.new @news_count, @limit, params['page']
#@offset ||= scope_page.offset
@q = params[:subject]
if params[:subject].nil?
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")

View File

@ -24,8 +24,8 @@
<% end %>
</div>
<div class="problem_search fr" >
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course },:remote=>'true', :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="" onkeypress="" onkeydown="">
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course }, :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="<%= @q%>" onkeypress="" onkeydown="">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_search();" >搜索</a>
<% end %>
</div><!--problem_search end-->
@ -34,7 +34,7 @@
<div id="news_list">
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
<div>
</div>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>