Class: WorkActivity::ProvenanceNote

Inherits:
BaseMessage show all
Defined in:
app/models/work_activity.rb

Constant Summary

Constants inherited from Renderer

Renderer::DATE_FORMAT, Renderer::DATE_TIME_FORMAT, Renderer::SORTABLE_DATE_TIME_FORMAT, Renderer::UNKNOWN_USER

Instance Method Summary collapse

Methods inherited from BaseMessage

#mark_down_to_html, #user_refernces

Methods inherited from Renderer

#created_by_user_html, #created_sortable_html, #created_updated_html, #initialize, #title_html, #to_html

Constructor Details

This class inherits a constructor from WorkActivity::Renderer

Instance Method Details

#body_htmlObject



294
295
296
297
298
299
300
301
302
# File 'app/models/work_activity.rb', line 294

def body_html
  message_hash = JSON.parse(@work_activity.message)
  text = user_refernces(message_hash["note"])
  message = mark_down_to_html(text)
  change_label = message_hash["change_label"]&.titleize
  change_label ||= "Change"
  # TODO: Make this show the change label with the note under see changes
  "<details class='message-html'><summary class='show-changes'>#{change_label}</summary>#{message}</details>"
end