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 d03dee2..bf9132e 100644 --- a/app/components/doctrine_index_component/doctrine_index_component.html.erb +++ b/app/components/doctrine_index_component/doctrine_index_component.html.erb @@ -9,7 +9,7 @@

<%= headnote %>

- <% annotations.each do |annotation| %> + <% annotations.order(created_at: :desc).each do |annotation| %>
<%= [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 ab87917..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 @@ -89,7 +89,7 @@

Annotations
<%= 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/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