debian-mirror-gitlab/lib/banzai/note_renderer.rb

22 lines
714 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
module Banzai
module NoteRenderer
# Renders a collection of Note instances.
#
# notes - The notes to render.
2016-11-03 12:29:30 +05:30
# project - The project to use for redacting.
2016-08-24 12:49:21 +05:30
# user - The user viewing the notes.
# path - The request path.
# wiki - The project's wiki.
# git_ref - The current Git reference.
def self.render(notes, project, user = nil, path = nil, wiki = nil, git_ref = nil)
renderer = ObjectRenderer.new(project,
user,
requested_path: path,
project_wiki: wiki,
2016-11-03 12:29:30 +05:30
ref: git_ref)
2016-08-24 12:49:21 +05:30
renderer.render(notes, :note)
end
end
end