File: _environment_scope.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (21 lines) | stat: -rw-r--r-- 1,183 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- form_field = local_assigns.fetch(:form_field, nil)
- variable = local_assigns.fetch(:variable, nil)

- if @project
  - environment_scope = variable&.environment_scope || '*'
  - environment_scope_label = environment_scope == '*' ? s_('CiVariable|All environments') : environment_scope

  %input{ type: "hidden", name: "#{form_field}[variables_attributes][][environment_scope]", value: environment_scope }
  = dropdown_tag(environment_scope_label,
                 options: { wrapper_class: 'ci-variable-body-item js-variable-environment-dropdown-wrapper',
                            toggle_class: 'js-variable-environment-toggle wide',
                            filter: true,
                            dropdown_class: "dropdown-menu-selectable",
                            placeholder: s_('CiVariable|Search environments'),
                            footer_content: true,
                            data: { selected: environment_scope } }) do
    %ul.dropdown-footer-list
      %li
        %button{ class: "dropdown-create-new-item-button js-dropdown-create-new-item", title: s_('CiVariable|New environment') }
          = s_('CiVariable|Create wildcard')
          %code