2017-11-06 11:52:56 -05:00
|
|
|
module Notes
|
|
|
|
class RenderService < BaseRenderer
|
|
|
|
# Renders a collection of Note instances.
|
|
|
|
#
|
|
|
|
# notes - The notes to render.
|
2018-04-03 09:45:17 -04:00
|
|
|
#
|
2017-11-06 11:52:56 -05:00
|
|
|
# Possible options:
|
2018-04-03 09:45:17 -04:00
|
|
|
#
|
2017-11-06 11:52:56 -05:00
|
|
|
# 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-04-03 09:45:17 -04:00
|
|
|
def execute(notes, options = {})
|
|
|
|
Banzai::ObjectRenderer
|
|
|
|
.new(user: current_user, redaction_context: options)
|
|
|
|
.render(notes, :note)
|
2017-11-06 11:52:56 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|