BigW Consortium Gitlab

note_renderer.rb 714 Bytes
Newer Older
1 2 3 4 5
module Banzai
  module NoteRenderer
    # Renders a collection of Note instances.
    #
    # notes - The notes to render.
6
    # project - The project to use for redacting.
7 8 9 10 11 12 13 14 15
    # 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,
16
                                    ref: git_ref)
17 18 19 20 21

      renderer.render(notes, :note)
    end
  end
end