Browse Source

Add `headnote` in `doctrines#index` component

pull/96/head
alexdbondoc17 4 years ago
parent
commit
f4657de4b9
  1. 1
      app/components/doctrine_index_component.rb
  2. 4
      app/components/doctrine_index_component/doctrine_index_component.html.erb
  3. 1
      app/components/document_doctrine_index_component.rb
  4. 3
      app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb

1
app/components/doctrine_index_component.rb

@ -12,6 +12,7 @@ class DoctrineIndexComponent < BaseComponent
delegate :content, to: :doctrine
delegate :annotations, to: :doctrine
delegate :subjects, to: :doctrine
delegate :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url

4
app/components/doctrine_index_component/doctrine_index_component.html.erb

@ -5,8 +5,10 @@
<div class="container-fluid p-0">
<% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(jurisprudence, is_index_table: false, subject_ids: params[:subject_ids]) %>"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5>
<p class="fw-bold fst-normal"> <%= headnote %> </p>
<h5 class="clickable-link" style="color: darkred;" href="<%= document_path(jurisprudence, is_index_table: false, subject_ids: params[:subject_ids]) %>"> <%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %> </h5>
<% annotations.each do |annotation| %>
<p class="mb-2 ms-3 clickable-link" href="<%= show_url %>">
<% annotated_documents_title = [] %>

1
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 :headnote, to: :doctrine
delegate :doctrine_jurisprudences, to: :doctrine
def annotation_form_url

3
app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb

@ -17,6 +17,9 @@
<p class="mb-0"> <%= raw content.html_safe %> </p>
<div class="container-fluid p-0">
<p class="fw-bold fst-normal"> <%= headnote %> </p>
<% if opts[:is_doctrines_index].present? %>
<% document_title = jurisprudence.short_title || jurisprudence.title %>
<% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.to_date.strftime("%B %d, %Y") : jurisprudence.year %>

Loading…
Cancel
Save