diff --git a/app/components/annotation_marks_modal_form_component.rb b/app/components/annotation_marks_modal_form_component.rb index ce2e379..f5d7efe 100644 --- a/app/components/annotation_marks_modal_form_component.rb +++ b/app/components/annotation_marks_modal_form_component.rb @@ -14,7 +14,8 @@ class AnnotationMarksModalFormComponent < BaseComponent end def document_title - [document.title, document.reference_number, document_date_or_year].reject(&:blank?).join(", ") + title = document.short_title || document.title + [title, document.reference_number, document_date_or_year].reject(&:blank?).join(", ") end def citing_documents_reference_numbers diff --git a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb index 85e1f54..9c99070 100644 --- a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb +++ b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb @@ -48,8 +48,8 @@
<%= raw content.html_safe %>
-+ <% if opts[:is_doctrines_index].present? %> + <% document_title = annotation.doctrine.document.short_title || annotation.doctrine.document.title %> + <% date_or_year = annotation.doctrine.document.docdate.present? ? annotation.doctrine.document.docdate.to_date.strftime("%B %d, %Y") : annotation.document.year %> + <%= [document_title, annotation.document.reference_number, date_or_year].join(", ") %> + <% end %> + +
+ <% annotated_documents_title = [] %> + <% annotation.documents.each do |annotated_document| %> + <% ad_title = annotated_document.short_title || annotated_document.title %> + <% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %> + <% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %> + <% end %> + <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> - <%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep].reject(&:blank?).join(', ') %> + <%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %>
<% if annotation.editor_notes.present? %> -+ <% document_title = annotation.doctrine.document.short_title || annotation.doctrine.document.title %> + <% date_or_year = annotation.doctrine.document.docdate.present? ? annotation.doctrine.document.docdate.to_date.strftime("%B %d, %Y") : annotation.document.year %> + <%= [document_title, annotation.document.reference_number, date_or_year].join(", ") %> + +
<%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> - <%= raw [annotation.document.title, annotation.document.reference_number, annotation.document.docdate.strftime("%B %d, %Y"), annotation.phil_rep].reject(&:blank?).join(', ').html_safe %> + <% 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 = [] %> + <% annotation.documents.each do |annotated_document| %> + <% ad_title = annotated_document.short_title || annotated_document.title %> + <% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %> + <% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %> + <% end %> + <%= raw [document_title, annotation.document.reference_number, date_or_year, annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ').html_safe %>
| Name: | -<%= @subject_index.name %> | -Parent Subject: | -<%= @subject_index.is_root? ? "N/A" : @subject_index.parent.lineage_name %> | -