internetee/registry

View on GitHub
app/views/admin/certificates/new.haml

Summary

Maintainability
Test Coverage
= render 'shared/title', name: params[:crt] ? t(:upload_crt) : t(:upload_csr)

= form_for([:admin, @api_user, @certificate], multipart: true) do |f|
  = render 'shared/full_errors', object: f.object

  .row
    .col-md-8
      .form-group
        - if params[:crt]
          .col-md-4.control-label
            = f.label :crt, t('.certificate_file')
          .col-md-8
            = f.file_field :crt
        - else
          .col-md-4.control-label
            = f.label :csr, t(:certificate_signing_req)
          .col-md-8
            = f.file_field :csr
  %hr
  .row
    .col-md-8.text-right
      = button_tag(t(:save), class: 'btn btn-primary')