summaryrefslogtreecommitdiff
path: root/app/presenters/ci/variable_presenter.rb
blob: 5d7998393a6c1abc6a125d574f6866e0384725a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Ci
  class VariablePresenter < Gitlab::View::Presenter::Delegated
    presents :variable

    def placeholder
      'PROJECT_VARIABLE'
    end

    def form_path
      if variable.persisted?
        project_variable_path(project, variable)
      else
        project_variables_path(project)
      end
    end

    def edit_path
      project_variable_path(project, variable)
    end

    def delete_path
      project_variable_path(project, variable)
    end
  end
end