5 changed files with 33 additions and 11 deletions
@ -0,0 +1,23 @@ |
|||||||
|
class CitationIndexTableComponent < BaseComponent |
||||||
|
with_collection_parameter :search_result |
||||||
|
attr_reader :search_result, :opts |
||||||
|
|
||||||
|
def initialize(search_result:, current_user:, opts: {}) |
||||||
|
@search_result = search_result |
||||||
|
@opts = opts |
||||||
|
end |
||||||
|
|
||||||
|
delegate :clean_reference_number, to: :search_result |
||||||
|
delegate :title, to: :search_result |
||||||
|
delegate :short_title, to: :search_result |
||||||
|
|
||||||
|
def date_or_year |
||||||
|
return search_result.docdate.strftime("%m/%d/%Y") if search_result.docdate.present? |
||||||
|
|
||||||
|
search_result.year |
||||||
|
end |
||||||
|
|
||||||
|
def doctrine_annotations_path(doctrine_id) |
||||||
|
doctrine_annotations_path(doctrine_id: doctrine_id) |
||||||
|
end |
||||||
|
end |
||||||
@ -0,0 +1,5 @@ |
|||||||
|
<tr href="<%= document_path(search_result.id, is_citator_tab: true) %>" class="clickable-tr" target="_blank"> |
||||||
|
<td> <%= clean_reference_number %> </td> |
||||||
|
<td> <%= short_title || title %> </td> |
||||||
|
<td> <%= date_or_year %> </td> |
||||||
|
</tr> |
||||||
Loading…
Reference in new issue