From f3b8a5e952f96cc28d82947bedaec4f77c24feaa Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 29 Jun 2017 10:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AE=9E=E8=AE=AD=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E4=B8=AD=E7=9A=84=E9=80=89=E6=8B=A9=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=EF=BC=8C=E6=90=9C=E7=B4=A2=E6=A1=86=E6=B2=A1=E6=9C=89=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=90=9C=E7=B4=A2=E5=85=B3=E9=94=AE=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=9B=BE=E6=A0=87=E7=82=B9=E5=87=BB=E6=97=A0?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_new_shixun_homework_list.html.erb | 11 +++++++++++ app/views/homework_common/_shixuns.html.erb | 18 ++++-------------- app/views/homework_common/shixuns.js.erb | 6 +++++- 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 app/views/homework_common/_new_shixun_homework_list.html.erb diff --git a/app/views/homework_common/_new_shixun_homework_list.html.erb b/app/views/homework_common/_new_shixun_homework_list.html.erb new file mode 100644 index 000000000..332192e03 --- /dev/null +++ b/app/views/homework_common/_new_shixun_homework_list.html.erb @@ -0,0 +1,11 @@ +<% @shixuns.each do |shixun| %> + + + + + <%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3" %> + + <%= link_to shixun.owner.try(:show_name), user_path(shixun.owner), :class => "edu-txt-w140 mt3 task-hide" %> + <%= shixun.myshixuns.count %> + +<% end %> \ No newline at end of file diff --git a/app/views/homework_common/_shixuns.html.erb b/app/views/homework_common/_shixuns.html.erb index 6463e30ef..b9ecd8ad9 100644 --- a/app/views/homework_common/_shixuns.html.erb +++ b/app/views/homework_common/_shixuns.html.erb @@ -4,8 +4,8 @@
- <%= labelled_form_for @homework, :url =>{:controller=> 'homework_common', :action => 'shixuns', :course => @course.id}, :id => 'shixun_search_form', :method => "get", :remote => true do |f| %> -
+ <%= labelled_form_for @homework, :url =>{:controller=> 'homework_common', :action => 'shixuns', :course => @course.id, :is_search => 1}, :html => {:id => 'shixun_search_form'}, :method => "get", :remote => true do |f| %> +
@@ -22,18 +22,8 @@ 请至少选中一个实训 - - <% @shixuns.each do |shixun| %> - - - - - <%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3" %> - - <%= link_to shixun.owner.try(:show_name), user_path(shixun.owner), :class => "edu-txt-w140 mt3 task-hide" %> - <%= shixun.myshixuns.count %> - - <% end %> + + <%= render :partial => "new_shixun_homework_list" %> <% end %> diff --git a/app/views/homework_common/shixuns.js.erb b/app/views/homework_common/shixuns.js.erb index 5381d0188..5192bd2a6 100644 --- a/app/views/homework_common/shixuns.js.erb +++ b/app/views/homework_common/shixuns.js.erb @@ -1,2 +1,6 @@ +<% if params[:is_search] %> +$("#new_shixun_homework_list").html("<%= j(render :partial => 'new_shixun_homework_list') %>"); +<% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/shixuns') %>"; -pop_box_new(htmlvalue, 680, 454); \ No newline at end of file +pop_box_new(htmlvalue, 680, 454); +<% end %> \ No newline at end of file