From 1c8bd06a3fabdd8e7d62671c7a99b723669f165a Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Tue, 8 Mar 2022 01:48:39 +0000 Subject: [PATCH] Fix `document#date` --- ...nnotated_documents_search_results.html.erb | 4 +- .../_case_lists_search_results.html.erb | 4 +- .../shared/_doctrines_pagination.html.erb | 59 +++++++++++++++++++ .../shared/_document_doctrines_index.html.erb | 4 ++ 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 app/views/shared/_doctrines_pagination.html.erb create mode 100644 app/views/shared/_document_doctrines_index.html.erb diff --git a/app/views/shared/_annotated_documents_search_results.html.erb b/app/views/shared/_annotated_documents_search_results.html.erb index b82d440..9f5cce4 100644 --- a/app/views/shared/_annotated_documents_search_results.html.erb +++ b/app/views/shared/_annotated_documents_search_results.html.erb @@ -81,11 +81,11 @@ <%= document.clean_reference_number %> <%= document.short_title || document.title %> - <%= document.doc_date.present? ? document.doc_date : document.year %> + <%= document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year %> " data-document-title="<%= document.short_title || document.title %>" data-action="click->annotations#addAnnotatedDocument" > Add diff --git a/app/views/shared/_case_lists_search_results.html.erb b/app/views/shared/_case_lists_search_results.html.erb index 7d580a9..9534fb1 100644 --- a/app/views/shared/_case_lists_search_results.html.erb +++ b/app/views/shared/_case_lists_search_results.html.erb @@ -92,9 +92,9 @@ <%= document.clean_reference_number %> <%= document.short_title || document.title %> - <%= document.doc_date.present? ? document.doc_date : document.year %> + <%= document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year %> - <% date_or_year = document.doc_date || document.year %> + <% date_or_year = document.doc_date.strftime("%B %d, %Y") || document.year %> <% title = document.short_title || document.title %> +
+
"> + + <%= page_entries_info doctrines, entry_name: 'records' if doctrines.present? %> + +
+
"> + +
+
+ diff --git a/app/views/shared/_document_doctrines_index.html.erb b/app/views/shared/_document_doctrines_index.html.erb new file mode 100644 index 0000000..dbdde0e --- /dev/null +++ b/app/views/shared/_document_doctrines_index.html.erb @@ -0,0 +1,4 @@ +
+ <%= render(partial: "/shared/doctrines_pagination", locals: { doctrines: doctrines, opts: opts }) %> + <%= render(DocumentDoctrineIndexComponent.with_collection(doctrines, current_user: current_user, opts: { document_id: opts[:document_id] })) %> +