课堂搜索问题

sso
jingquan huang 5 years ago
parent 4669b0ad9c
commit 5438edf8e9

@ -18,9 +18,9 @@ class Admins::SubjectQuery < ApplicationQuery
status =
case params[:status].to_s.strip
when "editing" then {status: 0}
when "processed" then {status: 2, public: 0}
when "applying" then {status: 2, public: [0, 1]}
when "pending" then {public: 1}
when "publiced" then {public: 2}
when "published" then {public: 2}
end
subjects = subjects.where(status) if status

@ -6,7 +6,7 @@
<%= form_tag(admins_subject_settings_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group mr-1">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ['编辑中', 'pending'], ['审核中', 'applying'], ['已发布', 'published']] %>
<% status_options = [['全部', ''], ['编辑中', 'pending'], ['审核中', 'applying'], ['已公开', 'published']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>

Loading…
Cancel
Save