<section class="horizontal-form container-fluid">
  <h2>Add Certificate</h2>
  {{top-errors errors=errors}}

  <div class="row form-group">
    <div class="col-sm-12 col-md-2 form-label">
      <label>Name</label>
    </div>
    <div class="col-sm-12 col-md-8">
      {{input type="text" value=model.name classNames="form-control" placeholder="e.g. mydomain.com"}}
    </div>
  </div>

  <div class="row form-group">
    <div class="col-sm-12 col-md-2 form-label">
      <label>Description</label>
    </div>
    <div class="col-sm-12 col-md-8">
      {{textarea value=model.description classNames="form-control no-resize" rows="3" placeholder="e.g. EV cert for mydomain.com"}}
    </div>
  </div>

  <div class="row form-group">
    <div class="col-sm-12 col-md-2 form-label">
      <label>Private Key*</label>
      {{read-text-file accept="text/*, .pem, .pkey, .key" action=(action "readFile" "key")}}
    </div>
    <div class="col-sm-12 col-md-8">
      {{textarea value=model.key classNames="form-control no-resize" rows="5" placeholder="Paste in the private key, starting with -----BEGIN RSA PRIVATE KEY-----"}}
    </div>
  </div>

  <div class="row form-group">
    <div class="col-sm-12 col-md-2 form-label">
      <label>Certificate*</label>
      {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "cert")}}
    </div>
    <div class="col-sm-12 col-md-8">
      {{textarea value=model.cert classNames="form-control no-resize" rows="5" placeholder="Paste in the primary certificate, starting with -----BEGIN CERTIFICATE-----"}}
    </div>
  </div>

  <div class="row form-group">
    <div class="col-sm-12 col-md-2 form-label">
      <label>Chain Certs</label>
      {{read-text-file accept="text/*, .pem, .crt" action=(action "readFile" "certChain")}}
    </div>
    <div class="col-sm-12 col-md-8">
      {{textarea value=model.certChain classNames="form-control no-resize" rows="5" placeholder="Optional; Paste in the additional chained certificates, starting with -----BEGIN CERTIFICATE-----"}}
    </div>
  </div>
</section>

{{partial "save-cancel"}}
