From 0e86e0ffe30b55364088f682dc0484c85040b894 Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Fri, 18 Feb 2022 02:17:11 +0000 Subject: [PATCH] Add component for `document#search` --- .../document_advanced_search_component.rb | 7 ++++++ ...ocument_advanced_search_component.html.erb | 24 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 app/components/document_advanced_search_component.rb create mode 100644 app/components/document_advanced_search_component/document_advanced_search_component.html.erb diff --git a/app/components/document_advanced_search_component.rb b/app/components/document_advanced_search_component.rb new file mode 100644 index 0000000..838e3a5 --- /dev/null +++ b/app/components/document_advanced_search_component.rb @@ -0,0 +1,7 @@ +class DocumentAdvancedSearhComponent < BaseComponent + attr_reader :opts + + def initialize(current_user: opts: {}) + @opts = opts + end +end \ No newline at end of file diff --git a/app/components/document_advanced_search_component/document_advanced_search_component.html.erb b/app/components/document_advanced_search_component/document_advanced_search_component.html.erb new file mode 100644 index 0000000..bef69f3 --- /dev/null +++ b/app/components/document_advanced_search_component/document_advanced_search_component.html.erb @@ -0,0 +1,24 @@ +<%= form_tag(documents_path, method: :get) do %> +
+ <%= text_field_tag :q, params[:q], placeholder: 'Full text search', class: "form-control" %> +
+ +
+ <%= text_field_tag :reference_number, params[:reference_number], placeholder: 'G.R. Number', class: "form-control" %> +
+ +
+ <%= text_field_tag :title, params[:short_title], placeholder: 'short_title', class: "form-control" %> +
+ +
+
+ <%= text_field_tag :citation_finder, params[:citation_finder], class: "form-control", placeholder: "Citation Finder" %> +
+
+ +
+ + +
+<% end %> \ No newline at end of file