|
|
|
@ -85,7 +85,7 @@ |
|
|
|
<div class="row-flex"> |
|
|
|
<div class="row-flex"> |
|
|
|
<div class="annot-header"> <h5> Annotations </h5> </div> |
|
|
|
<div class="annot-header"> <h5> Annotations </h5> </div> |
|
|
|
<div class="" id="annotationsIndexView"> |
|
|
|
<div class="" id="annotationsIndexView"> |
|
|
|
<% doctrine.annotations.order(created_at: :desc).each do |annotation| %> |
|
|
|
<% annotations.sort_by { |a| [a.document.library.rank, -a.document.year, -a.document.doc_date.strftime("%Y-%m-%d")] }.each do |annotation| %> |
|
|
|
<% document_title = annotation.document.short_title || annotation.document.title %> |
|
|
|
<% 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 %> |
|
|
|
<% date_or_year = annotation.document.docdate.present? ? annotation.document.docdate.strftime("%B %d, %Y") : annotation.document.year %> |
|
|
|
<% annotated_documents_title = [] %> |
|
|
|
<% annotated_documents_title = [] %> |
|
|
|
@ -100,14 +100,14 @@ |
|
|
|
<div class="col-sm-10"> |
|
|
|
<div class="col-sm-10"> |
|
|
|
<p class="pb-0 ms-3"> |
|
|
|
<p class="pb-0 ms-3"> |
|
|
|
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
|
|
|
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
|
|
|
<%= raw citing_document_title %> |
|
|
|
<%= raw annotation.content.present? ? annotation.content : citing_document_title %> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-2 d-flex justify-content-end align-items-baseline"> |
|
|
|
<div class="col-sm-2 d-flex justify-content-end align-items-baseline"> |
|
|
|
<a class="btn btn-secondary me-3" data-bs-toggle="modal" data-bs-target="#annotationModal" |
|
|
|
<a class="btn btn-secondary me-3" data-bs-toggle="modal" data-bs-target="#annotationModal" |
|
|
|
data-controller="annotations" data-doctrine-id="<%= id %>" data-annotation-id="<%= annotation.id %>" |
|
|
|
data-controller="annotations" data-doctrine-id="<%= id %>" data-annotation-id="<%= annotation.id %>" |
|
|
|
data-current-document-id="<%= document_id %>" data-document-title="<%= citing_document_title %>" |
|
|
|
data-current-document-id="<%= document_id %>" data-document-title="<%= annotation.content.present? ? annotation.content : citing_document_title %>" |
|
|
|
data-action="click->annotations#renderForm"> Edit </a> |
|
|
|
data-action="click->annotations#renderForm"> Edit </a> |
|
|
|
<a class="btn btn-danger" data-controller="annotations" data-current-document-id="<%= document_id %>" data-doctrine-id="<%= id %>" data-annotation-id="<%= annotation.id %>" data-action="click->annotations#delete" > Delete </a> |
|
|
|
<a class="btn btn-danger" data-controller="annotations" data-current-document-id="<%= document_id %>" data-doctrine-id="<%= id %>" data-annotation-id="<%= annotation.id %>" data-action="click->annotations#delete" > Delete </a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|