diff --git a/app/components/doctrine_index_component.rb b/app/components/doctrine_index_component.rb
index 50218c0..b466d8f 100644
--- a/app/components/doctrine_index_component.rb
+++ b/app/components/doctrine_index_component.rb
@@ -12,6 +12,7 @@ class DoctrineIndexComponent < BaseComponent
delegate :content, to: :doctrine
delegate :annotations, to: :doctrine
delegate :subjects, to: :doctrine
+ delegate :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url
diff --git a/app/components/doctrine_index_component/doctrine_index_component.html.erb b/app/components/doctrine_index_component/doctrine_index_component.html.erb
index 8e84a94..bf9132e 100644
--- a/app/components/doctrine_index_component/doctrine_index_component.html.erb
+++ b/app/components/doctrine_index_component/doctrine_index_component.html.erb
@@ -5,9 +5,11 @@
<% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>
-
<%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %>
- <% annotations.each do |annotation| %>
+
<%= headnote %>
+
+
<%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %>
+ <% annotations.order(created_at: :desc).each do |annotation| %>
<% annotated_documents_title = [] %>
<% annotation.documents.each do |annotated_document| %>
diff --git a/app/components/document_doctrine_index_component.rb b/app/components/document_doctrine_index_component.rb
index 663b5bc..879a29a 100644
--- a/app/components/document_doctrine_index_component.rb
+++ b/app/components/document_doctrine_index_component.rb
@@ -12,6 +12,7 @@ class DocumentDoctrineIndexComponent < BaseComponent
delegate :content, to: :doctrine
delegate :annotations, to: :doctrine
delegate :subjects, to: :doctrine
+ delegate :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url
diff --git a/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
index 3b9605f..f51bcdf 100644
--- a/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
+++ b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
@@ -17,13 +17,16 @@
<%= raw content.html_safe %>
+
+
<%= headnote %>
+
<% if opts[:is_doctrines_index].present? %>
<% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>
<%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %>
<% end %>
- <% annotations.each do |annotation| %>
+ <% annotations.order(created_at: :desc).each do |annotation| %>
<% annotated_documents_title = [] %>
<% annotation.documents.each do |annotated_document| %>
diff --git a/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
index c1bcb73..9ed4042 100644
--- a/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
+++ b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
@@ -58,7 +58,7 @@
- <%= 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" } %>
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %>
@@ -89,7 +89,7 @@
<%= 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 %>
<% date_or_year = annotation.document.docdate.present? ? annotation.document.docdate.strftime("%B %d, %Y") : annotation.document.year %>
<% annotated_documents_title = [] %>
diff --git a/app/components/sidenav_component/sidenav_component.html.erb b/app/components/sidenav_component/sidenav_component.html.erb
index 03d4585..7f51bda 100644
--- a/app/components/sidenav_component/sidenav_component.html.erb
+++ b/app/components/sidenav_component/sidenav_component.html.erb
@@ -88,13 +88,11 @@
<%= link_to '
Search'.html_safe, documents_path, class: "nav-link" %>
-
+
Subjects
-
+
Doctrines
diff --git a/app/models/annotation.rb b/app/models/annotation.rb
index b138e9e..c8071e8 100644
--- a/app/models/annotation.rb
+++ b/app/models/annotation.rb
@@ -33,6 +33,9 @@ class Annotation < ApplicationRecord
integer :document_id
integer :doctrine_id
+ date :created_at
+ date :updated_at
+
text :phil_rep
string :phil_rep
diff --git a/app/views/shared/_annotated_documents_search_results.html.erb b/app/views/shared/_annotated_documents_search_results.html.erb
index 7aaa40c..b82d440 100644
--- a/app/views/shared/_annotated_documents_search_results.html.erb
+++ b/app/views/shared/_annotated_documents_search_results.html.erb
@@ -1,6 +1,6 @@
- <%= 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" } %>
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->annotations#searchDocuments" } %>
diff --git a/app/views/shared/_case_lists_no_results.html.erb b/app/views/shared/_case_lists_no_results.html.erb
index a96e322..79a2679 100644
--- a/app/views/shared/_case_lists_no_results.html.erb
+++ b/app/views/shared/_case_lists_no_results.html.erb
@@ -1,6 +1,6 @@
- <%= 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" } %>
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %>
diff --git a/app/views/shared/_case_lists_search_results.html.erb b/app/views/shared/_case_lists_search_results.html.erb
index fd36eff..0aafd1e 100644
--- a/app/views/shared/_case_lists_search_results.html.erb
+++ b/app/views/shared/_case_lists_search_results.html.erb
@@ -1,6 +1,6 @@
- <%= 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" } %>