= form_for [@project.namespace.becomes(Namespace), @project, @variable] do |f|
  = form_errors(@variable)

  .form-group
    = f.label :key, "Key", class: "label-light"
    = f.text_field :key, class: "form-control", placeholder: "PROJECT_VARIABLE", required: true
  .form-group
    = f.label :value, "Value", class: "label-light"
    = f.text_area :value, class: "form-control", placeholder: "PROJECT_VARIABLE"
  .form-group
    = f.label :environment_scope, "Environment scope", class: "label-light"
    = f.text_field :environment_scope, class: "form-control", placeholder: "*"
    .help-block
      This variable will be passed only to jobs with a matching environment name.
      <code>*</code> is a wildcard that matches all environments (existing or not).
      = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'limiting-environment-scopes-of-secret-variables'), target: '_blank'
  .form-group
    .checkbox
      = f.label :protected do
        = f.check_box :protected
        %strong Protected
      .help-block
        This variable will be passed only to pipelines running on protected branches and tags
        = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'protected-secret-variables'), target: '_blank'

  = f.submit btn_text, class: "btn btn-save"