From d0b73bd3c9eb81efc9e2e45308648798abe5838a Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Fri, 18 Feb 2022 02:17:11 +0000 Subject: [PATCH 1/2] 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 From 69301237bcbe45b02a9f4e30118ed98f335e8e0e Mon Sep 17 00:00:00 2001 From: janpaulo Date: Fri, 18 Feb 2022 11:01:07 +0800 Subject: [PATCH 2/2] Final navbar setup --- .../sidenav_component.html.erb | 42 +++++++++---------- app/javascript/src/application/nav-bar.scss | 8 ++++ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/app/components/sidenav_component/sidenav_component.html.erb b/app/components/sidenav_component/sidenav_component.html.erb index 5113372..8cc7953 100644 --- a/app/components/sidenav_component/sidenav_component.html.erb +++ b/app/components/sidenav_component/sidenav_component.html.erb @@ -73,35 +73,35 @@ <% elsif opts[:is_nav_bar].present? %> -