You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.6 KiB

<% annotations.each_with_index do |annotation, index| %>
<div class="row mb-2 pb-0 ms-3">
<div class="col-sm-1 p-0 me-1" style="width: auto;">
<% if annotation[:annomark_ids].present? %>
<% annomarks = Annomark.where(id: annotation[:annomark_ids]) %>
<strong> <%= "#{annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong>
<% end %>
</div>
<div class="col-sm-9 p-0 ms-1">
<% contents = annotation[:content].gsub("<div>", "").gsub("</div>", "").split(" citing ") %>
<% phil_rep = annotation[:phil_rep] %>
<% contents[0] = [contents[0], phil_rep.gsub(/(PhilRep|Phil)\.?,?/i, "Phil")].join(" ") %>
<%= raw contents.length > 1 ? contents.join(" citing ") : contents[0] %>
</div>
<div class="col-sm-2 d-flex justify-content-end align-items-baseline">
<a class="btn btn-sm btn-secondary me-3" data-bs-toggle="modal" data-bs-target="#annotationModal"
data-controller="doctrines" data-annotations-attributes-index="<%= index %>"
data-action="click->doctrines#editAnnotation"> Edit </a>
<a class="btn btn-sm btn-danger" data-controller="doctrines" data-annotations-attributes-index="<%= index %>"
data-action="click->doctrines#removeAnnotation" > Delete </a>
</div>
</div>
<% if annotation[:editor_notes].present? %>
<div class="row mb-2">
<div class="col-sm-1 ms-5 p-0" style="width: 105px;">
<span> Editors Note: </span>
</div>
<div class="col-sm-10 ps-0">
<%= raw annotation[:editor_notes] %>
</div>
</div>
<hr/>
<% end %>
<% end %>