6 changed files with 90 additions and 68 deletions
@ -1,32 +1,56 @@ |
|||||||
<div class="container-fluid p-0"> |
<div class="row-flex m-3 mt-0 doctrine-content-body"> |
||||||
<% document_title = jurisprudence.short_title || jurisprudence.title %> |
<div class="container-sm <%= params[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
||||||
<% date_or_year = jurisprudence.doc_date.present? ? jurisprudence.doc_date.strftime("%B %d, %Y") : jurisprudence.year %> |
<% search_results.uniq(&:headnote).each do |uniq_by_headnote| %> |
||||||
|
<h5> <%= uniq_by_headnote.headnote %> </h5> |
||||||
|
|
||||||
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(jurisprudence.document.id, is_index_table: false, subject_ids: params[:subject_ids]) %>"> <%= [document_title, jurisprudence.clean_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| %> |
||||||
<% annotated_documents_title = [] %> |
<% group_by_content.results.each do |content_result| %> |
||||||
<% annotation.documents.each do |annotated_document| %> |
<div class="mb-0"> <%= raw content_result.content.html_safe %> </div> |
||||||
<% 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 %> |
<% grouped_by_juris_search_params = { subject_ids: opts[:subject_ids], content: content_result.content, is_grouped_by_juris_id: true } %> |
||||||
<% annotated_documents_title << [" citing #{ad_title}", annotated_document.clean_reference_number, ad_date_or_year].join(", ") %> |
<% search_doctrines(grouped_by_juris_search_params).group(:jurisprudence_id).groups.each do |grouped_by_juris| %> |
||||||
<% end %> |
<% grouped_by_juris.results.each do |juris_result| %> |
||||||
<% 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 %> |
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(juris_result.jurisprudence.document.id, is_index_table: false, subject_ids: params[:subject_ids]) %>"> |
||||||
|
<% 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"> |
<div class="row mb-2 pb-0 ms-3"> |
||||||
<div class="col-sm-1 p-0 me-1" style="width: auto;"> <strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> </div> |
<div class="col-sm-1 p-0 me-1" style="width: auto;"> <strong> <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> </strong> </div> |
||||||
<div class="col-sm-9 p-0 ms-1"> <%= raw annotation.content.present? ? content_diplay_text(annotation) : citing_document_title %> </div> |
<div class="col-sm-9 p-0 ms-1"> <%= raw annotation.content.present? ? content_diplay_text(annotation) : citing_document_title %> </div> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<% if annotation.editor_notes.present? %> |
<% if annotation.editor_notes.present? %> |
||||||
<div class="row ms-5 mb-2"> |
<div class="row ms-5 mb-2"> |
||||||
<div class="col-sm-2 p-0" style="width: 105px;"> |
<div class="col-sm-2 p-0" style="width: 105px;"> |
||||||
<span> Editors 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> |
||||||
|
<hr/> |
||||||
</div> |
</div> |
||||||
|
|||||||
@ -1,20 +1,6 @@ |
|||||||
<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: @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: @search_results, 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"/> |
||||||
<% @uniq_by_headnotes.each do |uniq_by_headnote| %> |
|
||||||
<div class="row-flex m-3 mt-0 doctrine-content-body"> |
<%= 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="container-sm <%= params[:is_subjects_index].present? ? 'm-0 ps-0' : '' %>"> |
|
||||||
<h5> <%= uniq_by_headnote.headnote %> </h5> |
|
||||||
|
|
||||||
<% uniq_by_contents = @results.map { |doctrine| doctrine if doctrine.headnote.eql?(uniq_by_headnote.headnote) }.uniq(&:content) %> |
|
||||||
<% uniq_by_contents.each do |uniq_by_content| %> |
|
||||||
<div class="mb-0"> <%= raw uniq_by_content.content.html_safe %> </div> |
|
||||||
<% doctrines = @results.map { |doctrine| doctrine if doctrine.headnote.eql?(uniq_by_headnote.headnote) && doctrine.content.eql?(uniq_by_content.content) } %> |
|
||||||
<%= render(DoctrineIndexComponent.with_collection(doctrines, current_user: current_user, opts: { is_index_table: false, subject_ids: params[:subject_ids].map(&:to_i) })) %> |
|
||||||
<% end %> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
</div> |
|
||||||
<% end %> |
|
||||||
</div> |
</div> |
||||||
|
|||||||
Loading…
Reference in new issue