From 8d9e53da2b32db458c0dd24b3595391e5129643e Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 2 May 2022 16:52:11 -0500 Subject: [PATCH] Fix #5145: Add "Category" field to the wiki pages search. --- app/views/wiki_pages/_search.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/wiki_pages/_search.html.erb b/app/views/wiki_pages/_search.html.erb index caa3ee4c0..19758c4c8 100644 --- a/app/views/wiki_pages/_search.html.erb +++ b/app/views/wiki_pages/_search.html.erb @@ -3,6 +3,9 @@ <%= f.input :other_names_match, label: "Other names", input_html: { value: params[:search][:other_names_match] } %> <%= f.input :title_or_body_matches, label: "Text", input_html: { value: params[:search][:title_or_body_matches] } %> <%= f.input :linked_to, hint: "Find wikis linking to this wiki", input_html: { value: params[:search][:linked_to], "data-autocomplete": "wiki-page" } %> + <%= f.simple_fields_for :tag do |fa| %> + <%= fa.input :category, collection: TagCategory.canonical_mapping.to_a, include_blank: true, selected: params.dig(:search, :tag, :category) %> + <% end %> <%= f.input :is_deleted, label: "Deleted?", as: :select, include_blank: true, selected: params[:search][:is_deleted] %> <%= f.input :order, collection: [%w[Newest created_at], %w[Title title], %w[Posts post_count]], include_blank: true, selected: params[:search][:order] %> <%= f.submit "Search" %>