Browse Source

Merge pull request #96 from lexintegritastech/improve-main-ui

Minor Enhancements for Presentation 03/02/2022
pull/97/head
Alexander D. Bondoc 4 years ago committed by GitHub
parent
commit
9b4ac90af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
  2. 1
      app/components/doctrine_index_component.rb
  3. 6
      app/components/doctrine_index_component/doctrine_index_component.html.erb
  4. 1
      app/components/document_doctrine_index_component.rb
  5. 5
      app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
  6. 4
      app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
  7. 6
      app/components/sidenav_component/sidenav_component.html.erb
  8. 3
      app/models/annotation.rb
  9. 2
      app/views/shared/_annotated_documents_search_results.html.erb
  10. 2
      app/views/shared/_case_lists_no_results.html.erb
  11. 2
      app/views/shared/_case_lists_search_results.html.erb

2
app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb

@ -30,7 +30,7 @@
<div id="annotatedDocumentsSearchResults"> <div id="annotatedDocumentsSearchResults">
<div class="row"> <div class="row">
<div class="col-sm-10 p-2"> <div class="col-sm-10 p-2">
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number", data: { target: "annotations.q" } %> <%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "annotations.q" } %>
</div> </div>
<div class="col-sm-1 p-2"> <div class="col-sm-1 p-2">
<button type="button" class="btn btn-success" data-action="click->annotations#searchDocuments"> Search </button> <button type="button" class="btn btn-success" data-action="click->annotations#searchDocuments"> Search </button>

1
app/components/doctrine_index_component.rb

@ -12,6 +12,7 @@ class DoctrineIndexComponent < BaseComponent
delegate :content, to: :doctrine delegate :content, to: :doctrine
delegate :annotations, to: :doctrine delegate :annotations, to: :doctrine
delegate :subjects, to: :doctrine delegate :subjects, to: :doctrine
delegate :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url def annotation_form_url

6
app/components/doctrine_index_component/doctrine_index_component.html.erb

@ -5,9 +5,11 @@
<div class="container-fluid p-0"> <div class="container-fluid p-0">
<% document_title = jurisprudence.short_title || jurisprudence.title %> <% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %> <% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(jurisprudence, is_index_table: false, subject_ids: params[:subject_ids]) %>"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5>
<% annotations.each do |annotation| %> <p class="fw-bold fst-normal"> <%= headnote %> </p>
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(jurisprudence, is_index_table: false, subject_ids: params[:subject_ids]) %>"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5>
<% annotations.order(created_at: :desc).each do |annotation| %>
<p class="mb-2 ms-3 clickable-link" href="<%= show_url %>"> <p class="mb-2 ms-3 clickable-link" href="<%= show_url %>">
<% annotated_documents_title = [] %> <% annotated_documents_title = [] %>
<% annotation.documents.each do |annotated_document| %> <% annotation.documents.each do |annotated_document| %>

1
app/components/document_doctrine_index_component.rb

@ -12,6 +12,7 @@ class DocumentDoctrineIndexComponent < BaseComponent
delegate :content, to: :doctrine delegate :content, to: :doctrine
delegate :annotations, to: :doctrine delegate :annotations, to: :doctrine
delegate :subjects, to: :doctrine delegate :subjects, to: :doctrine
delegate :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url def annotation_form_url

5
app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb

@ -17,13 +17,16 @@
<p class="mb-0"> <%= raw content.html_safe %> </p> <p class="mb-0"> <%= raw content.html_safe %> </p>
<div class="container-fluid p-0"> <div class="container-fluid p-0">
<p class="fw-bold fst-normal"> <%= headnote %> </p>
<% if opts[:is_doctrines_index].present? %> <% if opts[:is_doctrines_index].present? %>
<% document_title = jurisprudence.short_title || jurisprudence.title %> <% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %> <% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5> <h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5>
<% end %> <% end %>
<% annotations.each do |annotation| %> <% annotations.order(created_at: :desc).each do |annotation| %>
<p class="mb-2 ms-3"> <p class="mb-2 ms-3">
<% annotated_documents_title = [] %> <% annotated_documents_title = [] %>
<% annotation.documents.each do |annotated_document| %> <% annotation.documents.each do |annotated_document| %>

4
app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb

@ -58,7 +58,7 @@
<div class="collapse mb-3 mt-2" id="caseListsCollapse"> <div class="collapse mb-3 mt-2" id="caseListsCollapse">
<div class="row" data-controller="document" data-document-id="<%= document_id %>" data-doctrine-id="<%= id %>"> <div class="row" data-controller="document" data-document-id="<%= document_id %>" data-doctrine-id="<%= id %>">
<div class="col-sm-11 p-2"> <div class="col-sm-11 p-2">
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number", data: { target: "document.input" } %> <%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "document.input" } %>
</div> </div>
<div class="col-sm-1 p-2"> <div class="col-sm-1 p-2">
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %> <%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %>
@ -89,7 +89,7 @@
<div class="annot-header"> <h5> Annotations </h5> </div> <div class="annot-header"> <h5> Annotations </h5> </div>
<div class="" id="annotationsIndexView"> <div class="" id="annotationsIndexView">
<%= render(partial: "/shared/annotations_pagination", locals: { annotations: annotations, opts: { current_page: 1 } }) %> <%= render(partial: "/shared/annotations_pagination", locals: { annotations: annotations, opts: { current_page: 1 } }) %>
<% annotations.each do |annotation| %> <% annotations.order(created_at: :desc).each do |annotation| %>
<% document_title = annotation.document.short_title || annotation.document.title %> <% document_title = annotation.document.short_title || annotation.document.title %>
<% date_or_year = annotation.document.docdate.present? ? annotation.document.docdate.strftime("%B %d, %Y") : annotation.document.year %> <% date_or_year = annotation.document.docdate.present? ? annotation.document.docdate.strftime("%B %d, %Y") : annotation.document.year %>
<% annotated_documents_title = [] %> <% annotated_documents_title = [] %>

6
app/components/sidenav_component/sidenav_component.html.erb

@ -88,13 +88,11 @@
<%= link_to '<i class="fas fa-search me-2"></i>Search'.html_safe, documents_path, class: "nav-link" %> <%= link_to '<i class="fas fa-search me-2"></i>Search'.html_safe, documents_path, class: "nav-link" %>
</li> </li>
<li class="nav-item p-2"> <li class="nav-item p-2">
<a class="nav-link" data-bs-toggle="offcanvas" data-bs-target="#subjectsOffCanvas" <a class="nav-link" style="cursor: pointer" data-bs-toggle="offcanvas" data-bs-target="#subjectsOffCanvas">
data-controller="subjects" data-accordion-target="#subjectsOffCanvasAccordionBody"
data-action="click->subjects#loadSubjectsOffcanvasAccordion">
<i class="fas fa-indent me-2"></i> Subjects <i class="fas fa-indent me-2"></i> Subjects
</a> </a>
</li> </li>
<li class="nav-item p-2"> <li class="nav-item p-2" style="cursor: pointer">
<a class="nav-link" data-bs-toggle="offcanvas" data-bs-target="#doctrinesOffCanvas"> <a class="nav-link" data-bs-toggle="offcanvas" data-bs-target="#doctrinesOffCanvas">
<i class="fas fa-book me-2"></i> Doctrines <i class="fas fa-book me-2"></i> Doctrines
</a> </a>

3
app/models/annotation.rb

@ -33,6 +33,9 @@ class Annotation < ApplicationRecord
integer :document_id integer :document_id
integer :doctrine_id integer :doctrine_id
date :created_at
date :updated_at
text :phil_rep text :phil_rep
string :phil_rep string :phil_rep

2
app/views/shared/_annotated_documents_search_results.html.erb

@ -1,6 +1,6 @@
<div class="row" data-controller="annotations"> <div class="row" data-controller="annotations">
<div class="col-sm-10 p-2"> <div class="col-sm-10 p-2">
<%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number", data: { target: "annotations.input" } %> <%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "annotations.input" } %>
</div> </div>
<div class="col-sm-1 p-2"> <div class="col-sm-1 p-2">
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->annotations#searchDocuments" } %> <%= button_tag "Search", class: "btn btn-success", data: { action: "click->annotations#searchDocuments" } %>

2
app/views/shared/_case_lists_no_results.html.erb

@ -1,6 +1,6 @@
<div class="row" data-controller="document" data-doctrine-id="<%= doctrine_id %>"> <div class="row" data-controller="document" data-doctrine-id="<%= doctrine_id %>">
<div class="col-sm-11 p-2"> <div class="col-sm-11 p-2">
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number", data: { target: "document.input" } %> <%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "document.input" } %>
</div> </div>
<div class="col-sm-1 p-2"> <div class="col-sm-1 p-2">
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %> <%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %>

2
app/views/shared/_case_lists_search_results.html.erb

@ -1,6 +1,6 @@
<div class="row" data-controller="document" data-doctrine-id="<%= opts[:doctrine_id] %>"> <div class="row" data-controller="document" data-doctrine-id="<%= opts[:doctrine_id] %>">
<div class="col-sm-11 p-2"> <div class="col-sm-11 p-2">
<%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number", <%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number, Title or Short Title",
data: { target: "document.input" } %> data: { target: "document.input" } %>
</div> </div>
<div class="col-sm-1 p-2"> <div class="col-sm-1 p-2">

Loading…
Cancel
Save