dev_ec^2
parent
2587be26b3
commit
45f337e66f
@ -1,6 +1,15 @@
|
||||
class Admins::CompetitionController < Admins::BaseController
|
||||
class Admins::CompetitionsController < Admins::BaseController
|
||||
|
||||
def index
|
||||
params[:sort_by] = params[:sort_by].presence || 'created_on'
|
||||
params[:sort_direction] = params[:sort_direction].presence || 'desc'
|
||||
@competitions = custom_sort Competition.all, params[:sort_by], params[:sort_direction]
|
||||
@params_page = params[:page] || 1
|
||||
@competitions = paginate @competitions
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('竞赛列表', admins_competitions_path) %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container shixuns-list-form">
|
||||
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
|
||||
<div class="form-group mr-2">
|
||||
<label for="status">状态:</label>
|
||||
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
|
||||
<div class="form-group mr-2">
|
||||
<label for="tag-choosed">技术平台:</label>
|
||||
<%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"tag-choosed") %>
|
||||
</div>
|
||||
|
||||
<div class="form-group ml-3">
|
||||
<label>搜索类型:</label>
|
||||
<% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %>
|
||||
<%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= 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,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
|
||||
<% end %>
|
||||
<a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a>
|
||||
</div>
|
||||
|
||||
<div class="box shixuns-list-container">
|
||||
<%= render partial: 'admins/shixuns/shared/list', locals: { shixuns: @shixuns } %>
|
||||
</div>
|
Loading…
Reference in new issue