You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
659 B
31 lines
659 B
class DocumentIndexTableBodyComponent < 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 |
|
|
|
def document_id |
|
search_result["id"] |
|
end |
|
|
|
def reference_number |
|
search_result["reference_number"] |
|
end |
|
|
|
def title |
|
search_result["title"] |
|
end |
|
|
|
def date_or_year |
|
return search_result["docdate"].to_date.strftime("%m/%d/%Y") if search_result["docdate"].present? |
|
|
|
search_result["year"] |
|
end |
|
|
|
def form_url |
|
doctrine_annotations_path(doctrine_id: opts[:doctrine_id]) |
|
end |
|
end
|
|
|