diff --git a/app/views/post_versions/index.html.erb b/app/views/post_versions/index.html.erb index 4e864b748..246ecaac4 100644 --- a/app/views/post_versions/index.html.erb +++ b/app/views/post_versions/index.html.erb @@ -15,7 +15,7 @@ <%= f.input :removed_tags_include_all, label: "Removed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :removed_tags_include_all) } %> <%= f.input :changed_tags, label: "Changed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :changed_tags) } %> <%= f.submit "Search" %> - <%= link_to "Advanced", search_post_versions_path, class: "advanced-search-link" %> + <%= link_to "Advanced", search_post_versions_path(params.except(:controller, :action, :index, :commit, :type).permit!), class: "advanced-search-link" %> <% end %> <%= render "posts/partials/common/inline_blacklist" %> diff --git a/app/views/post_versions/search.html.erb b/app/views/post_versions/search.html.erb index 926ed4ca9..5f862cb68 100644 --- a/app/views/post_versions/search.html.erb +++ b/app/views/post_versions/search.html.erb @@ -3,21 +3,21 @@

Search Changes

<%= search_form_for(post_versions_path) do |f| %> - <%= f.input :updated_at, label: "Date" %> - <%= f.input :updater_name, label: "Updater", input_html: { "data-autocomplete": "user" } %> - <%= f.input :added_tags_include_all, label: "Added tags", input_html: { "data-autocomplete": "tag-query" } %> - <%= f.input :removed_tags_include_all, label: "Removed tags", input_html: { "data-autocomplete": "tag-query" } %> - <%= f.input :changed_tags, label: "Changed tags", input_html: { "data-autocomplete": "tag-query" } %> - <%= f.input :post_id %> - <%= f.input :parent_id %> - <%= f.input :rating %> - <%= f.input :source_ilike, label: "Source", hint: "Use * for wildcard" %> - <%= f.input :tag_matches, hint: "Use * for wildcard" %> - <%= f.input :version %> - <%= f.input :is_new, label: "Include uploads?", collection: [["Yes", nil], ["No", false], ["Only", true]], include_blank: false, hint: "I.e. the 1st versions of posts" %> - <%= f.input :rating_changed, as: :select %> - <%= f.input :parent_changed, as: :select %> - <%= f.input :source_changed, as: :select %> + <%= f.input :updated_at, label: "Date", input_html: { value: params.dig(:search, :updated_at) } %> + <%= f.input :updater_name, label: "Updater", input_html: { value: params.dig(:search, :updater_name), "data-autocomplete": "user" } %> + <%= f.input :added_tags_include_all, label: "Added tags", input_html: { value: params.dig(:search, :added_tags_include_all), "data-autocomplete": "tag-query" } %> + <%= f.input :removed_tags_include_all, label: "Removed tags", input_html: { value: params.dig(:search, :removed_tags_include_all), "data-autocomplete": "tag-query" } %> + <%= f.input :changed_tags, label: "Changed tags", input_html: { value: params.dig(:search, :changed_tags), "data-autocomplete": "tag-query" } %> + <%= f.input :post_id, input_html: { value: params.dig(:search, :post_id) } %> + <%= f.input :parent_id, input_html: { value: params.dig(:search, :parent_id) } %> + <%= f.input :rating, input_html: { value: params.dig(:search, :rating) } %> + <%= f.input :source_ilike, label: "Source", input_html: { value: params.dig(:search, :source_ilike) }, hint: "Use * for wildcard" %> + <%= f.input :tag_matches, input_html: { value: params.dig(:search, :tag_matches) }, hint: "Single tag, use * for wildcard" %> + <%= f.input :version, input_html: { value: params.dig(:search, :version) } %> + <%= f.input :is_new, label: "Include uploads?", collection: [["Yes", nil], ["No", false], ["Only", true]], include_blank: false, selected: params.dig(:search, :is_new), hint: "I.e. the 1st version of a post" %> + <%= f.input :rating_changed, as: :select, include_blank: true, selected: params.dig(:search, :rating_changed) %> + <%= f.input :parent_changed, as: :select, include_blank: true, selected: params.dig(:search, :parent_changed) %> + <%= f.input :source_changed, as: :select, include_blank: true, selected: params.dig(:search, :source_changed) %> <%= f.submit "Search" %> <% end %>