Compare commits
1 Commits
master
...
rails-cred
| Author | SHA1 | Date |
|---|---|---|
|
|
c2f94c34de | 4 years ago |
102 changed files with 466 additions and 2088 deletions
@ -1,51 +0,0 @@ |
|||||||
class AnnotationFormComponent < BaseComponent |
|
||||||
attr_reader :annotation, :opts |
|
||||||
|
|
||||||
def initialize(current_user:, annotation:, opts: {}) |
|
||||||
@annotation = annotation |
|
||||||
@opts = opts |
|
||||||
end |
|
||||||
|
|
||||||
def document |
|
||||||
return annotation.document if annotation.persisted? |
|
||||||
|
|
||||||
Cdao::Document.find(opts[:document_id].to_i) |
|
||||||
end |
|
||||||
|
|
||||||
def clean_phil_rep(annotation) |
|
||||||
return if annotation.phil_rep.blank? |
|
||||||
|
|
||||||
annotation.phil_rep.gsub(/(PhilRep|Phil)\.?,?/i, "Phil") |
|
||||||
end |
|
||||||
|
|
||||||
def display_text |
|
||||||
return annotation.content if annotation.persisted? && annotation.content.present? && annotation.content.include?("Phil") |
|
||||||
|
|
||||||
display_text = nil |
|
||||||
title = document.short_title || document.title |
|
||||||
year_or_date = document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year |
|
||||||
|
|
||||||
if annotation.new_record? |
|
||||||
display_text = [title, document.clean_reference_number, year_or_date].join(", ") |
|
||||||
else |
|
||||||
contents = [[title, document.clean_reference_number, year_or_date].reject(&:blank?).join(", ")] |
|
||||||
|
|
||||||
annotation.documents.each do |citing_doc| |
|
||||||
citing_doc_title = citing_doc.short_title || citing_doc.title |
|
||||||
citing_doc_year_or_date = citing_doc.doc_date.present? ? citing_doc.doc_date.strftime("%B %d, %Y") : citing_doc.year |
|
||||||
contents << [citing_doc_title, citing_doc.clean_reference_number, citing_doc_year_or_date].join(", ") |
|
||||||
end |
|
||||||
|
|
||||||
display_text = contents.reject(&:blank?).join(" citing ") |
|
||||||
end |
|
||||||
|
|
||||||
display_text |
|
||||||
end |
|
||||||
|
|
||||||
def phil_rep |
|
||||||
return annotation.phil_rep if annotation.persisted? |
|
||||||
|
|
||||||
document.phil_rep |
|
||||||
end |
|
||||||
end |
|
||||||
|
|
||||||
@ -1,51 +0,0 @@ |
|||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> Annotation Marks </strong> |
|
||||||
<%= hidden_field_tag :document_ids, annotation.citing_document_ids, data: { target: "annotations.document_ids" } %> |
|
||||||
<%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all.order(name: :asc), :id, :name, annotation.annomark_ids), |
|
||||||
class: "form-control default-selectize ps-0", multiple: true, prompt: "Please select" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :document_title %> </strong> |
|
||||||
<%= rich_text_area_tag :content, display_text, placeholder: "Document Title" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div id="annotatedDocumentsSearchResults"> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "annotations.q" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-1 p-2"> |
|
||||||
<button type="button" class="btn btn-success" data-action="click->annotations#searchDocuments"> Search </button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :phil_rep %> </strong> |
|
||||||
<%= text_field_tag :phil_rep, phil_rep, class: "form-control", data: { target: "annotations.phil_rep" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag "Editor's Note" %> </strong> |
|
||||||
<%= rich_text_area_tag :editor_notes, annotation.editor_notes, placeholder: "Editor's Note", data: { target: "annotations.editor_notes" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,10 +0,0 @@ |
|||||||
class DoctrineFormComponent < BaseComponent |
|
||||||
attr_reader :doctrine, :jurisprudence_id, :opts |
|
||||||
|
|
||||||
def initialize(current_user:, doctrine:, jurisprudence_id:, opts: {}) |
|
||||||
@doctrine = doctrine |
|
||||||
@jurisprudence_id = jurisprudence_id |
|
||||||
@opts = opts |
|
||||||
end |
|
||||||
end |
|
||||||
|
|
||||||
@ -1,38 +0,0 @@ |
|||||||
<div class="row"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<label for="subject-name" class="col-form-label"> Subjects </label> |
|
||||||
<%= hidden_field_tag :document_id, jurisprudence_id, data: { target: "doctrines.document_id" } %> |
|
||||||
<%= hidden_field_tag :doctrine_id, doctrine.id, data: { target: "doctrines.doctrine_id" } %> |
|
||||||
<select class="form-control subject-ids-selectize ps-0" name="subject_ids[]" id="subject_ids_" multiple="true" required> |
|
||||||
<% doctrine.subjects.each do |subject| %> |
|
||||||
<option value="<%= subject.id %>" selected> <%= subject.lineage_name %> </option> |
|
||||||
<% end if doctrine.persisted? %> |
|
||||||
</select> |
|
||||||
<div class="invalid-feedback" id="subjects-blank-message"> Subject/s cannot be blank. </div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<% if doctrine.new_record? %> |
|
||||||
<div class="row" id="doctine_content_suggestions_div"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<label for="subject-name" class="col-form-label">Doctine content suggestions</label> |
|
||||||
<select id="doctine_content_suggestions" class="form-control ps-0"> </select> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<% end %> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<label for="subject-name" class="col-form-label">Head Note</label> |
|
||||||
<%= text_field_tag :headnote, doctrine.headnote, class: "form-control", placeholder: "Head note", required: true, data: { target: "doctrines.headnote" } %> |
|
||||||
<div class="invalid-feedback" id="headnote-blank-message"> Headnote cannot be blank. </div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<label for="subject-name" class="col-form-label">Content</label> |
|
||||||
<%= rich_text_area_tag :content, doctrine.content, placeholder: "Doctrine Content", required: true, data: { target: "doctrines.content" } %> |
|
||||||
<div class="invalid-feedback" id="content-blank-message"> Content cannot be blank. </div> |
|
||||||
<div> |
|
||||||
</div> |
|
||||||
@ -1,58 +1,45 @@ |
|||||||
<div class="row-flex m-3 mt-0 doctrine-content-body"> |
<div class="row-flex m-3 mt-0 doctrine-content-body clickable-link" href="<%= jurisprudence.present? ? document_doctrine_path(jurisprudence.id, id, is_index_table: false, subject_ids: opts[:subject_ids].reject(&:blank?)) : doctrine_path(id, is_index_table: false)%>"> |
||||||
<div class="container-sm <%= params[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
<% if opts[:subject_ids].reject(&:blank?).present? %> |
||||||
<% search_results.uniq(&:headnote).each do |uniq_by_headnote| %> |
<h5 style="color: darkred;"> <%= subjects.where(id: opts[:subject_ids].map(&:to_i)).map(&:lineage_name).join("") %> </h5> |
||||||
<h5> <%= uniq_by_headnote.headnote %> </h5> |
<% else %> |
||||||
|
<h5> (No Subjects Provided) </h5> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<div class="container-sm <%= opts[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
||||||
|
<p class="mb-0"> <%= raw content.html_safe %> </p> |
||||||
|
|
||||||
|
<div class="container-fluid p-0"> |
||||||
|
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
||||||
|
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %> |
||||||
|
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5> |
||||||
|
|
||||||
<% grouped_by_content_search_params = { subject_ids: opts[:subject_ids], headnote: uniq_by_headnote.headnote, is_grouped_by_content: true } %> |
<% annotations.each do |annotation| %> |
||||||
<% search_doctrines(grouped_by_content_search_params).group(:content).groups.each do |group_by_content| %> |
<p class="mb-0 ms-3"> |
||||||
<% group_by_content.results.each do |content_result| %> |
<% annotated_documents_title = [] %> |
||||||
<div class="mb-0 fs-5"> <%= raw content_result.content.html_safe %> </div> |
<% annotation.documents.each do |annotated_document| %> |
||||||
|
<% ad_title = annotated_document.short_title || annotated_document.title %> |
||||||
<% grouped_by_juris_search_params = { subject_ids: opts[:subject_ids], content: content_result.content, is_grouped_by_juris_id: true } %> |
<% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %> |
||||||
<% search_doctrines(grouped_by_juris_search_params).group(:jurisprudence_id).groups.each do |grouped_by_juris| %> |
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %> |
||||||
<% grouped_by_juris.results.each do |juris_result| %> |
<% end %> |
||||||
<h5 class="clickable-link" style="color: darkred;" data-controller="application" |
|
||||||
data-href="<%= document_path(juris_result.jurisprudence.document.id, is_index_table: false, subject_ids: params[:subject_ids]) %>" |
|
||||||
data-action="click->application#openLink"> |
|
||||||
<% document_title = juris_result.jurisprudence.short_title || juris_result.jurisprudence.title %> |
|
||||||
<% date_or_year = juris_result.jurisprudence.doc_date.present? ? juris_result.jurisprudence.doc_date.strftime("%B, %d, %Y") : doctrine.jurisprudence.year %> |
|
||||||
<%= [document_title, juris_result.jurisprudence.clean_reference_number, date_or_year].join(", ") %> |
|
||||||
</h5> |
|
||||||
|
|
||||||
<% search_params = { subject_ids: opts[:subject_ids], headnote: uniq_by_headnote.headnote, content: content_result.content, jurisprudence_id: juris_result.jurisprudence.id } %> |
|
||||||
<% search_doctrines(search_params).results.each do |doctrine| %> |
|
||||||
<% search_annotations({ doctrine_id: doctrine.id }).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.doc_date.present? ? annotated_document.doc_date.strftime("%B %d, %Y") : annotated_document.year %> |
|
||||||
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.clean_reference_number, ad_date_or_year].join(", ") %> |
|
||||||
<% end %> |
|
||||||
<% citing_document_title = [document_title, annotation.document.clean_reference_number, date_or_year, clean_phil_rep(annotation), annotated_documents_title].reject(&:blank?).join(', ').html_safe %> |
|
||||||
|
|
||||||
<div class="row mb-2 pb-0 ms-3"> |
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
||||||
<div class="col-sm-1 p-0 me-1" style="width: auto;"> <strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> </div> |
<%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %> |
||||||
<div class="col-sm-9 p-0 ms-1"> <%= raw annotation.content.present? ? content_diplay_text(annotation) : citing_document_title %> </div> |
</p> |
||||||
</div> |
|
||||||
|
|
||||||
<% if annotation.editor_notes.present? %> |
<% if annotation.editor_notes.present? %> |
||||||
<div class="row ms-5 mb-2"> |
<div class="row ms-5"> |
||||||
<div class="col-sm-2 p-0" style="width: 105px;"> |
<div class="col-sm-2 p-0" style="width: 105px;"> |
||||||
<span> Editor's Note: </span> |
<span> Editors Note: </span> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div class="col-sm-10 ps-0"> |
<div class="col-sm-10 ps-0"> |
||||||
<%= raw annotation.editor_notes %> |
<%= raw annotation.editor_notes %> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
</div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<hr/> |
<hr/> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -1,45 +1,55 @@ |
|||||||
<div class="row-flex m-3 mt-0 doctrine-content-body clickable-link" data-controller="application" |
<div class="row-flex m-3 mt-0 doctrine-content-body clickable-link" href="<%= jurisprudence.present? ? document_doctrine_path(jurisprudence.id, id) : doctrine_path(id)%>"> |
||||||
data-href="<%= jurisprudence.present? ? document_doctrine_path(jurisprudence.id, id) : doctrine_path(id)%>" |
<% if opts[:is_doctrines_index].blank? %> |
||||||
data-action="click->application#openLink"> |
<% if opts[:is_subjects_index].blank? %> |
||||||
<div class="container-sm <%= opts[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
<% if opts[:is_doctrines_index].present? && opts[:subject_ids].reject(&:blank?).present? %> |
||||||
<span> <b> <i> <%= headnote %> </i> </b> </span> |
<h5 style="color: darkred;"> <%= subjects.where(id: opts[:subject_ids].map(&:to_i)).map(&:lineage_name).join(" ") %> </h5> |
||||||
<p class="mb-0"> <%= raw content.html_safe %> </p> |
<% elsif subjects.present? %> |
||||||
|
<% subjects.each do |subject| %> |
||||||
<div class="container-fluid p-0"> |
<h5 style="color: darkred;"> <%= subject.lineage_name %> </h5> |
||||||
<% if opts[:is_doctrines_index].present? %> |
<% end %> |
||||||
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
<% else %> |
||||||
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %> |
<h5> (No Subjects Provided) </h5> |
||||||
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.clean_reference_number, date_or_year].join(", ") %> </h5> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<div class="container-sm <%= opts[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
||||||
|
<p class="mb-0"> <%= raw content.html_safe %> </p> |
||||||
|
|
||||||
|
<div class="container-fluid p-0"> |
||||||
|
<% if opts[:is_doctrines_index].present? %> |
||||||
|
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
||||||
|
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %> |
||||||
|
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5> |
||||||
|
<% end %> |
||||||
|
|
||||||
<% annotations.each do |annotation| %> |
<% annotations.each do |annotation| %> |
||||||
<% annotated_documents_title = [] %> |
<p class="mb-0 ms-3"> |
||||||
<% annotation.documents.each do |annotated_document| %> |
<% annotated_documents_title = [] %> |
||||||
<% ad_title = annotated_document.short_title || annotated_document.title %> |
<% annotation.documents.each do |annotated_document| %> |
||||||
<% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %> |
<% ad_title = annotated_document.short_title || annotated_document.title %> |
||||||
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.clean_reference_number, ad_date_or_year].join(", ") %> |
<% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %> |
||||||
<% end %> |
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %> |
||||||
<% citing_document_title = [document_title, annotation.document.clean_reference_number, date_or_year, clean_phil_rep(annotation), annotated_documents_title].reject(&:blank?).join(', ').html_safe %> |
<% end %> |
||||||
|
|
||||||
<div class="row mb-2 pb-0 ms-3"> |
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
||||||
<div class="col-sm-1 p-0 me-1" style="width: auto;"> <strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> </div> |
<%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %> |
||||||
<div class="col-sm-9 p-0 ms-1"> <%= raw annotation.content.present? ? content_diplay_text(annotation) : citing_document_title %> </div> |
</p> |
||||||
</div> |
|
||||||
|
|
||||||
<% if annotation.editor_notes.present? %> |
<% if annotation.editor_notes.present? %> |
||||||
<div class="row ms-5 mb-2"> |
<div class="row ms-5"> |
||||||
<div class="col-sm-2 p-0" style="width: 105px;"> |
<div class="col-sm-2 p-0" style="width: 105px;"> |
||||||
<span> Editor's Note: </span> |
<span> Editors Note: </span> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div class="col-sm-10 ps-0"> |
<div class="col-sm-10 ps-0"> |
||||||
<%= raw annotation.editor_notes %> |
<%= raw annotation.editor_notes %> |
||||||
</div> |
</div> |
||||||
</div> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
</div> |
</div> |
||||||
</div> |
<% end %> |
||||||
|
<% end %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<hr/> |
<hr/> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -0,0 +1,24 @@ |
|||||||
|
class DocumentIndexTableComponent < BaseComponent |
||||||
|
with_collection_parameter :search_result |
||||||
|
attr_reader :search_result, :opts |
||||||
|
|
||||||
|
def initialize(search_result:, current_user:, opts: {}) |
||||||
|
@search_result = search_result |
||||||
|
@opts = opts |
||||||
|
end |
||||||
|
|
||||||
|
delegate :id, to: :search_result |
||||||
|
delegate :clean_reference_number, to: :search_result |
||||||
|
delegate :title, to: :search_result |
||||||
|
delegate :short_title, to: :search_result |
||||||
|
|
||||||
|
def date_or_year |
||||||
|
return search_result.docdate.strftime("%m/%d/%Y") if search_result.docdate.present? |
||||||
|
|
||||||
|
search_result.year |
||||||
|
end |
||||||
|
|
||||||
|
def doctrine_annotations_path(doctrine_id) |
||||||
|
doctrine_annotations_path(doctrine_id: doctrine_id) |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,5 @@ |
|||||||
|
<tr href="<%= document_path(id) %>" class="clickable-link" target="_blank"> |
||||||
|
<td> <%= clean_reference_number %> </td> |
||||||
|
<td> <%= short_title || title %> </td> |
||||||
|
<td> <%= date_or_year %> </td> |
||||||
|
</tr> |
||||||
@ -1,25 +0,0 @@ |
|||||||
class JurisprudencesIndexTableComponent < BaseComponent |
|
||||||
with_collection_parameter :jurisprudence |
|
||||||
attr_reader :jurisprudence, :opts |
|
||||||
|
|
||||||
def initialize(jurisprudence:, current_user:, opts: {}) |
|
||||||
@jurisprudence = jurisprudence |
|
||||||
@opts = opts |
|
||||||
end |
|
||||||
|
|
||||||
delegate :id, to: :jurisprudence |
|
||||||
delegate :clean_reference_number, to: :jurisprudence |
|
||||||
delegate :title, to: :jurisprudence |
|
||||||
delegate :short_title, to: :jurisprudence |
|
||||||
delegate :document, to: :jurisprudence |
|
||||||
|
|
||||||
def date_or_year |
|
||||||
return jurisprudence.docdate.strftime("%B %d, %Y") if jurisprudence.docdate.present? |
|
||||||
|
|
||||||
jurisprudence.year |
|
||||||
end |
|
||||||
|
|
||||||
def doctrine_annotations_path(doctrine_id) |
|
||||||
doctrine_annotations_path(doctrine_id: doctrine_id) |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,6 +0,0 @@ |
|||||||
<tr class="clickable-link" data-controller="application" data-href="<%= document_path(document.id) %>" |
|
||||||
data-action="click->application#openLink"> |
|
||||||
<td> <%= clean_reference_number %> </td> |
|
||||||
<td> <%= short_title || title %> </td> |
|
||||||
<td> <%= date_or_year %> </td> |
|
||||||
</tr> |
|
||||||
@ -1,42 +1,40 @@ |
|||||||
<div class="row-flex m-3 mt-0 doctrine-content-body clickable-link" data-controller="application" |
<div class="row-flex m-3 mt-0 doctrine-content-body clickable-link" href="<%= jurisprudence.present? ? document_doctrine_path(jurisprudence.id, id) : doctrine_path(id)%>"> |
||||||
data-href="<%= jurisprudence.present? ? document_doctrine_path(jurisprudence.id, id) : doctrine_path(id)%>" |
<div class="container-sm <%= opts[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
||||||
data-action="click->application#openLink"> |
<p class="mb-0"> <%= raw content.html_safe %> </p> |
||||||
<div class="container-sm <%= opts[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
|
||||||
<p class="mb-0"> <%= raw content.html_safe %> </p> |
|
||||||
|
<div class="container-fluid p-0"> |
||||||
|
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
||||||
<div class="container-fluid p-0"> |
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.strftime : jurisprudence.year %> |
||||||
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5> |
||||||
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.strftime : jurisprudence.year %> |
|
||||||
<h5 style="color: darkred;"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5> |
|
||||||
|
|
||||||
<% annotations.each do |annotation| %> |
<% annotations.each do |annotation| %> |
||||||
<p class="mb-0 ms-5"> |
<p class="mb-0 ms-5"> |
||||||
<% annotated_documents_title = [] %> |
<% annotated_documents_title = [] %> |
||||||
<% annotation.documents.each do |annotated_document| %> |
<% annotation.documents.each do |annotated_document| %> |
||||||
<% ad_title = annotated_document.short_title || annotated_document.title %> |
<% 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 %> |
<% 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(", ") %> |
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
<strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> |
||||||
<%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %> |
<%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %> |
||||||
</p> |
</p> |
||||||
|
|
||||||
<% if annotation.editor_notes.present? %> |
<% if annotation.editor_notes.present? %> |
||||||
<div class="row ms-5"> |
<div class="row ms-5"> |
||||||
<div class="col-sm-2 p-0" style="width: 105px;"> |
<div class="col-sm-2 p-0" style="width: 105px;"> |
||||||
<span> Editor's Note: </span> |
<span> Editors Note: </span> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<div class="col-sm-10 ps-0"> |
<div class="col-sm-10 ps-0"> |
||||||
<%= raw annotation.editor_notes %> |
<%= raw annotation.editor_notes %> |
||||||
</div> |
</div> |
||||||
</div> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
</div> |
</div> |
||||||
</div> |
<% end %> |
||||||
|
<% end %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<hr/> |
<hr/> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -1,66 +0,0 @@ |
|||||||
class ParseLinkableContentJob < ActiveJob::Base |
|
||||||
queue_as :default |
|
||||||
|
|
||||||
def perform(annotation) |
|
||||||
content = "" |
|
||||||
document = annotation.document |
|
||||||
citing_docs = annotation.documents |
|
||||||
|
|
||||||
if annotation.content.present? |
|
||||||
content = annotation.content.gsub("<div>", "").gsub("</div>", "") |
|
||||||
|
|
||||||
contents = content.split(" citing ") |
|
||||||
contents.each_with_index do |content, i| |
|
||||||
linkable_content = nil |
|
||||||
if i.eql?(0) |
|
||||||
linkable_content = add_linkable_content(document.id, [content[i], clean_phil_rep(annotation)].reject(&:blank?).join(", ")) |
|
||||||
else |
|
||||||
citing_docs.each do |citing_doc| |
|
||||||
old_content = contents[i] |
|
||||||
next if !old_content.include?(citing_doc.clean_reference_number) |
|
||||||
|
|
||||||
linkable_content = add_linkable_content(citing_doc.id, old_content) |
|
||||||
end |
|
||||||
end |
|
||||||
|
|
||||||
contents[i] = linkable_content |
|
||||||
end |
|
||||||
|
|
||||||
content = contents.join(" citing ") |
|
||||||
else |
|
||||||
contents = [] |
|
||||||
doc_title = document.short_title || document.title |
|
||||||
doc_date_or_year = document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year |
|
||||||
doc_ref_num = document.clean_reference_number |
|
||||||
contents << add_linkable_content(document.id, [doc_title, doc_ref_num, doc_date_or_year, clean_phil_rep(annotation)].reject(&:blank?).join(", ")) |
|
||||||
|
|
||||||
if citing_docs.present? |
|
||||||
citing_docs.each do |citing_doc| |
|
||||||
citing_doc_title = citing_doc.short_title || citing_doc.title |
|
||||||
citing_doc_date_or_year = citing_doc.doc_date.present? ? citing_doc.doc_date.strftime("%B %d, %Y") : citing_doc.year |
|
||||||
citing_doc_ref_num = citing_doc.clean_reference_number |
|
||||||
|
|
||||||
citing_content = [citing_doc_title, citing_doc_date_or_year, citing_doc_ref_num].join(", ") |
|
||||||
contents << ["citing", add_linkable_content(citing_doc, citing_content)].join(" ") |
|
||||||
end |
|
||||||
end |
|
||||||
content = contents.join(", ") |
|
||||||
end |
|
||||||
|
|
||||||
annotation.update_column(:content, content) if content.present? |
|
||||||
annotation.index! |
|
||||||
end |
|
||||||
|
|
||||||
private |
|
||||||
def add_linkable_content(document_id, content) |
|
||||||
document_route = Rails.application.routes.url_helpers.document_path(document_id) |
|
||||||
|
|
||||||
"<a href='#{document_route}'> #{content} </a>" |
|
||||||
end |
|
||||||
|
|
||||||
def clean_phil_rep(annotation) |
|
||||||
return if annotation.phil_rep.blank? |
|
||||||
|
|
||||||
annotation.phil_rep.gsub(/(PhilRep|Phil)\.?,?/i, "Phil") |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,42 +0,0 @@ |
|||||||
# frozen_string_literal: true |
|
||||||
|
|
||||||
class DoctrinesReflex < ApplicationReflex |
|
||||||
include DoctrineSearch |
|
||||||
include DocumentSearch |
|
||||||
|
|
||||||
def render_document_doctrines_index(search_params) |
|
||||||
search = doctrine_search(search_params) |
|
||||||
morph "#doctrinesIndexView", render(partial: "/shared/document_doctrines_index", locals: { doctrines: search.results, current_user: current_user, opts: { document_id: search_params[:jurisprudence_id], current_page: search_params[:page] } }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_annotation_modal_form(document_id, doctrine_id) |
|
||||||
jurisprudence = Cdao::Jurisprudence.find(document_id) |
|
||||||
document = Cdao::Document.where(reference_number: jurisprudence.reference_number).first |
|
||||||
morph "#doctrineModal", render(partial: "/shared/annotation_modal_form", locals: { document: document, doctrine_id: doctrine_id, jurisprudence: jurisprudence }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_annotation_form(document_id, doctrine_id) |
|
||||||
jurisprudence = Cdao::Jurisprudence.find(document_id) |
|
||||||
document = Cdao::Document.where(reference_number: jurisprudence.reference_number).first |
|
||||||
morph "#doctrineForm", render(partial: "/shared/annotation_form", locals: { annotation: Annotation.new, document: document, doctrine_id: doctrine_id, jurisprudence: jurisprudence }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_doctrine_form_annotations_view(annotations) |
|
||||||
morph "#doctrineAnnotationsView", render(partial: "/shared/doctrine_form_annotations_view", locals: { annotations: annotations }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_citing_documents_search_results(search_params) |
|
||||||
search = document_search(search_params.merge(sort_by: %w[reference_number_texts title_texts short_title_texts])) |
|
||||||
@documents = search.results |
|
||||||
opts = { current_page: search_params[:page], q: search_params[:q] } |
|
||||||
morph "#citingDocumentsSearchResults", render(partial: "/shared/doctrine_form_citing_documents_search_results", locals: { documents: @documents, opts: opts }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_default_citing_documents |
|
||||||
morph "#citingDocumentsSearchResults", render(partial: "/shared/doctrine_form_citing_documents_search_results", locals: { documents: [], opts: {} }) |
|
||||||
end |
|
||||||
|
|
||||||
def render_default_case_lists |
|
||||||
morph "#caseListsCollapse", render(partial: "/shared/doctrine_form_default_case_lists", locals: { documents: @documents, opts: {} }) |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,3 +0,0 @@ |
|||||||
json.array!(@doctrines) do |doctrine| |
|
||||||
json.extract! doctrine, *%i[id subject_ids headnote content plain_content created_at updated_at] |
|
||||||
end |
|
||||||
@ -1,15 +0,0 @@ |
|||||||
<div class="container-fluid mt-2 p-0" id="annotationForm" |
|
||||||
data-controller="annotations" data-annotation-id="<%= @annotation.id %>" data-doctrine-id="<%= @annotation.doctrine_id %>" |
|
||||||
data-document-id="<%= @annotation.document_id %>" data-jurisprudence-id="<%= params[:jurisprudence_id] %>"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<div class="card-header" style="border-bottom: 1px solid darkred;"> <h4 class="mb-0"> Edit Annotation </h4> </div> |
|
||||||
<div class="card-body"> |
|
||||||
<%= render(AnnotationFormComponent.new(current_user: current_user, annotation: @annotation)) %> |
|
||||||
</div> |
|
||||||
<div class="card-footer d-flex justify-content-end mt-2"> |
|
||||||
<button type="button" class="btn btn-success me-2" data-action="click->annotations#save">Save</button> |
|
||||||
<a class="btn btn-danger ms-2" href="<%= document_doctrine_path(params[:jurisprudence_id], @doctrine.id) %>">Back</a> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,16 +0,0 @@ |
|||||||
<div class="container-fluid mt-2 p-0" id="annotationForm" |
|
||||||
data-controller="annotations" data-annotation-id data-doctrine-id="<%= params[:doctrine_id] %>" |
|
||||||
data-document-id="<%= params[:document_id] %>" data-jurisprudence-id="<%= params[:jurisprudence_id] %>"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<div class="card-header" style="border-bottom: 1px solid darkred;"> <h4 class="mb-0"> New Annotation </h4> </div> |
|
||||||
<div class="card-body"> |
|
||||||
<%= render(AnnotationFormComponent.new(current_user: current_user, annotation: @annotation, |
|
||||||
opts: { document_id: params[:document_id] })) %> |
|
||||||
</div> |
|
||||||
<div class="card-footer d-flex justify-content-end mt-2"> |
|
||||||
<button type="button" class="btn btn-success me-2" data-action="click->annotations#save">Save</button> |
|
||||||
<a class="btn btn-danger ms-2" href="<%= document_doctrine_path(params[:jurisprudence_id], params[:doctrine_id]) %>">Back</a> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,12 +0,0 @@ |
|||||||
<div class="container-fluid mt-2 p-0" data-controller="doctrines" id="doctrineForm"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<div class="card-header" style="border-bottom: 1px solid darkred;"> <h4 class="mb-0"> Edit Doctrine </h4> </div> |
|
||||||
<div class="card-body"> |
|
||||||
<%= render(DoctrineFormComponent.new(current_user: current_user, doctrine: @doctrine, jurisprudence_id: params[:jurisprudence_id])) %> |
|
||||||
</div> |
|
||||||
<div class="card-footer d-flex justify-content-end mt-2"> |
|
||||||
<button type="button" class="btn btn-success me-2" data-action="click->doctrines#save">Save</button> |
|
||||||
<a class="btn btn-danger ms-2" href="<%= document_doctrine_path(params[:jurisprudence_id], @doctrine) %>">Back</a> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,64 +0,0 @@ |
|||||||
<div class="container-fluid mt-2 p-0" data-controller="doctrines" id="doctrineForm"> |
|
||||||
<div class="col-sm-12"> |
|
||||||
<div class="card-header" style="border-bottom: 1px solid darkred;"> <h4 class="mb-0"> New Doctrine </h4> </div> |
|
||||||
<div class="card-body"> |
|
||||||
<%= render(DoctrineFormComponent.new(current_user: current_user, doctrine: @doctrine, jurisprudence_id: params[:jurisprudence_id])) %> |
|
||||||
|
|
||||||
<% if @doctrine.new_record? %> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-10"> </div> |
|
||||||
<div class="col-sm-2 p-2"> |
|
||||||
<button type="button" class="btn btn-info d-block ms-auto text-white" data-bs-toggle="collapse" data-bs-target="#caseListsCollapse" aria-expanded="false" aria-controls="collapseExample"> Case List </button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="collapse mb-3 mt-2" id="caseListsCollapse"> |
|
||||||
<div class="row" data-controller="document"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "document.input" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-2 p-2"> |
|
||||||
<%= button_tag "Search", class: "btn btn-success btn-sm me-2", data: { action: "click->document#searchDoctrineFormCaseLists" } %> |
|
||||||
<button class="btn btn-warning btn-sm text-white ms-3" data-bs-toggle="collapse" href="#citation_finder_collapse" role="button" aria-expanded="false" aria-controls="collapseExample" > Citation finder</button> |
|
||||||
</div> |
|
||||||
<div class="collapse col-sm-10 p-2" id="citation_finder_collapse"> |
|
||||||
<%= text_field_tag :citation_finder, nil, class: "form-control", placeholder: "Citation Finder", data: { target: "document.citation_finder" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<div class="col-sm-12default-pagination"> </div> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row-flex"> |
|
||||||
<div class="annot-header"> <h5> Annotations </h5> </div> |
|
||||||
<div class="" id="doctrineAnnotationsView"> </div> |
|
||||||
</div> |
|
||||||
<% end %> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="card-footer d-flex justify-content-end mt-2"> |
|
||||||
<button type="button" class="btn btn-success me-2" data-action="click->doctrines#save">Save</button> |
|
||||||
<% if params[:doctrine_id].present? %> |
|
||||||
<a class="btn btn-danger ms-2" href="<%= document_doctrine_path(params[:jurisprudence_id], params[:doctrine_id]) %>">Back</a> |
|
||||||
<% else %> |
|
||||||
<a class="btn btn-danger ms-2" href="<%= document_path(params[:document_id]) %>">Back</a> |
|
||||||
<% end %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<% if @doctrine.new_record? %> |
|
||||||
<div class="row"> |
|
||||||
<%= render partial: "/shared/doctrine_form_annotation_modal_form" %> |
|
||||||
</div> |
|
||||||
<% end %> |
|
||||||
@ -1,6 +1,11 @@ |
|||||||
<div class="container-fluid mt-1 p-0 doctrine-index-body"> |
<div class="container-fluid mt-1 p-0 doctrine-index-body"> |
||||||
<div class="container-fluid m-2 p-0"> <%= render PaginationComponent.new(data: @search_results, opts: { is_subject_breadcrums: true, subject_ids: params[:subject_ids], is_index_table: params[:is_index_table] }) %> </div> |
<div class="container-fluid m-2 p-0"> <%= render PaginationComponent.new(data: @doctrines, opts: { is_subject_breadcrums: true, subject_ids: params[:subject_ids], is_index_table: params[:is_index_table] }) %> </div> |
||||||
<hr class="mt-0"/> |
<hr class="mt-0"/> |
||||||
|
<% if params[:is_index_table].to_s.eql?("true") %> |
||||||
<%= render(DoctrineIndexComponent.new(search_results: @search_results, current_user: current_user, opts: { is_index_table: false, subject_ids: params[:subject_ids].map(&:to_i) })) %> |
<div class="card-body col-sm-12 tableFixHead p-0 mt-1"> |
||||||
|
<%= render(DoctrineIndexTableComponent.new(current_user: current_user, search_results: @doctrines, opts: { is_index_table: params[:is_index_table].to_s.eql?("true") })) %> |
||||||
|
</div> |
||||||
|
<% else %> |
||||||
|
<%= render(DoctrineIndexComponent.with_collection(@doctrines, current_user: current_user, opts: { subject_ids: params[:subject_ids] })) %> |
||||||
|
<% end %> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -1,8 +1,21 @@ |
|||||||
<div class="container-fluid mt-1 p-0 doctrine-index-body"> |
<div class="card mt-2 g-3"> |
||||||
<div class="container-fluid m-2 p-0"> <%= render PaginationComponent.new(data: @jurisprudences, opts: { is_subject_breadcrums: true, subject_ids: params[:subject_ids].split(","), is_index_table: params[:is_index_table] }) %> </div> |
<% Cdao::Subject.where(id: params[:subject_ids].split(",").map(&:strip).map(&:to_i)).each do |subject| %> |
||||||
<hr class="mt-0"/> |
<div class="card-header mt-1 col-sm-12"> |
||||||
|
<%= subject.path.map(&:name).join(' > ') %> |
||||||
|
</div> |
||||||
|
<% end if %> |
||||||
|
|
||||||
<div class="card-body col-sm-12 tableFixHead p-0 mt-1"> |
<div class="card-body col-sm-12 tableFixHead p-0 mt-1"> |
||||||
<%= render(DoctrineIndexTableComponent.new(current_user: current_user, search_results: @jurisprudences, opts: { is_index_table: true, subject_ids: params[:subject_ids].split(",").map(&:to_i) })) %> |
<div class="container m-2"> <%= render PaginationComponent.new(data: @jurisprudences) %> </div> |
||||||
|
<table class="table table-striped table-hover mb-0"> |
||||||
|
<thead> |
||||||
|
<th class="bg-light"> Reference No. </th> |
||||||
|
<th class="bg-light"> Title </th> |
||||||
|
<th class="bg-light"> Date </th> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<%= render(DocumentIndexTableComponent.with_collection(@jurisprudences, current_user: current_user, opts: { search_params: @search_params.to_unsafe_h })) %> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -1,64 +0,0 @@ |
|||||||
|
|
||||||
<div class="col-sm-12" data-controller="selectize"> |
|
||||||
<div class="card-header" style="border-bottom: 1px solid darkred;"> <h4 class="mb-0"> New Annotation </h4> </div> |
|
||||||
<div class="card-body"> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :annotation_marks %> </strong> |
|
||||||
<%= hidden_field_tag :doctrine_id, doctrine_id %> |
|
||||||
<%= hidden_field_tag :current_document_id, jurisprudence.id %> |
|
||||||
<%= hidden_field_tag :document_id, document.id %> |
|
||||||
<%= hidden_field_tag :document_ids, nil %> |
|
||||||
<%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all.order(name: :asc), :id, :name), |
|
||||||
class: "form-control default-selectize ps-0", multiple: true, prompt: "Please select" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :document_title %> </strong> |
|
||||||
<%= text_area_tag :document_title, document.display_text, class: "form-control selected-citing-docs" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div id="annotatedDocumentsSearchResults"> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "annotations.q" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-1 p-2"> |
|
||||||
<button type="button" class="btn btn-success" data-action="click->annotations#searchDocuments"> Search </button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :phil_rep %> </strong> |
|
||||||
<%= text_field_tag :phil_rep, document.phil_rep, class: "form-control" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag "Editor's Note" %> </strong> |
|
||||||
<%= rich_text_area_tag :editor_notes, nil, placeholder: "Editor's Note" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="card-footer d-flex justify-content-end mt-2"> |
|
||||||
<button type="button" class="btn btn-success me-2" data-action="click->doctrines#saveAnnotation">Save</button> |
|
||||||
<button type="button" class="btn btn-danger ms-2" href="<%= document_doctrine_path(jurisprudence.id, doctrine_id) %>">Back</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
<div class="row" data-controller="document" data-doctrine-id="<%= doctrine_id %>"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "document.input" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-2 p-2"> |
|
||||||
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#search" } %> |
|
||||||
<button class="btn btn-warning btn-sm text-white ms-3" data-bs-toggle="collapse" href="#citation_finder_collapse" role="button" aria-expanded="false" aria-controls="collapseExample" > Citation finder</button> |
|
||||||
</div> |
|
||||||
<div class="collapse col-sm-10 p-2" id="citation_finder_collapse"> |
|
||||||
<%= text_field_tag :citation_finder, nil, class: "form-control", placeholder: "Citation Finder", data: { target: "document.citation_finder" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
@ -1,71 +0,0 @@ |
|||||||
<div class="modal fade modal-doctrine-body" id="annotationModal" tabindex="-1" aria-labelledby="annotationModal" data-controller="doctrines"> |
|
||||||
<div class="modal-dialog modal-xl modal-dialog-scrollable"> |
|
||||||
<div class="modal-content"> |
|
||||||
<div class="modal-header"> |
|
||||||
<h5 class="modal-title"> New Annotation </h5> |
|
||||||
<button type="button" class="btn-close-x" data-bs-dismiss="modal" aria-label="Close">x</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="modal-body"> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :annotation_marks %> </strong> |
|
||||||
<%= hidden_field_tag :annotaitons_attributes_index, nil %> |
|
||||||
<%= hidden_field_tag :document_id, nil %> |
|
||||||
<%= hidden_field_tag :document_ids, nil %> |
|
||||||
<%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all.order(name: :asc), :id, :name), |
|
||||||
class: "form-control default-selectize ps-0", multiple: true, prompt: "Please select" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :document_title %> </strong> |
|
||||||
<%= rich_text_area_tag :document_title, nil, placeholder: "Document Title" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div id="citingDocumentsSearchResults"> |
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "doctrines.q" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-1 p-2"> |
|
||||||
<button type="button" class="btn btn-success" data-action="click->doctrines#searchCitingDocuments"> Search </button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag :phil_rep %> </strong> |
|
||||||
<%= text_field_tag :phil_rep, nil, class: "form-control" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row"> |
|
||||||
<div class="col-sm-12 p-2"> |
|
||||||
<strong> <%= label_tag "Editor's Note" %> </strong> |
|
||||||
<%= rich_text_area_tag :editor_notes, nil, placeholder: "Editor's Note" %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="modal-footer"> |
|
||||||
<button type="button" class="btn btn-success" data-action="click->doctrines#saveAnnotation"> Save </button> |
|
||||||
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
@ -1,38 +0,0 @@ |
|||||||
<% 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> Editor's Note: </span> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="col-sm-10 ps-0"> |
|
||||||
<%= raw annotation[:editor_notes] %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<hr/> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
@ -1,108 +0,0 @@ |
|||||||
<div class="row" data-controller="document"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number, Title or Short Title", |
|
||||||
data: { target: "document.input" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-2 p-2"> |
|
||||||
<%= button_tag "Search", class: "btn btn-success btn-sm", data: { action: "click->document#searchDoctrineFormCaseLists" } %> |
|
||||||
<button class="btn btn-warning btn-sm text-white ms-3" data-bs-toggle="collapse" href="#citation_finder_collapse" role="button" aria-expanded="false" aria-controls="collapseExample" > Citation finder</button> |
|
||||||
</div> |
|
||||||
<div class="collapse col-sm-10 p-2" id="citation_finder_collapse"> |
|
||||||
<%= text_field_tag :citation_finder, opts[:citation_finder], class: "form-control", placeholder: "Citation Finder", data: { target: "document.citation_finder" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<header class="header bg-white b-b clearfix"> |
|
||||||
<div class="row m-t-sm align-items-end pagination-body"> |
|
||||||
<div class="<%= documents.present? ? "col-md-6 mb-0 " : "col-md-12 mb-0"%> "> |
|
||||||
<h4 style="color: darkred" class="m-0">Search Results</h4> |
|
||||||
<small style="color: darkred"> |
|
||||||
<%= page_entries_info documents, entry_name: 'records' if documents.present? %> |
|
||||||
</small> |
|
||||||
</div> |
|
||||||
<div class="<%= documents.present? ? "col-md-6 position-relative" : "d-none"%>"> |
|
||||||
<div class="text-center pagination justify-content-end me-3"> |
|
||||||
<nav class="pagination pagination-sm" role="navigation" aria-label="pager"> |
|
||||||
<% unless documents.first_page? %> |
|
||||||
<span class="page-item first"> |
|
||||||
<a class="page-link" data-controller="document" data-q="<%= opts[:q] %>" data-page="<%= 1 %>" |
|
||||||
data-citation-finder="<%= opts[:citation_finder] %>" |
|
||||||
data-action="click->document#paginateDoctrineFormCaseLists"> |
|
||||||
<i class="fas fa-angle-double-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item prev"> |
|
||||||
<a class="page-link" data-controller="document" data-q="<%= opts[:q] %>" data-citation-finder="<%= opts[:citation_finder] %>" |
|
||||||
data-page="<%= opts[:current_page].to_i - 1 %>" data-action="click->document#paginateDoctrineFormCaseLists"> |
|
||||||
<i class="fas fa-angle-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
|
|
||||||
<% documents.total_pages.times do |page| -%> |
|
||||||
<% if (page + 1) <= (opts[:current_page].to_i + 4) && (page + 1) >= (opts[:current_page].to_i - 4) %> |
|
||||||
<% if opts[:current_page].to_i.eql?(page + 1) %> |
|
||||||
<span class="page-item page current page-link"> <%= page + 1 %> </span> |
|
||||||
<% else %> |
|
||||||
<span class="page-item page"> |
|
||||||
<a class="page-link" data-controller="document" data-q="<%= opts[:q] %>" data-citation-finder="<%= opts[:citation_finder] %>" |
|
||||||
data-page="<%= page + 1 %>" data-action="click->document#paginateDoctrineFormCaseLists"> |
|
||||||
<%= page + 1 %> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end -%> |
|
||||||
|
|
||||||
<% unless documents.last_page? %> |
|
||||||
<span class="page-item next"> |
|
||||||
<a class="page-link" data-controller="document" data-q="<%= opts[:q] %>" data-citation-finder="<%= opts[:citation_finder] %>" |
|
||||||
data-page="<%= opts[:current_page].to_i + 1 %>" data-action="click->document#paginateDoctrineFormCaseLists"> |
|
||||||
<i class="fas fa-angle-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item last"> |
|
||||||
<a class="page-link" data-controller="document" data-q="<%= opts[:q] %>" data-citation-finder="<%= opts[:citation_finder] %>" |
|
||||||
data-page="<%= documents.total_pages %>" data-action="click->document#paginateDoctrineFormCaseLists"> |
|
||||||
<i class="fas fa-angle-double-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
</nav> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</header> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
|
|
||||||
<tbody> |
|
||||||
<% documents.each do |document| %> |
|
||||||
<tr> |
|
||||||
<td style="width: 25%"> <%= document.clean_reference_number %> </td> |
|
||||||
<td style="width: 45%"> <%= document.short_title || document.title %> </td> |
|
||||||
<td style="width: 15%"> <%= document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year %> </td> |
|
||||||
<td> |
|
||||||
<% date_or_year = document.doc_date.strftime("%B %d, %Y") || document.year %> |
|
||||||
<% title = document.short_title || document.title %> |
|
||||||
<a class="btn btn-success btn-sm" data-bs-toggle="modal" data-bs-target="#annotationModal" data-controller="doctrines" |
|
||||||
data-document-id="<%= document.id %>" data-document-title="<%= title %>" data-document-reference-number="<%= document.clean_reference_number %>" |
|
||||||
data-document-date-or-year="<%= date_or_year %>" data-document-phil-rep="<%= document.phil_rep %>" |
|
||||||
data-action="click->doctrines#newAnnotation"> |
|
||||||
Add Annotation |
|
||||||
</a> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<% end %> |
|
||||||
</tbody> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
@ -1,101 +0,0 @@ |
|||||||
<div class="row" data-controller="doctrines"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, opts[:q], class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "doctrines.q" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-1 p-2"> |
|
||||||
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->doctrines#searchCitingDocuments" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<% if documents.present? %> |
|
||||||
<header class="header bg-white b-b clearfix"> |
|
||||||
<div class="row m-t-sm align-items-end pagination-body"> |
|
||||||
<div class="<%= documents.present? ? "col-md-6 mb-0 " : "col-md-12 mb-0"%> "> |
|
||||||
<h4 style="color: darkred" class="m-0">Search Results</h4> |
|
||||||
<small style="color: darkred"> |
|
||||||
<%= page_entries_info documents, entry_name: 'records' if documents.present? %> |
|
||||||
</small> |
|
||||||
</div> |
|
||||||
<div class="<%= documents.present? ? "col-md-6 position-relative" : "d-none"%>"> |
|
||||||
<div class="text-center pagination justify-content-end me-3"> |
|
||||||
<nav class="pagination pagination-sm" role="navigation" aria-label="pager"> |
|
||||||
<% unless documents.first_page? %> |
|
||||||
<span class="page-item first"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-q="<%= opts[:q] %>" data-page="<%= 1 %>" data-action="click->doctrines#paginateCitingDocuments"> |
|
||||||
<i class="fas fa-angle-double-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item prev"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-q="<%= opts[:q] %>" data-page="<%= opts[:current_page].to_i - 1 %>" data-action="click->doctrines#paginateCitingDocuments"> |
|
||||||
<i class="fas fa-angle-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
|
|
||||||
<% documents.total_pages.times do |page| -%> |
|
||||||
<% if (page + 1) <= (opts[:current_page].to_i + 4) && (page + 1) >= (opts[:current_page].to_i - 4) %> |
|
||||||
<% if opts[:current_page].to_i.eql?(page + 1) %> |
|
||||||
<span class="page-item page current page-link"> <%= page + 1 %> </span> |
|
||||||
<% else %> |
|
||||||
<span class="page-item page <%= 'current' if opts[:current_page].to_i.eql?(page + 1) %>"> |
|
||||||
<a class="page-link <%= 'current' if opts[:current_page].to_i.eql?(page + 1) %>" |
|
||||||
data-controller="doctrines" data-q="<%= opts[:q] %>" data-page="<%= page + 1 %>" |
|
||||||
data-action="click->doctrines#paginateCitingDocuments"> <%= page + 1 %> </a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end -%> |
|
||||||
|
|
||||||
<% unless documents.last_page? %> |
|
||||||
<span class="page-item next"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-q="<%= opts[:q] %>" |
|
||||||
data-page="<%= opts[:current_page].to_i + 1 %>" data-action="click->doctrines#paginateCitingDocuments"> |
|
||||||
<i class="fas fa-angle-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item last"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-q="<%= opts[:q] %>" |
|
||||||
data-page="<%= documents.total_pages %>" data-action="click->doctrines#paginateCitingDocuments"> |
|
||||||
<i class="fas fa-angle-double-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
</nav> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</header> |
|
||||||
<% end %> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
|
|
||||||
<tbody> |
|
||||||
<% documents.each do |document| %> |
|
||||||
<% date_or_year = document.doc_date.present? ? document.doc_date.strftime("%B %d, %Y") : document.year %> |
|
||||||
<tr> |
|
||||||
<td> <%= document.clean_reference_number %> </td> |
|
||||||
<td> <%= document.short_title || document.title %> </td> |
|
||||||
<td> <%= date_or_year %> </td> |
|
||||||
<td> |
|
||||||
<a class="btn btn-success" data-controller="doctrines" data-document-id="<%= document.id %>" |
|
||||||
data-document-reference-number="<%= document.clean_reference_number %>" |
|
||||||
data-document-date="<%= date_or_year %>" |
|
||||||
data-document-title="<%= document.short_title || document.title %>" |
|
||||||
data-action="click->doctrines#addCitingDocument" > |
|
||||||
Add |
|
||||||
</a> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<% end %> |
|
||||||
</tbody> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
<div class="row" data-controller="document"> |
|
||||||
<div class="col-sm-10 p-2"> |
|
||||||
<%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number, Title or Short Title", data: { target: "document.input" } %> |
|
||||||
</div> |
|
||||||
<div class="col-sm-2 p-2"> |
|
||||||
<%= button_tag "Search", class: "btn btn-success", data: { action: "click->document#searchDoctrineFormCaseLists" } %> |
|
||||||
<button class="btn btn-warning btn-sm text-white ms-3" data-bs-toggle="collapse" href="#citation_finder_collapse" role="button" aria-expanded="false" aria-controls="collapseExample" > Citation finder</button> |
|
||||||
</div> |
|
||||||
<div class="collapse col-sm-10 p-2" id="citation_finder_collapse"> |
|
||||||
<%= text_field_tag :citation_finder, nil, class: "form-control", placeholder: "Citation Finder", data: { target: "document.citation_finder" } %> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="row tab"> |
|
||||||
<table class="table table-striped table-hover mb-0" style="width: 98%; margin: 0 auto;"> |
|
||||||
<thead> |
|
||||||
<th class="bg-light"> Reference No. </th> |
|
||||||
<th class="bg-light"> Title </th> |
|
||||||
<th class="bg-light"> Date </th> |
|
||||||
<th class="bg-light"> </th> |
|
||||||
</thead> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
@ -1,59 +0,0 @@ |
|||||||
<header class="header bg-white b-b clearfix m-2"> |
|
||||||
<div class="row m-t-sm align-items-end pagination-body"> |
|
||||||
<div class="<%= doctrines.present? ? "col-md-6 mb-0 " : "col-md-12 mb-0"%> "> |
|
||||||
<small style="color: darkred"> |
|
||||||
<%= page_entries_info doctrines, entry_name: 'records' if doctrines.present? %> |
|
||||||
</small> |
|
||||||
</div> |
|
||||||
<div class="<%= doctrines.present? ? "col-md-6 position-relative" : "d-none"%>"> |
|
||||||
<div class="text-center pagination justify-content-end me-3"> |
|
||||||
<nav class="pagination pagination-sm" role="navigation" aria-label="pager"> |
|
||||||
<% unless doctrines.first_page? %> |
|
||||||
<span class="page-item first"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-document-id="<%= opts[:document_id] %>" |
|
||||||
data-page="<%= 1 %>" data-action="click->doctrines#paginate"> |
|
||||||
<i class="fas fa-angle-double-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item prev"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-document-id="<%= opts[:document_id] %>" |
|
||||||
data-page="<%= opts[:current_page].to_i - 1 %>" data-action="click->doctrines#paginate"> |
|
||||||
<i class="fas fa-angle-left"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
|
|
||||||
<% doctrines.total_pages.times do |page| -%> |
|
||||||
<% if (page + 1) <= (opts[:current_page].to_i + 4) && (page + 1) >= (opts[:current_page].to_i - 4) %> |
|
||||||
<% if opts[:current_page].to_i.eql?(page + 1) %> |
|
||||||
<span class="page-item page current page-link"> <%= page + 1 %> </span> |
|
||||||
<% else %> |
|
||||||
<span class="page-item page"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-document-id="<%= opts[:document_id] %>" |
|
||||||
data-page="<%= page + 1 %>" data-action="click->doctrines#paginate"> <%= page + 1 %> </a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end -%> |
|
||||||
|
|
||||||
<% unless doctrines.last_page? %> |
|
||||||
<span class="page-item next"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-document-id="<%= opts[:document_id] %>" |
|
||||||
data-page="<%= opts[:current_page].to_i + 1 %>" data-action="click->doctrines#paginate"> |
|
||||||
<i class="fas fa-angle-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
|
|
||||||
<span class="page-item last"> |
|
||||||
<a class="page-link" data-controller="doctrines" data-document-id="<%= opts[:document_id] %>" |
|
||||||
data-page="<%= doctrines.total_pages %>" data-action="click->doctrines#paginate"> |
|
||||||
<i class="fas fa-angle-double-right"></i> |
|
||||||
</a> |
|
||||||
</span> |
|
||||||
<% end %> |
|
||||||
</nav> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</header> |
|
||||||
@ -1,4 +0,0 @@ |
|||||||
<div class="container-sm row-flex col-sm-12 p-0 doct-body-index" id="documentDoctrinesIndex"> |
|
||||||
<%= render(partial: "/shared/doctrines_pagination", locals: { doctrines: doctrines, opts: opts }) %> |
|
||||||
<%= render(DocumentDoctrineIndexComponent.with_collection(doctrines, current_user: current_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6m/Q3wQfrOWai/8v8HKevqdmzMJvivAy5fPtsR2kJkvECPK0Io1a5IHv434gw5f7PcGzlGOEk3XArA7XxeyNmLK7wzGW74Topvi+Zqtk25JqE7Z4Nkkv4y4o4ctkvBRj2ExzZg21wQD9giLaANcb8Hj+sk0HNOgRbZ13aOepHiJX2lMGsS7x2PBpk56B3qMogxrEbdNgQdxXXBtW1HNeyc+z9kZRgsHyRxDDG+9glj9FdUmDBobbdxigvLaWAFIBCDIlKIH3Rtv/MAz/0lnE9PSPqn13QfC8KMyI3RzpNcR6NrKxZiLWMEy6Oex220hQOFfbepHLNkLIUm9IKqysdYwa32anKvyg34YQ6vE7XEEui1L4aKWNq2Vb7CSF1JreJSB21zW8FC5uSh3QD/AKPWAyF7reVIBIjW7VsApEL6R8s2ou0RBkIMyhtXyDDUOzez6GEu4caUeSNOCjp4vsSZwXEzBSOz0rzCVyJPMBGiIsaMGDZ02vbBwSVDVV/rhzCuVpBKEiMcjzDFc9QHwhD7gCy1mtvP6gQmWLUiDP9Y+8A6okKcxB6gDAKHzdJXGAJGYnktqGdHMYpQ0feE0N+umG7wyEaBW0YJAIQYR6KR8OSMy+6Rg43iQRXXiOgBcU0uIQa7JyVQdysQX4fhW1UZII4Syu65tfi75NETpqWbDxnp6xvw7LpQ==--a6ISTZpt8qbI/E2O--VsALKCGxTmuK5s0bBfOhog== |
||||||
@ -1,14 +0,0 @@ |
|||||||
OkComputer.mount_at = "health" |
|
||||||
OkComputer.require_authentication(*ENV["HEALTHCHECK_AUTH"].to_s.split(":")) if ENV["HEALTHCHECK_AUTH"].present? |
|
||||||
|
|
||||||
OkComputer::OkComputerController.class_eval do |
|
||||||
force_ssl except: :index if ENV["HEALTHCHECK_SSL"] == true |
|
||||||
end |
|
||||||
|
|
||||||
OkComputer::Registry.register "solr", OkComputer::SolrCheck.new(ENV["SOLR_URL"]) |
|
||||||
OkComputer::Registry.register "redis", OkComputer::RedisCheck.new(url: ENV["REDIS_URL"]) |
|
||||||
|
|
||||||
if ActionMailer::Base.smtp_settings[:address].present? |
|
||||||
OkComputer::Registry.register "mailer", OkComputer::ActionMailerCheck.new(ActionMailer::Base) |
|
||||||
OkComputer.make_optional %w(mailer) |
|
||||||
end |
|
||||||
|
@ -1,5 +0,0 @@ |
|||||||
class AddContentInAnnotation < ActiveRecord::Migration[6.1] |
|
||||||
def change |
|
||||||
add_column :annotations, :content, :text, default: "", null: false |
|
||||||
end |
|
||||||
end |
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue