[Search] Add the submit button automatically

This commit is contained in:
Earlopain 2023-05-07 13:06:00 +02:00
parent 2901c7c10c
commit 8e7914aad8
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
38 changed files with 3 additions and 39 deletions

View File

@ -10,7 +10,9 @@ module FormSearchHelper
search_params: params[:search],
defaults: { required: false },
html: { class: "inline-form" },
}, &)
}) do |f|
capture { yield(f) } + f.submit("Search")
end
render "application/form_search", hideable: hideable, show_on_load: show_on_load, form: form
end

View File

@ -1,7 +1,6 @@
<%= form_search(path: admin_exceptions_path) do |f| %>
<%= f.input :version, label: "Commit" %>
<%= f.input :without_timeouts, as: :boolean %>
<%= f.submit "Search" %>
<% end %>
<table class="striped">

View File

@ -3,5 +3,4 @@
<%= f.input :user_name, label: "User Name", autocomplete: "user" %>
<%= f.input :body_matches, label: "Body" %>
<%= f.input :without_system_user, as: :boolean, label: "Hide automated?" %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,7 +6,6 @@
<%= f.input :normalized_url_matches, label: "Normalized URL" %>
<%= f.input :is_active, label: "Active?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :order, collection: [["ID", "id"], ["Created", "created_at"], ["Updated", "updated_at"]] %>
<%= f.submit "Search" %>
<% end %>
<table class="striped">

View File

@ -2,5 +2,4 @@
<%= f.input :updater_name, label: "User", autocomplete: "user" %>
<%= f.input :updater_id, label: "User ID", hide_unless_value: true %>
<%= f.input :name, autocomplete: "artist" %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,5 +6,4 @@
<%= f.input :has_tag, label: "Has tag?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :is_linked, label: "Linked Only", as: :boolean %>
<%= f.input :order, collection: [["Recently created", "created_at"], ["Last updated", "updated_at"], ["Name", "name"], ["Post count", "post_count"]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -4,5 +4,4 @@
<%= f.input :reason_matches, label: "Reason", hint: "Use * for wildcard" %>
<%= f.input :expired, label: "Expired?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :order, include_blank: false, collection: [%w[Created id_desc], %w[Expiration expires_at_desc]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,5 +6,4 @@
<%= f.input :ip_addr, label: "Ip Address" %>
<% end %>
<%= f.input :order, include_blank: false, collection: [%w(Created id_desc), %w(Updated updated_at_desc)] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -5,5 +5,4 @@
<%= f.input :script_matches, label: "Script" %>
<%= f.input :status, label: "Status", collection: %w[pending approved rejected], include_blank: true %>
<%= f.input :order, collection: [%w[Status status_desc], %w[Last\ updated updated_at_desc], %w[Newest id_desc], %w[Oldest id_asc]], include_blank: false %>
<%= f.submit "Search" %>
<% end %>

View File

@ -13,5 +13,4 @@
<%= f.input :is_sticky, label: "Sticky?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :do_not_bump_post, label: "Bumping?", collection: [["Yes", false], ["No", true]], include_blank: true %>
<%= f.input :order, include_blank: false, collection: [%w[Created id_desc], %w[Updated updated_at_desc], %w[Score score_desc], %w[Post post_id_desc]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -4,5 +4,4 @@
<%= f.input :message_matches, label: "Message", hint: "Use * for wildcard" %>
<%= f.input :to_name, label: "To" %>
<%= f.input :from_name, label: "From", autocomplete: "user" %>
<%= f.submit "Search" %>
<% end %>

View File

@ -2,5 +2,4 @@
<%= f.input :domain, label: "Domain", hint: "Use * for wildcard" %>
<%= f.input :reason, label: "Ban Reason" %>
<%= f.input :order, collection: [["Recently created", "id"], ["Last updated", "updated_at"], ["Domain", "domain"], ["Reason", "reason"]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -4,5 +4,4 @@
<%= f.input :creator_name, label: "Author", autocomplete: "user" %>
<%= f.input :creator_id, label: "Author ID", hide_unless_value: true %>
<%= f.input :topic_category_id, label: "Category", collection: ForumCategory.visible.reverse_mapping, include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,7 +6,6 @@
<%= f.input :ip_addr, label: "IP Address" %>
<%= f.input :banner_name, label: "Banner" %>
<%= f.input :reason %>
<%= f.submit "Search" %>
<% end %>
<table class="striped">

View File

@ -1,5 +1,4 @@
<%= form_search(path: mod_actions_path) do |f| %>
<%= f.input :creator_name, label: "Creator", autocomplete: "user" %>
<%= f.input :action, label: "Action", collection: ModAction::KnownActions.map {|k| [k.to_s.capitalize.tr("_"," "), k.to_s]}, include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -9,5 +9,4 @@
<%= f.input :add_ip_mask, label: "Add IP Mask?", as: :boolean, hint: "/24 for IPv4, /64 for IPv6" %>
<% end %>
<%= f.input :with_history, label: "With History?", as: :boolean %>
<%= f.submit "Search" %>
<% end %>

View File

@ -10,7 +10,6 @@
<%= f.input :reason, label: "Reason", collection: %w[borderline_quality borderline_relevancy other].map { |x| [x.humanize, x] }, include_blank: true %>
<%= f.input :has_message, label: "Has Message?", collection: %w[Yes No], include_blank: true %>
<%= f.input :order, collection: [["ID", "id_desc"], ["Post ID", "post_id_desc"]] %>
<%= f.submit "Search" %>
<% end %>
<table class="striped autofit">

View File

@ -4,5 +4,4 @@
<%= f.input :updater_id, label: "User ID", hide_unless_value: true %>
<%= f.input :post_id, label: "Post #"%>
<%= f.input :note_id, label: "Note #"%>
<%= f.submit "Search" %>
<% end %>

View File

@ -4,5 +4,4 @@
<%= f.input :post_id, label: "Post #"%>
<%= f.input :post_tags_match, label: "Tags", autocomplete: "tag-query" %>
<%= f.input :is_active, label: "Status", collection: [["Active", "true"], ["Deleted", "false"]], :include_blank => true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -5,5 +5,4 @@
<%= f.input :is_active, label: "Status", collection: [["Active", "true"], ["Inactive", "false"]], :include_blank => true %>
<%= f.input :category, label: "Category", collection: [["Series", "series"], ["Collection", "collection"]], :include_blank => true %>
<%= f.input :order, label: "Order", collection: [["Last updated", "updated_at"], ["Name", "name"], ["Recently created", "created_at"], ["Post count", "post_count"]], :include_blank => true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,7 +6,6 @@
<%= form_search(path: post_approvals_path) do |f| %>
<%= f.input :user_name, label: "Approver", autocomplete: "user" %>
<%= f.input :post_tags_match, label: "Tags", autocomplete: "tag-query" %>
<%= f.submit "Search" %>
<% end %>
<table class="striped">

View File

@ -2,5 +2,4 @@
<%= f.input :post_id, label: "Post #" %>
<%= f.input :creator_name, label: "Creator", autocomplete: "user" %>
<%= f.input :action, label: "Action", collection: PostEvent.actions.keys.map {|k| [k.to_s.capitalize.tr("_"," "), k.to_s]}, include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -9,5 +9,4 @@
<% end %>
<%= f.input :is_resolved, label: "Resolved?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<%= f.input :category, label: "Category", collection: ["normal", "unapproved", "deleted", "banned", "duplicate"], include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -8,5 +8,4 @@
<%= f.input :uploader_name_on_approve, label: "Original Uploader", autocomplete: "user" %>
<%= f.input :uploader_id_on_approve, label: "Original Uploader ID", hide_unless_value: true %>
<%= f.input :status, collection: ["pending", "rejected", "approved", "promoted"], include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,5 +6,4 @@
<%= f.input :is_public, label: "Public?", collection: [["Yes", true], ["No", false]], include_blank: true %>
<% end %>
<%= f.input :order, collection: [%w[Name name], ['Short Name', 'shortname'], ['Post Count', 'post_count'], %w[Created created_at], %w[Updated updated_at]], include_blank: false %>
<%= f.submit "Search" %>
<% end %>

View File

@ -17,5 +17,4 @@
<%= f.input :locked_tags_removed, label: "Removed Locked Tags" %>
<%= f.input :source_changed, label: "Source Changed", collection: [%w[Yes true], %w[No false]], include_blank: true %>
<%= f.input :exclude_uploads, label: "Exclude Initial Uploads?", as: :boolean %>
<%= f.submit "Search" %>
<% end %>

View File

@ -10,5 +10,4 @@
<%= f.input :consequent_tag_category, label: "To Category", collection: TagCategory.canonical_mapping.to_a, include_blank: true %>
<%= f.input :status, label: "Status", collection: %w[Approved Active Pending Deleted Retired Processing Queued], include_blank: true %>
<%= f.input :order, label: "Order", collection: [%w[Status status], %w[Recently\ created created_at], %w[Recently\ updated updated_at], %w[Name name], %w[Tag\ count tag_count]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -2,5 +2,4 @@
<%= f.input :tag, label: "Tag" %>
<%= f.input :user_name, label: "Username", autocomplete: "user" %>
<%= f.input :user_id, label: "User ID" %>
<%= f.submit "Search" %>
<% end %>

View File

@ -5,5 +5,4 @@
<%= f.input :has_wiki, label: "Has wiki?", collection: %w[yes no], include_blank: true %>
<%= f.input :has_artist, label: "Has artist?", collection: %w[yes no], include_blank: true %>
<%= f.input :hide_empty, label: "Hide empty?", as: :boolean, default: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -27,5 +27,4 @@
["Status", "status"],
["Post count", "post_count"]] %>
<% end %>
<%= f.submit "Submit" %>
<% end %>

View File

@ -23,5 +23,4 @@
["Under investigation", "partial"],
["Pending", "pending"],
], include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -3,5 +3,4 @@
<%= f.input :note, label: "Note", as: :string %>
<%= f.input :reason, label: "Ban Reason" %>
<%= f.input :order, collection: [["Note", "note"], ["Recently created", "created_at"], ["Last updated", "updated_at"], ["Pattern", "pattern"]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -3,6 +3,4 @@
<%= f.input :post_tags_match, label: "Post Tags" %>
<%= f.input :source_matches, label: "Source" %>
<%= f.input :status, collection: [%w[Completed completed], %w[Processing processing], %w[Pending pending], %w[Duplicate *duplicate*], %w[Error error*]], include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -4,5 +4,4 @@
<%= f.input :creator_name, label: "Creator", autocomplete: "user" %>
<%= f.input :body_matches, label: "Message" %>
<%= f.input :category, collection: %w[positive negative neutral], include_blank: true %>
<%= f.submit "Search" %>
<% end %>

View File

@ -2,5 +2,4 @@
<%= f.input :current_name, label: "Current Name", autocomplete: "user" %>
<%= f.input :original_name, label: "Original Name", hint: "Use * for wildcard" %>
<%= f.input :desired_name, label: "Desired Name", hint: "Use * for wildcard" %>
<%= f.submit "Search" %>
<% end %>

View File

@ -13,7 +13,6 @@
<%= f.input :duplicates_only, label: "Duplicates Only", as: :boolean %>
<%= f.input :order, collection: [["Created", "id"], ["IP Address", "ip_addr"]] %>
<% end %>
<%= f.submit "Search" %>
<% end %>
<table class="striped" id='votes'>

View File

@ -13,5 +13,4 @@
<%= f.input :can_approve_posts, label: "Approver?", collection: [%w[Yes true], %w[No false]], include_blank: true %>
<%= f.input :order, collection: [["Join date", "date"], ["Name", "name"], ["Upload count", "post_upload_count"], ["Note count", "note_count"], ["Post update count", "post_update_count"]] %>
<%= f.submit "Search" %>
<% end %>

View File

@ -6,5 +6,4 @@
<%= f.input :other_names_present, collection: %w[Yes No], include_blank: true %>
<%= f.input :hide_deleted, collection: %w[Yes No] %>
<%= f.input :order, collection: [%w[Name title], %w[Date time], %w[Posts post_count]] %>
<%= f.submit "Search" %>
<% end %>