diff --git a/app/components/doctrine_index_table_component.rb b/app/components/doctrine_index_table_component.rb index be454d2..27b37da 100644 --- a/app/components/doctrine_index_table_component.rb +++ b/app/components/doctrine_index_table_component.rb @@ -6,6 +6,12 @@ class DoctrineIndexTableComponent < BaseComponent @opts = opts end + def jurisprudence(search_result) + return "(No Assigned Document)" if search_result.doctrine_jurisprudences.blank? + + search_result.doctrine_jurisprudences.first.jurisprudence + end + def document_reference_number(document) document.reference_number end diff --git a/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb b/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb index 676ab1a..f884981 100644 --- a/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb +++ b/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb @@ -7,11 +7,11 @@ <% search_results.each do |search_result| %> - - <%= document_reference_number(search_result.document) %> - <%= document_title(search_result.document) %> - <%= date_or_year(search_result.document) %> + + <%= document_reference_number(jurisprudence(search_result)) %> + <%= document_title(jurisprudence(search_result)) %> + <%= date_or_year(jurisprudence(search_result)) %> <% end %> - \ No newline at end of file + 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 1715641..de157f1 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 @@ -19,6 +19,11 @@ +
+ + <%= text_field_tag :headnote, nil, class: "form-control", placeholder: "Head note", data: { target: "doctrines.headnote" } %> +
+
<%= rich_text_area_tag :content, nil, placeholder: "Doctrine Content", data: { target: "doctrines.content" } %> diff --git a/app/components/document_doctrine_index_component.rb b/app/components/document_doctrine_index_component.rb index e62e32c..663b5bc 100644 --- a/app/components/document_doctrine_index_component.rb +++ b/app/components/document_doctrine_index_component.rb @@ -12,6 +12,7 @@ class DocumentDoctrineIndexComponent < BaseComponent delegate :content, to: :doctrine delegate :annotations, to: :doctrine delegate :subjects, to: :doctrine + delegate :doctrine_jurisprudences, to: :doctrine def annotation_form_url doctrine_annotations_path(doctrine_id: id) @@ -21,6 +22,12 @@ class DocumentDoctrineIndexComponent < BaseComponent "(No Subjects Provided)" end + def jurisprudence + return nil if doctrine_jurisprudences.blank? + + doctrine_jurisprudences.first.jurisprudence + end + def document_title(annotation) return annotation.document.short_title if annotation.document.short_title.present? 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 1e90379..8d8257d 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 @@ -1,4 +1,4 @@ -