11 changed files with 165 additions and 15 deletions
@ -0,0 +1,10 @@ |
|||||||
|
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 |
||||||
|
|
||||||
@ -0,0 +1,32 @@ |
|||||||
|
<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, nil, data: { target: "doctrines.doctrine_id" } %> |
||||||
|
<select class="form-control subject-ids-selectize ps-0" name="subject_ids[]" id="subject_ids_" multiple="true" required> </select> |
||||||
|
<div class="invalid-feedback" id="subjects-blank-message"> Subject/s cannot be blank. </div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<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> |
||||||
|
|
||||||
|
<div class="row"> |
||||||
|
<div class="col-sm-12"> |
||||||
|
<label for="subject-name" class="col-form-label">Head Note</label> |
||||||
|
<%= text_field_tag :headnote, nil, 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, nil, placeholder: "Doctrine Content", required: true, data: { target: "doctrines.content" } %> |
||||||
|
<div class="invalid-feedback" id="content-blank-message"> Content cannot be blank. </div> |
||||||
|
<div> |
||||||
|
</div> |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
<div class="container-fluid mt-2 p-0"> |
||||||
|
<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" id="doctrineForm"> |
||||||
|
<%= render(DoctrineFormComponent.new(current_user: current_user, doctrine: @doctrine)) %> |
||||||
|
</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> |
||||||
|
<button type="button" class="btn btn-danger ms-2" data-bs-dismiss="modal">Back</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
<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])) %> |
||||||
|
</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[:jurisprudence_id]) %>">Back</a> |
||||||
|
<% end %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
@ -0,0 +1,64 @@ |
|||||||
|
|
||||||
|
<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_notes %> </strong> |
||||||
|
<%= rich_text_area_tag :editor_notes, nil, placeholder: "Editor Notes" %> |
||||||
|
</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(jurisprudence.id, doctrine_id) %>">Back</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
Loading…
Reference in new issue