debian-mirror-gitlab/app/services/notes/render_service.rb

21 lines
580 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
module Notes
class RenderService < BaseRenderer
# Renders a collection of Note instances.
#
# notes - The notes to render.
2018-05-09 12:01:36 +05:30
#
2018-03-17 18:26:18 +05:30
# Possible options:
2018-05-09 12:01:36 +05:30
#
2018-03-17 18:26:18 +05:30
# requested_path - The request path.
# project_wiki - The project's wiki.
# ref - The current Git reference.
# only_path - flag to turn relative paths into absolute ones.
# xhtml - flag to save the html in XHTML
2018-05-09 12:01:36 +05:30
def execute(notes, options = {})
Banzai::ObjectRenderer
.new(user: current_user, redaction_context: options)
.render(notes, :note)
2018-03-17 18:26:18 +05:30
end
end
end