+ <%= form_tag(doctrine_form_url, method: :patch) do %>
+
+ <%= label_tag :subject_indexes %>
+ <%= select_tag "subject_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, subject_ids), class: "form-select i-chosen", multiple: true, prompt: "Please select" %>
+
+
+
+
+ <%= label_tag :content %>
+ <%= text_area_tag :content, content, class: "i-ckeditor form-control", placeholder: "Doctrine" %>
+
+
+
+
+
+ <%= submit_tag "Update Doctrine", class: "btn btn-primary" %>
+
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <%= text_field_tag :q, nil, class: "form-control", placeholder: "Search GR Number" %>
+
+
+
+ <%= button_tag "search", class: "btn btn-primary" %>
+
+
+
+
+
+
+ | Reference No. |
+ Date |
+ Title |
+ |
+
+
+
+ <%= render(DocumentIndexTableComponent.with_collection(Cdao::Jurisprudence.first(5), current_user: current_user, opts: { is_case_lists: true, form_url: annotation_form_url, document_id: document_id })) %>
+
+
+
+
+
+ <%= form_tag(annotation_form_url, method: :patch) do %>
+
+ <%= label_tag :annotation %>
+ <%%= hidden_tag :document_id, doctrine >
+ <%= text_area_tag :content, content, class: "i-ckeditor form-control", placeholder: "Doctrine" %>
+
+ <%end%>
+
+
\ No newline at end of file
diff --git a/app/components/document_index_table_component.rb b/app/components/document_index_table_component.rb
index 0e7dd2c..3acb933 100644
--- a/app/components/document_index_table_component.rb
+++ b/app/components/document_index_table_component.rb
@@ -2,8 +2,9 @@ class DocumentIndexTableComponent < BaseComponent
with_collection_parameter :search_result
attr_reader :search_result, :opts
- def initialize(search_result:, current_user:)
+ def initialize(search_result:, current_user:, opts:)
@search_result = search_result
+ @opts = opts
end
delegate :reference_number, to: :search_result
diff --git a/app/components/document_index_table_component/document_index_table_component.html.erb b/app/components/document_index_table_component/document_index_table_component.html.erb
index 8dd4d3e..d1d0b71 100644
--- a/app/components/document_index_table_component/document_index_table_component.html.erb
+++ b/app/components/document_index_table_component/document_index_table_component.html.erb
@@ -1,6 +1,56 @@
-
| <%= reference_number %> |
<%= title %> |
<%= date_or_year %> |
- |
+ <% if opts[:is_case_lists].present? && opts[:form_url].present? && opts[:document_id].present? %>
+
+
+
+
+
+
+ |
+ <% end %>
diff --git a/app/controllers/doctrine/annotations_controller.rb b/app/controllers/doctrine/annotations_controller.rb
index 992f805..f607911 100644
--- a/app/controllers/doctrine/annotations_controller.rb
+++ b/app/controllers/doctrine/annotations_controller.rb
@@ -9,7 +9,7 @@ class Doctrine::AnnotationsController < ApplicationController
@annotation = @doctrine.annotations.new(attrs)
if document_id.present?
- @annotation.document = Cdao::Jurisprudence.find(attrs.delete(:document_id))
+ @annotation.document = Cdao::Jurisprudence.find(document_id)
end
respond_to do |format|
diff --git a/app/controllers/jurisprudence/doctrines_controller.rb b/app/controllers/jurisprudence/doctrines_controller.rb
index b7b7646..0e99435 100644
--- a/app/controllers/jurisprudence/doctrines_controller.rb
+++ b/app/controllers/jurisprudence/doctrines_controller.rb
@@ -6,7 +6,7 @@ class Jurisprudence::DoctrinesController < ApplicationController
attrs = resource_params.to_unsafe_h.deep_symbolize_keys
subject_ids = attrs.delete(:subject_ids)
- @doctrine = @jurisprudence.doctrines(attrs)
+ @doctrine = @jurisprudence.doctrines.new(attrs)
respond_to do |format|
if @doctrine.save
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index e690518..1528cea 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -16,6 +16,7 @@ import "@fortawesome/fontawesome-free/js/all.min";
import "@fortawesome/fontawesome-free/css/all.min";
import "moment";
import "select2";
+import "chosen-js"
window.jQuery = $;
window.$ = $;
@@ -40,8 +41,11 @@ $(document).ready(function () {
$(".clickable-tr").on("click", function () {
let $href = $(this).attr("href");
+ console.log("$href")
if ($href !== undefined) {
window.open($href);
}
})
+
+ $(".i-chosen").chosen({width: "100%"});
});
diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb
index 90890a7..b81b0be 100644
--- a/app/views/documents/index.html.erb
+++ b/app/views/documents/index.html.erb
@@ -21,8 +21,9 @@