+
<%= form_tag(opts[:form_url], method: opts[:form_method]) do %>
-
-
- <%= select_tag "subject_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, params[:subject_ids]), class: "form-select i-chosen", multiple: true, prompt: "Please select" %>
+ <%= label_tag :subjects %>
+ <%= select_tag "subject_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, doctrine.subject_ids), class: "form-select i-chosen", multiple: true, prompt: "Please select" %>
- <%= text_area_tag :content, params[:content], class: "i-ckeditor form-control", placeholder: "Doctrine" %>
+ <%= label_tag :content %>
+ <%= text_area_tag :content, doctrine.content, class: "i-ckeditor form-control", placeholder: "Doctrine" %>
diff --git a/app/components/doctrine_show_component.rb b/app/components/doctrine_show_component.rb
deleted file mode 100644
index 9939351..0000000
--- a/app/components/doctrine_show_component.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class DoctrineShowComponent < BaseComponent
- with_collection_parameter :search_result
- attr_reader :doctrine, :current_user
-
- def initialize(doctrine:, current_user:)
- @doctrine = doctrine
- @current_user = current_user
- end
-end
\ No newline at end of file
diff --git a/app/components/doctrine_show_component/doctrine_show_component.html.erb b/app/components/doctrine_show_component/doctrine_show_component.html.erb
deleted file mode 100644
index 7dee1f8..0000000
--- a/app/components/doctrine_show_component/doctrine_show_component.html.erb
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
- <%= 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/doctrine_index_component.rb b/app/components/document_doctrine_index_component.rb
similarity index 77%
rename from app/components/doctrine_index_component.rb
rename to app/components/document_doctrine_index_component.rb
index 9978825..d5a8693 100644
--- a/app/components/doctrine_index_component.rb
+++ b/app/components/document_doctrine_index_component.rb
@@ -1,4 +1,4 @@
-class DoctrineIndexComponent < BaseComponent
+class DocumentDoctrineIndexComponent < BaseComponent
with_collection_parameter :doctrine
attr_reader :doctrine
@@ -10,6 +10,8 @@ class DoctrineIndexComponent < BaseComponent
delegate :subject_ids, to: :doctrine
delegate :content, to: :doctrine
delegate :document_id, to: :doctrine
+ delegate :annotations, to: :doctrine
+ delegate :subjects, to: :doctrine
def doctrine_form_url
jurisprudence_doctrines_path(jurisprudence_id: document_id)
@@ -18,8 +20,4 @@ class DoctrineIndexComponent < BaseComponent
def annotation_form_url
doctrine_annotations_path(doctrine_id: id)
end
-
- def doctrine_subjects
- doctrine_subjects.group(:subject_id)
- end
-end
\ No newline at end of file
+end
diff --git a/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
new file mode 100644
index 0000000..7a7adb4
--- /dev/null
+++ b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb
@@ -0,0 +1,23 @@
+<% if id.present? %>
+
+<% end %>
diff --git a/app/components/document_doctrine_show_component.rb b/app/components/document_doctrine_show_component.rb
new file mode 100644
index 0000000..0d4de2b
--- /dev/null
+++ b/app/components/document_doctrine_show_component.rb
@@ -0,0 +1,28 @@
+class DocumentDoctrineShowComponent < BaseComponent
+ attr_reader :current_user, :doctrine
+
+ def initialize(current_user:, doctrine:, opts: {})
+ @doctrine = doctrine
+ @current_user = current_user
+ end
+
+ delegate :id, to: :doctrine
+ delegate :subject_ids, to: :doctrine
+ delegate :content, to: :doctrine
+ delegate :document_id, to: :doctrine
+ delegate :document, to: :doctrine
+ delegate :annotations, to: :doctrine
+ delegate :subjects, to: :doctrine
+
+ def doctrine_form_url
+ jurisprudence_doctrines_path(jurisprudence_id: document_id)
+ end
+
+ def edit_doctrine_form_url
+ jurisprudence_doctrines_path(jurisprudence_id: document_id, id: id)
+ end
+
+ def annotation_form_url
+ doctrine_annotations_path(doctrine_id: id)
+ end
+end
\ No newline at end of file
diff --git a/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
new file mode 100644
index 0000000..13bf732
--- /dev/null
+++ b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+ <%= render(DoctrineModalFormComponent.new(current_user: current_user, doctrine: doctrine, opts: { form_url: jurisprudence_doctrine_path(jurisprudence_id: document_id, id: doctrine.id), form_method: "PUT" })) %>
+
+
+
+ <%= form_tag(doctrine_form_url, method: :patch) do %>
+
+ <%= label_tag :subjects %>
+ <%= 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" %>
+
+
+ <% 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, form_method: :post, document_id: document_id })) %>
+
+
+
+
+
+
+
+
+ <% doctrine.annotations.order(rank: :asc).each do |annotation| %>
+
+
+ <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %>
+ <%= raw [annotation.document.title, annotation.document.reference_number, annotation.document.docdate.strftime("%B %d, %Y"), annotation.phil_rep].join(', ').html_safe %>
+
+
+
+
+ <% if annotation.editor_notes.present? %>
+
Editors Note: <%= annotation.editor_notes %>
+ <% end %>
+
+
+
+
+ <%= render AnnotationMarksModalFormComponent.new(current_user: current_user, document: document, annotation: annotation, opts: { form_url: doctrine_annotation_path(id, annotation.id), form_method: "PUT" }) %>
+
+
+ <% 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 3acb933..efaf596 100644
--- a/app/components/document_index_table_component.rb
+++ b/app/components/document_index_table_component.rb
@@ -2,7 +2,7 @@ class DocumentIndexTableComponent < BaseComponent
with_collection_parameter :search_result
attr_reader :search_result, :opts
- def initialize(search_result:, current_user:, opts:)
+ def initialize(search_result:, current_user:, opts: {})
@search_result = search_result
@opts = opts
end
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 d1d0b71..6fc926e 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
@@ -4,15 +4,19 @@
<%= date_or_year %> |
<% if opts[:is_case_lists].present? && opts[:form_url].present? && opts[:document_id].present? %>
-
+
- |
<% end %>
diff --git a/app/components/pagination_component/pagination_component.html.erb b/app/components/pagination_component/pagination_component.html.erb
index 2ee82ea..a6d0775 100644
--- a/app/components/pagination_component/pagination_component.html.erb
+++ b/app/components/pagination_component/pagination_component.html.erb
@@ -8,7 +8,7 @@
-
+
diff --git a/app/components/sidenav_component/sidenav_component.html.erb b/app/components/sidenav_component/sidenav_component.html.erb
index 0310eef..9d6ce0f 100644
--- a/app/components/sidenav_component/sidenav_component.html.erb
+++ b/app/components/sidenav_component/sidenav_component.html.erb
@@ -1,29 +1,29 @@
<% if @current_user.present? %>
<% end %>
diff --git a/app/components/subject_accordion_component/subject_accordion_component.html.erb b/app/components/subject_accordion_component/subject_accordion_component.html.erb
index ef96ed5..0242d25 100644
--- a/app/components/subject_accordion_component/subject_accordion_component.html.erb
+++ b/app/components/subject_accordion_component/subject_accordion_component.html.erb
@@ -2,7 +2,7 @@
">
- <%= link_to second_subject.name, subject_index_path(second_subject.id), class: "accordion-link" %>
+ <%= link_to second_subject.name, subject_index_path(second_subject.id), class: "clickable-link" %>
" data-bs-parent="#secondLevelPanel<%= second_subject.id %>">
@@ -11,7 +11,7 @@
">
- <%= link_to third_subject.name, subject_index_path(third_subject.id), class: "accordion-link" %>
+ <%= link_to third_subject.name, subject_index_path(third_subject.id), class: "clickable-link" %>
" data-bs-parent="#thirdLevelPanel<%= third_subject.id %>">
@@ -20,7 +20,7 @@
">
- <%= link_to fourth_subject.name, subject_index_path(fourth_subject.id), class: "accordion-link" %>
+ <%= link_to fourth_subject.name, subject_index_path(fourth_subject.id), class: "clickable-link" %>
" data-bs-parent="#fourthLevelPanel<%= fourth_subject.id %>">
@@ -29,7 +29,7 @@
- <%= link_to fifth_subject.name, subject_index_path(fifth_subject.id), class: "accordion-link" %>
+ <%= link_to fifth_subject.name, subject_index_path(fifth_subject.id), class: "clickable-link" %>
diff --git a/app/components/subjects_sidenav_sub_menu_component/subjects_sidenav_sub_menu_component.html.erb b/app/components/subjects_sidenav_sub_menu_component/subjects_sidenav_sub_menu_component.html.erb
index 94a624c..a17ccd5 100644
--- a/app/components/subjects_sidenav_sub_menu_component/subjects_sidenav_sub_menu_component.html.erb
+++ b/app/components/subjects_sidenav_sub_menu_component/subjects_sidenav_sub_menu_component.html.erb
@@ -3,72 +3,88 @@
<% Cdao::Subject.roots.each do |root| %>