%div{class: "flex flex-col space-y-2 justify-center"} %div{class: "flex justify-between"} %div = form_with(url: reports_path, method: :get, class: "flex items-center") do |f| %div{class: "space-x-0.5"} = f.text_field :q, value: params[:q], placeholder: "关键词", class: "border rounded-md m py-0.5 px-1" = f.select :type, options_for_select(BeetleReporter::Report.record_type_options, params[:type]), {include_blank: "-- 筛选 --"}, class: "border rounded-md m py-0.5 px-1" = f.select :order, options_for_select([%w[按最近创建 last_created], %w[按最晚创建 oldest_created]], params[:order]), {include_blank: "-- 排序 --"}, class: "border rounded-md m py-0.5 px-1" = f.hidden_field :state, value: params[:state] = f.hidden_field :filter, value: params[:filter] = f.submit "检索", class: "rounded-md px-2 py-1 text-sm bg-black text-white cursor-pointer" = link_to "重置", reports_path, class: "text-sm" %div{class: "flex items-center space-x-2"} %div{class: "text-sm text-gray-600"}="共 #{@pagy.count} 条" %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state].blank? && params[:filter].blank? ? 'font-bold' : ''}"} = link_to "待处理", request.params.merge(state: "", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'ignored' ? 'font-bold' : ''}"} = link_to "无效举报", request.params.merge(state: "ignored", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'hidden' ? 'font-bold' : ''}"} = link_to "已隐藏", request.params.merge(state: "hidden", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'removed' ? 'font-bold' : ''}"} = link_to "已删除", request.params.merge(state: "removed", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'muted' ? 'font-bold' : ''}"} = link_to "已禁言用户", request.params.merge(state: "muted", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'forbiden' ? 'font-bold' : ''}"} = link_to "已封禁用户", request.params.merge(state: "forbiden", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:state] == 'suspended' ? 'font-bold' : ''}"} = link_to "暂缓处理", request.params.merge(state: "suspended", filter: "") %div{class: "bg-gray-200 rounded-full px-3 py-1 text-xs #{params[:filter] == "all" ? 'font-bold' : ''}"} = link_to "全部", request.params.merge(filter: "all", state: "") %div - if @reports.blank? %div{class: "flex justify-center text-gray-500 p-8 border rounded-md"} 空空如也 - else - @reports.each do |report| = render report %div{class: "flex justify-center mt-2"} = raw pagy_nav(@pagy)