- <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',remote:true) do %>
+ <%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
@@ -22,7 +22,7 @@
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
- <%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %>
+ <%= link_to "清除",admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
<% end %>
导出
diff --git a/app/views/admins/shixuns/shared/_list.html.erb b/app/views/admins/shixuns/shared/_list.html.erb
index afa457a77..64fb32d56 100644
--- a/app/views/admins/shixuns/shared/_list.html.erb
+++ b/app/views/admins/shixuns/shared/_list.html.erb
@@ -14,36 +14,40 @@
- <% shixuns.each_with_index do |shixun,index| %>
-
- <%= (@params_page.to_i - 1) * 20 + index + 1%> |
- <%= shixun.identifier %> |
- <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> |
-
- <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
- |
-
- <% if shixun.try(:fork_from).nil? %>
- --
- <% else%>
- <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
- <% end%>
- |
- <%= shixun.challenges.where(:st => 0).size %> |
- <%= shixun.challenges.where(:st => 1).size %> |
- <%= shixun_authentication_status shixun %> |
- <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> |
- <%= format_time shixun.created_at %> |
-
- class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
-
- |
-
- <% if shixun.status == 0 %>
- <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
- <% end %>
- |
-
+ <% if shixuns.present? %>
+ <% shixuns.each_with_index do |shixun,index| %>
+
+ <%= (@params_page.to_i - 1) * 20 + index + 1%> |
+ <%= shixun.identifier %> |
+ <%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %> |
+
+ <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
+ |
+
+ <% if shixun.try(:fork_from).nil? %>
+ --
+ <% else%>
+ <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
+ <% end%>
+ |
+ <%= shixun.challenges.where(:st => 0).size %> |
+ <%= shixun.challenges.where(:st => 1).size %> |
+ <%= shixun_authentication_status shixun %> |
+ <%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %> |
+ <%= format_time shixun.created_at %> |
+
+ class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
+
+ |
+
+ <% if shixun.status == 0 %>
+ <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
+ <% end %>
+ |
+
+ <% end %>
+ <% else %>
+ <%= render 'admins/shared/no_data_for_table' %>
<% end %>