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.
23 lines
570 B
23 lines
570 B
class AnnotationMarksModalFormComponent < BaseComponent |
|
attr_reader :document, :annotation, :opts |
|
|
|
def initialize(current_user:, document:, annotation:, opts:) |
|
@document = document |
|
@annotation = annotation |
|
@opts = opts |
|
end |
|
|
|
def document_date_or_year |
|
return document.year if document.docdate.blank? |
|
|
|
document.docdate.strftime("%B %d, %Y") |
|
end |
|
|
|
def document_title |
|
[document.title, document.reference_number, document_date_or_year].join(", ") |
|
end |
|
|
|
def render? |
|
opts[:form_url].present? && opts[:form_method].present? |
|
end |
|
end |