<% if opts[:subject_ids].reject(&:blank?).present? %>
<%= subjects.where(id: opts[:subject_ids].map(&:to_i)).map(&:lineage_name).join("") %>
<% else %>
(No Subjects Provided)
<% end %>

<%= raw content.html_safe %>

<% 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| %>

<% 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, annotated_documents_title].reject(&:blank?).join(', ') %>

<% if annotation.editor_notes.present? %>
Editors Note:
<%= raw annotation.editor_notes %>
<% end %> <% end %>