Browse Source

Merge pull request #44 from lexintegritastech/feature-enhance-ui

Feature enhance UI
pull/45/head
Angel Aviel Domaoan 4 years ago committed by GitHub
parent
commit
57f37a7fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/components/document_advanced_search_component.rb
  2. 27
      app/components/document_advanced_search_component/document_advanced_search_component.html.erb
  3. BIN
      app/javascript/images/application/search-icon.png
  4. 1
      app/javascript/src/application.scss
  5. 5
      app/javascript/src/application/nav-bar.scss
  6. 55
      app/views/documents/index.html.erb
  7. 9
      app/views/documents/show.html.erb

4
app/components/document_advanced_search_component.rb

@ -1,7 +1,7 @@
class DocumentAdvancedSearhComponent < BaseComponent
class DocumentAdvancedSearchComponent < BaseComponent
attr_reader :opts
def initialize(current_user: opts: {})
def initialize(current_user:, opts: {})
@opts = opts
end
end

27
app/components/document_advanced_search_component/document_advanced_search_component.html.erb

@ -1,24 +1,25 @@
<%= form_tag(documents_path, method: :get) do %>
<div class="row">
<div class="mb-3">
<%= text_field_tag :q, params[:q], placeholder: 'Full text search', class: "form-control" %>
</div>
<div class="row">
<%= text_field_tag :reference_number, params[:reference_number], placeholder: 'G.R. Number', class: "form-control" %>
<hr class="simple">
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label text-white">G.R. Number</label>
<%= text_field_tag :reference_number, params[:reference_number], class: "form-control" %>
</div>
<div class="row">
<%= text_field_tag :title, params[:short_title], placeholder: 'short_title', class: "form-control" %>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label text-white">Short title</label>
<%= text_field_tag :title, params[:short_title], class: "form-control" %>
</div>
<div class="row">
<div class="col-sm-12 p-2">
<%= text_field_tag :citation_finder, params[:citation_finder], class: "form-control", placeholder: "Citation Finder" %>
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label text-white">Citation Finder</label>
<%= text_field_tag :citation_finder, params[:citation_finder], class: "form-control" %>
</div>
<div class="row">
<button type="submit" class="btn btn-primary">Search</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<div class="d-flex justify-content-end mt-5">
<button type="button" class="btn btn-success me-2 mb-3">Refresh</button>
<button type="submit" class="btn btn-danger mb-3">Search</button>
</div>
<% end %>

BIN
app/javascript/images/application/search-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

1
app/javascript/src/application.scss

@ -4,6 +4,7 @@
@import "./application/pagination";
@import "./application/table";
@import "./application/nav-bar";
@import "./application/document-search";
.tableFixHead {
overflow: auto;

5
app/javascript/src/application/nav-bar.scss

@ -9,3 +9,8 @@ img.nav-bar-app-logo {
.active-red a:hover {
background: transparent;
}
.nav-body {
box-shadow: 0 2px 2px rgb(0 0 0 / 5%), 0 1px 0 rgb(0 0 0 / 5%);
background: #fff;
}

55
app/views/documents/index.html.erb

@ -1,45 +1,11 @@
<div class="container">
<%= form_tag(documents_path, method: :get) do %>
<div class="row justify-content-center">
<div class="col-sm-8 col-md-7 col-lg-8 col-xl-9 p-2 ps-1">
<%= text_field_tag :q, params[:q], placeholder: 'Full text search', class: "form-control" %>
</div>
<div class="col-sm-4 col-md-5 col-lg-4 col-xl-3 mt-2 d-flex justify-content-end align-items-baseline">
<%= submit_tag "Search", class: "btn btn-primary text-white me-3" %>
<button type="button" class="btn btn-info text-white" data-bs-toggle="modal" data-bs-target="#citationFinder"> Citation Finder </button>
<div class="modal fade" id="citationFinder" tabindex="-1" aria-labelledby="citationFinder" aria-hidden="true">
<%= form_tag(documents_path, method: :get) do %>
<div class="modal-dialog modal-lg modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"> Citation Finder </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12 p-2">
<%= text_field_tag :citation_finder, params[:citation_finder], class: "form-control", placeholder: "PHILREP/SCRA" %>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Search</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
<div class="container-fluid row p-0 m-0">
<div class="container col-xs-12 col-sm-12 col-md-3 col-lg-3 col-xl-3" >
<div class="advanced-search-box">
<%= render(DocumentAdvancedSearchComponent.new(current_user: current_user, opts: {})) %>
</div>
</div>
<div class="container col-xs-12 col-sm-12 col-md-9 col-lg-9 col-xl-9">
<% if @search_params.present? %>
<div class="container m-2"> <%= render PaginationComponent.new(data: @jurisprudences) %> </div>
<hr style="margin: 0 18px;"/>
@ -60,4 +26,15 @@
</div>
</div>
</div>
<% else %>
<div class="d-flex justify-content-center flex-column no-search-body">
<div class="text-center ">
<%= image_pack_tag 'application/search-icon.png', class: "search-doc-icon"%>
</div>
<div class="text-center label-no-search" >
No Documents Found
</div>
</div>
<% end %>
</div>
</div>

9
app/views/documents/show.html.erb

@ -1,3 +1,10 @@
<div class="container-fluid row p-0 m-0">
<div class="container col-md-3">
<div class="advanced-search-box">
<%= render(DocumentAdvancedSearchComponent.new(current_user: current_user, opts: {})) %>
</div>
</div>
<div class="container col-md-9">
<div class="card mt-1 g-3">
<div class="container p-2 card-header">
<div class="row">
@ -88,3 +95,5 @@
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save