5 changed files with 157 additions and 21 deletions
@ -0,0 +1,16 @@ |
|||||||
|
# frozen_string_literal: true |
||||||
|
|
||||||
|
class DoctrinesReflex < ApplicationReflex |
||||||
|
include DoctrineSearch |
||||||
|
|
||||||
|
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 |
||||||
|
end |
||||||
@ -1 +1,72 @@ |
|||||||
<%= render AnnotationMarksModalFormComponent.new(current_user: current_user, opts: { is_show: true }) %> |
<div class="modal-dialog modal-lg modal-dialog-scrollable" data-controller="doctrines selectize"> |
||||||
|
<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 :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_notes %> </strong> |
||||||
|
<%= rich_text_area_tag :editor_notes, nil, placeholder: "Editor Notes" %> |
||||||
|
</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-document-id="<%= document.id %>" data-doctrine-id="<%= doctrine_id %>" |
||||||
|
data-action="click->doctrines#closeDoctrineAnnotationModalForm">Close</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|||||||
Loading…
Reference in new issue