diff --git a/app/components/annotation_marks_modal_form_component.rb b/app/components/annotation_marks_modal_form_component.rb
index de475c8..ce2e379 100644
--- a/app/components/annotation_marks_modal_form_component.rb
+++ b/app/components/annotation_marks_modal_form_component.rb
@@ -17,6 +17,18 @@ class AnnotationMarksModalFormComponent < BaseComponent
[document.title, document.reference_number, document_date_or_year].reject(&:blank?).join(", ")
end
+ def citing_documents_reference_numbers
+ return if annotation.documents.blank?
+
+ annotation.documents.map(&:reference_number).join(" citing ")
+ end
+
+ def citing_document_ids
+ return if annotation.documents.blank?
+
+ annotation.documents.map(&:id).join(",")
+ end
+
def render?
opts[:form_url].present? && opts[:form_method].present?
end
diff --git a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
index 094bd72..73677f7 100644
--- a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
+++ b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
@@ -11,6 +11,7 @@
<%= label_tag :annotation_marks %>
<%= hidden_field_tag :document_id, document.id %>
+ <%= hidden_field_tag :document_ids, citing_document_ids %>
<%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all, :id, :name, annotation.annomark_ids), class: "form-select default-selectize", multiple: true, prompt: "Please select" %>
@@ -18,14 +19,7 @@
<%= label_tag :document_title %>
- <%= text_area_tag :document_title, document_title, class: "form-control selected-citing-docs" %>
-
-
-
-
-
- Selected Citing Documents
- <%= select_tag "document_ids[]", [], class: "form-select selected-citing-docs default-selectize", multiple: true %>
+ <%= text_area_tag :document_title, [document_title, citing_documents_reference_numbers].reject(&:blank?).join(" "), class: "form-control selected-citing-docs" %>
@@ -54,8 +48,8 @@
-
-
<%= label_tag :phil_rep %>
+
+ <%= label_tag :phil_rep %>
<%= text_field_tag :phil_rep, annotation.phil_rep, class: "form-control" %>
diff --git a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
index 6f31dce..f55fe6f 100644
--- a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
+++ b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
@@ -18,7 +18,7 @@
<%= label_tag :content %>
- <%= rich_text_area_tag :content, doctrine.content, placeholder: "Doctrine Content" %>
+ <%= rich_text_area_tag :content, doctrine.content, placeholder: "Doctrine Content", data: { controller: "document", target: "document.input", action: "keyup->document#suggestDoctrine" } %>
diff --git a/app/components/document_doctrine_index_component.rb b/app/components/document_doctrine_index_component.rb
index 3a84c62..2e182ac 100644
--- a/app/components/document_doctrine_index_component.rb
+++ b/app/components/document_doctrine_index_component.rb
@@ -26,6 +26,18 @@ class DocumentDoctrineIndexComponent < BaseComponent
"(No Subjects Provided)"
end
+ def document_title(annotation)
+ return annotation.document.short_title if annotation.document.short_title.present?
+
+ annotation.document.title
+ end
+
+ def date_or_year(annotation)
+ return annotation.document.docdate.to_date.strftime("%B %d, %Y") if annotation.document.docdate.present?
+
+ annotation.document.year
+ end
+
def render?
doctrine.present? && doctrine.persisted?
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
index 2a9b7f4..53c8f85 100644
--- 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
@@ -18,7 +18,7 @@
<% annotations.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].reject(&:blank?).join(', ') %>
+ <%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep].reject(&:blank?).join(', ') %>
<% if annotation.editor_notes.present? %>
diff --git a/app/components/document_doctrine_show_component.rb b/app/components/document_doctrine_show_component.rb
index 8a45818..cfe2b35 100644
--- a/app/components/document_doctrine_show_component.rb
+++ b/app/components/document_doctrine_show_component.rb
@@ -26,4 +26,16 @@ class DocumentDoctrineShowComponent < BaseComponent
def annotation_form_url
doctrine_annotations_path(doctrine_id: id,)
end
+
+ def document_title(annotation)
+ return annotation.document.short_title if annotation.document.short_title.present?
+
+ annotation.document.title
+ end
+
+ def date_or_year(annotation)
+ return annotation.document.docdate.to_date.strftime("%B %d, %Y") if annotation.document.docdate.present?
+
+ annotation.document.year
+ 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
index cd34042..b499c8e 100644
--- 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
@@ -18,14 +18,22 @@
-
<%= label_tag :subjects %>
- <%= select_tag "subjects_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, subject_ids), class: "form-select default-selectize", multiple: true, prompt: "Please select", readonly: true %>
+
+ Subjects:
+
+
+
+ <%= subjects.map(&:lineage_name).join(" & ") %>
+
-
-
<%= label_tag :content %>
- <%= rich_text_area_tag :content, content, placeholder: "Doctrine Content", readonly: true %>
+
+ Content:
+
+
+
+ <%= raw content %>
@@ -72,6 +80,7 @@
<%= label_tag :annotation_marks %>
<%= hidden_field_tag :document_id, nil %>
+ <%= hidden_field_tag :document_ids, nil %>
<%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all, :id, :name), class: "form-select default-selectize", multiple: true, prompt: "Please select" %>
@@ -117,7 +126,7 @@
<%= label_tag :editor_notes %>
-
+
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 045cfc6..047c6af 100644
--- a/app/components/subject_accordion_component/subject_accordion_component.html.erb
+++ b/app/components/subject_accordion_component/subject_accordion_component.html.erb
@@ -1,15 +1,15 @@
<% parent.children.each do |sub1| %>