- page_title "Upload License"
%h3.page-title Upload License

%p.light
  To #{License.current ? "continue" : "start"} using GitLab Enterprise Edition, upload the <code>.gitlab-license</code> file or enter the license key you have received from GitLab Inc.

%hr
= form_for @license, url: admin_license_path, html: { multipart: true, class: 'fieldset-form' } do |f|
  - if @license.errors.any?
    #error_explanation
      .alert.alert-danger
        - @license.errors.full_messages.each do |msg|
          %p= msg

  .form-group.row
    .col-sm-2
    .col-sm-10
      .form-check
        = radio_button_tag :license_type, :file, @license.data.blank?, class: 'form-check-input'
        = label_tag :license_type_file, class: 'form-check-label' do
          .option-title
            Upload <code>.gitlab-license</code> file
      .form-check
        = radio_button_tag :license_type, :key, @license.data.present?, class: 'form-check-input'
        = label_tag :license_type_key, class: 'form-check-label' do
          .option-title
            Enter license key

  .form-group.row.license-file
    = f.label :data_file, "License file", class: 'col-form-label col-sm-2'
    .col-sm-10
      = f.file_field :data_file, accept: ".gitlab-license,.gitlab_license,.txt", class: "form-control"

  .form-group.row.license-key
    = f.label :data, "License key", class: 'col-form-label col-sm-2'
    .col-sm-10
      = f.text_area :data, class: "form-control license-key-field", rows: 20

  .form-actions
    = f.submit 'Upload license', class: 'btn btn-primary'
