Browse Source

Merge pull request #23 from lexintegritastech/feature-enhancement-ui

Feature enhancement UI
pull/24/head
Angel Aviel Domaoan 4 years ago committed by GitHub
parent
commit
2026cced95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/components/pagination_component/pagination_component.html.erb
  2. 7
      app/javascript/src/application.scss
  3. 9
      app/javascript/src/application/pagination.scss
  4. 8
      app/javascript/src/application/table.scss
  5. 31
      app/views/documents/index.html.erb
  6. 2
      app/views/kaminari/_first_page.html.erb
  7. 2
      app/views/kaminari/_last_page.html.erb
  8. 2
      app/views/kaminari/_next_page.html.erb
  9. 2
      app/views/kaminari/_paginator.html.erb
  10. 2
      app/views/kaminari/_prev_page.html.erb
  11. 2
      app/views/layouts/application.html.erb

4
app/components/pagination_component/pagination_component.html.erb

@ -1,6 +1,6 @@
<div class="col col-md-12">
<header class="header bg-white b-b clearfix">
<div class="row m-t-sm">
<div class="row m-t-sm align-items-end pagination-body">
<div class="col-md-6">
<% if opts[:is_subject_breadcrums].present? && subjects.present? %>
<ol class="breadcrumb">
@ -17,7 +17,7 @@
<% end %>
</ol>
<% else %>
<h4 style="color: darkred">Search Results</h4>
<h4 style="color: darkred" class="m-0">Search Results</h4>
<small style="color: darkred">
<%= page_entries_info data, entry_name: 'records' if data.present? %>
</small>

7
app/javascript/src/application.scss

@ -1,6 +1,8 @@
@import "~bootstrap/scss/bootstrap";
@import "./application/sidenav";
@import "./application/sessions";
@import "./application/pagination";
@import "./application/table";
.tableFixHead {
overflow: auto;
@ -33,3 +35,8 @@
.accordion-button::after {
margin-right: 10px;
}
.main-content-body {
min-height: 100vh !important;
overflow: auto;
}

9
app/javascript/src/application/pagination.scss

@ -0,0 +1,9 @@
.pagination-body .pagination .page-item a{
color: darkred;
}
.pagination-body .pagination span.page-item.page.current.page-link {
border: darkred;
background: darkred !important;
color: #fff !important;
}

8
app/javascript/src/application/table.scss

@ -0,0 +1,8 @@
.table > :not(:first-child) {
border-top: none !important;
}
thead tr {
border-bottom: 2px solid #782525
}

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

@ -1,15 +1,14 @@
<div class="card mt-2 g-3">
<div class="card-header mt-1 col-sm-12">
<div class="container">
<%= form_tag(documents_path, method: :get) do %>
<div class="row">
<div class="col-sm-8 p-2">
<%= text_field_tag :q, params[:q], class: "form-control" %>
<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 p-2">
<%= submit_tag "Search", class: "btn btn-primary text-dark" %>
<button type="button" class="btn btn-info" data-bs-toggle="modal" data-bs-target="#citationFinder"> Citation Finder </button>
<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">
@ -25,6 +24,7 @@
<%= 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>
@ -36,13 +36,17 @@
</div>
</div>
</div>
<% end %>
</div>
<div class="card-body col-sm-12 tableFixHead p-0 mt-1">
</div>
<% if @search_params.present? %>
<div class="container m-2"> <%= render PaginationComponent.new(data: @jurisprudences) %> </div>
<table class="table table-striped table-hover mb-0">
<hr style="margin: 0 18px;"/>
<div class="card-header mt-1 col-sm-12 bg-transparent">
<div class="card g-3 " style="border:none;">
<div class="card-body col-sm-12 tableFixHead p-0">
<table class="table table-hover mb-0">
<thead>
<th class="bg-light"> Reference No. </th>
<th class="bg-light"> Title </th>
@ -53,6 +57,7 @@
<%= render(DocumentIndexTableComponent.with_collection(@jurisprudences, current_user: current_user, opts: {})) %>
</tbody>
</table>
<% end %>
</div>
</div>
</div>
<% end %>

2
app/views/kaminari/_first_page.html.erb

@ -7,5 +7,5 @@
remote: data-remote
-%>
<span class="page-item first">
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: "page-link" %>
<%= link_to_unless current_page.first?, '<i class="fas fa-angle-double-left"></i>'.html_safe, url, remote: remote, class: "page-link" %>
</span>

2
app/views/kaminari/_last_page.html.erb

@ -7,5 +7,5 @@
remote: data-remote
-%>
<span class="page-item last">
<%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote, class: "page-link" %>
<%= link_to_unless current_page.last?, '<i class="fas fa-angle-double-right"></i>'.html_safe, url, remote: remote, class: "page-link" %>
</span>

2
app/views/kaminari/_next_page.html.erb

@ -7,5 +7,5 @@
remote: data-remote
-%>
<span class="page-item next">
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote, class: "page-link" %>
<%= link_to_unless current_page.last?, '<i class="fas fa-angle-right"></i>'.html_safe, url, rel: 'next', remote: remote, class: "page-link" %>
</span>

2
app/views/kaminari/_paginator.html.erb

@ -7,7 +7,7 @@
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination" role="navigation" aria-label="pager">
<nav class="pagination pagination-sm" role="navigation" aria-label="pager">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>

2
app/views/kaminari/_prev_page.html.erb

@ -7,5 +7,5 @@
remote: data-remote
-%>
<span class="page-item prev">
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote, class: "page-link" %>
<%= link_to_unless current_page.first?, '<i class="fas fa-angle-left"></i>'.html_safe, url, rel: 'prev', remote: remote, class: "page-link" %>
</span>

2
app/views/layouts/application.html.erb

@ -20,7 +20,7 @@
</div>
<% end %>
<div class="<%= current_user.present? ? 'col py-3' : 'col-sm-3 login-body-box' %>">
<div class="<%= current_user.present? ? 'col py-3 main-content-body' : 'col-sm-3 login-body-box' %>">
<div class="content-body">
<%= yield %>
</div>

Loading…
Cancel
Save