Welcome to mirror list, hosted at ThFree Co, Russian Federation.

render_service.rb « notes « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: efc9d6da2aa6f6102dc6969d7986511785a497ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Notes
  class RenderService < BaseRenderer
    # Renders a collection of Note instances.
    #
    # notes - The notes to render.
    #
    # Possible options:
    #
    # 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
    def execute(notes, options = {})
      Banzai::ObjectRenderer
        .new(user: current_user, redaction_context: options)
        .render(notes, :note)
    end
  end
end